Title: Wrong result for has_suite and is_suite when suite annotation is missing · Issue #976 · utPLSQL/utPLSQL · GitHub
Open Graph Title: Wrong result for has_suite and is_suite when suite annotation is missing · Issue #976 · utPLSQL/utPLSQL
X Title: Wrong result for has_suite and is_suite when suite annotation is missing · Issue #976 · utPLSQL/utPLSQL
Description: Describe the bug The functions ut_runner.has_suites and ut_runner.is_suite return a true, even if the annotation suite is missing. Provide version info Information about utPLSQL and Database version, SQL> declare 2 l_version varchar2(255...
Open Graph Description: Describe the bug The functions ut_runner.has_suites and ut_runner.is_suite return a true, even if the annotation suite is missing. Provide version info Information about utPLSQL and Database versio...
X Description: Describe the bug The functions ut_runner.has_suites and ut_runner.is_suite return a true, even if the annotation suite is missing. Provide version info Information about utPLSQL and Database versio...
Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/976
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wrong result for has_suite and is_suite when suite annotation is missing","articleBody":"**Describe the bug**\r\n\r\nThe functions `ut_runner.has_suites` and `ut_runner.is_suite` return a true, even if the annotation `suite` is missing.\r\n\r\n**Provide version info**\r\n\r\nInformation about utPLSQL and Database version, \r\n```\r\nSQL\u003e declare\r\n 2 l_version varchar2(255);\r\n 3 l_compatibility varchar2(255);\r\n 4 begin\r\n 5 dbms_utility.db_version( l_version, l_compatibility );\r\n 6 dbms_output.put_line( l_version );\r\n 7 dbms_output.put_line( l_compatibility );\r\n 8 end;\r\n 9 /\r\n19.0.0.0.0\r\n19.0.0\r\n\r\n\r\nPL/SQL procedure successfully completed.\r\n\r\nSQL\u003e select substr(ut.version(),1,60) as ut_version from dual;\r\n\r\nUT_VERSION \r\n------------------------------------------------------------\r\nv3.1.8.3148-develop \r\n\r\nSQL\u003e select * from v$version;\r\n\r\nBANNER\r\n--------------------------------------------------------------------------------\r\nBANNER_FULL\r\n------------------------------------------------------------------------------------------------------------------------------------\r\nBANNER_LEGACY CON_ID\r\n-------------------------------------------------------------------------------- ----------\r\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production \r\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production \r\nVersion 19.2.0.0.0 \r\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production 0\r\n\r\n\r\nSQL\u003e select * from nls_session_parameters;\r\n\r\nPARAMETER VALUE \r\n------------------------------ ----------------------------------------------------------------\r\nNLS_LANGUAGE AMERICAN \r\nNLS_TERRITORY SWITZERLAND \r\nNLS_CURRENCY SFr. \r\nNLS_ISO_CURRENCY SWITZERLAND \r\nNLS_NUMERIC_CHARACTERS .' \r\nNLS_CALENDAR GREGORIAN \r\nNLS_DATE_FORMAT DD.MM.RR \r\nNLS_DATE_LANGUAGE AMERICAN \r\nNLS_SORT BINARY \r\nNLS_TIME_FORMAT HH24:MI:SSXFF \r\nNLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF \r\nNLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR \r\nNLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR \r\nNLS_DUAL_CURRENCY SF \r\nNLS_COMP BINARY \r\nNLS_LENGTH_SEMANTICS BYTE \r\nNLS_NCHAR_CONV_EXCP FALSE \r\n\r\n17 rows selected. \r\n\r\nSQL\u003e select substr(dbms_utility.port_string,1,60) as port_string from dual;\r\n\r\nPORT_STRING \r\n------------------------------------------------------------\r\nx86_64/Linux 2.4.xx \r\n```\r\n\r\n**Information about client software**\r\n\r\nnot relevant.\r\n\r\n**To Reproduce**\r\n\r\n1. connect to a schema without test suites\r\n\r\n2. create the following package\r\n```sql\r\ncreate or replace package test_pkg is\r\n -- %test\r\n procedure t1;\r\n\r\n -- %Test\r\n procedure t2;\r\n\r\n procedure t3;\r\nend test_pkg;\r\n/\r\n```\r\n\r\n3. run the following query:\r\n```sql\r\nwith \r\n function has_suites return varchar2 is\r\n begin\r\n if ut_runner.has_suites(user) then\r\n return 'true';\r\n else \r\n return 'false';\r\n end if;\r\n end;\r\n function is_suite return varchar2 is\r\n begin\r\n if ut_runner.is_suite(user, 'test_pkg') then\r\n return 'true';\r\n else \r\n return 'false';\r\n end if;\r\n end;\r\n function is_test return varchar2 is\r\n begin\r\n if ut_runner.is_test(user, 'test_pkg', 't1') then\r\n return 'true';\r\n else \r\n return 'false';\r\n end if;\r\n end;\r\nselect has_suites, is_suite, is_test from dual;\r\n```\r\n\r\n4. look at the result\r\n```\r\nHAS_SUITES IS_SUITE IS_TEST \r\n---------- ---------- ----------\r\ntrue true false \r\n```\r\nthe values for `has_suites` and `is_suite` are wrong.\r\n\r\n5. run tests\r\n```sql\r\nselect * from table(ut.run('SCOTT'));\r\n```\r\n\r\n6. look at the result\r\n```\r\nResult Sequence \r\n---------------\r\nFinished in .000021 seconds\r\n0 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)\r\n```\r\nYou see that no tests are executed, this is expected and it confirms, that the result for `has_suites` and `is_suite` are wrong.\r\n\r\n7. run alternative annotation cache query\r\n```sql\r\nselect *\r\nfrom table(ut_runner.get_suites_info(user, null))\r\nwhere item_type in ('UT_TEST', 'UT_SUITE');\r\n```\r\nthis query returns no rows, which is correct. An additional confirmation that the result for `has_suites` and `is_suite` are wrong.\r\n\r\n**Expected behavior**\r\n\r\n`has_suites` and `is_suite` should return false, if the annotation `suite` is not defined.\r\n","author":{"url":"https://github.com/PhilippSalvisberg","@type":"Person","name":"PhilippSalvisberg"},"datePublished":"2019-07-15T13:00:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/976/utPLSQL/issues/976"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fef98aa9-9393-13d9-7d8d-0ca66baf71cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA1C:3A35C6:BA1B52:FA5722:696ABEE5 |
| html-safe-nonce | a4bc88e32d1b9cc5810bcc362a637ab7c53e4bcb1919f5671f25d30514ad02d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTFDOjNBMzVDNjpCQTFCNTI6RkE1NzIyOjY5NkFCRUU1IiwidmlzaXRvcl9pZCI6IjM0NjYzMTgxMTMyMjczMjUxNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 25691bb8fd4c123808eafc6d8e344794fd4ec55a3d205c2f0e4bbba6c42c1d1a |
| hovercard-subject-tag | issue:468114073 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/utPLSQL/utPLSQL/976/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3e02bb926629e0339c569463ba4bc6536f31eea7b99fe5e8c04d1c21962c964/utPLSQL/utPLSQL/issues/976 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3e02bb926629e0339c569463ba4bc6536f31eea7b99fe5e8c04d1c21962c964/utPLSQL/utPLSQL/issues/976 |
| og:image:alt | Describe the bug The functions ut_runner.has_suites and ut_runner.is_suite return a true, even if the annotation suite is missing. Provide version info Information about utPLSQL and Database versio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PhilippSalvisberg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 46ce962e0e18113ea447391b6ace8b02d4d2861e57b4fbab3658698f73d8855b |
| turbo-cache-control | no-preview |
| go-import | github.com/utPLSQL/utPLSQL git https://github.com/utPLSQL/utPLSQL.git |
| octolytics-dimension-user_id | 15661281 |
| octolytics-dimension-user_login | utPLSQL |
| octolytics-dimension-repository_id | 50728220 |
| octolytics-dimension-repository_nwo | utPLSQL/utPLSQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50728220 |
| octolytics-dimension-repository_network_root_nwo | utPLSQL/utPLSQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 30300f30bb3949de255e84a146706a3bdb5c19c9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width