Title: Odd default ordering of tests when using contexts · Issue #1036 · utPLSQL/utPLSQL · GitHub
Open Graph Title: Odd default ordering of tests when using contexts · Issue #1036 · utPLSQL/utPLSQL
X Title: Odd default ordering of tests when using contexts · Issue #1036 · utPLSQL/utPLSQL
Description: Describe the bug When a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification. When test suite contains a context, the ordering is no longer directly related ...
Open Graph Description: Describe the bug When a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification. When test suite contains a context, the...
X Description: Describe the bug When a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification. When test suite contains a context,...
Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/1036
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Odd default ordering of tests when using contexts","articleBody":"**Describe the bug**\r\nWhen a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification.\r\n\r\nWhen test suite contains a context, the ordering is no longer directly related to test or context position in test suite.\r\n\r\n**Provide version info**\r\nAffects all versions that support contexts.\r\n\r\n\r\n**To Reproduce**\r\nCreate two test packages. One with contexts one without.\r\n```sql\r\ncreate or replace package demo_1 as\r\n --%suite\r\n\r\n --%test(First)\r\n procedure t1;\r\n --%test(Second)\r\n procedure t2;\r\n --%test(Third)\r\n procedure t3;\r\n --%test(Forth)\r\n procedure t4;\r\nend;\r\n/\r\ncreate or replace package body demo_1 as\r\n procedure t1 is begin null; end;\r\n procedure t2 is begin null; end;\r\n procedure t3 is begin null; end;\r\n procedure t4 is begin null; end;\r\nend;\r\n/\r\ncreate or replace package demo_2 as\r\n --%suite\r\n\r\n --%test(First)\r\n procedure t1;\r\n\r\n --%context(Context 1)\r\n\r\n --%test(Second)\r\n procedure t2;\r\n\r\n --%endcontext\r\n --%context(Context 2)\r\n\r\n --%test(Third)\r\n procedure t3;\r\n\r\n --%endcontext\r\n\r\n --%test(Forth)\r\n procedure t4;\r\nend;\r\n/\r\ncreate or replace package body demo_2 as\r\n procedure t1 is begin null; end;\r\n procedure t2 is begin null; end;\r\n procedure t3 is begin null; end;\r\n procedure t4 is begin null; end;\r\nend;\r\n/\r\n```\r\n\r\nRun tests:\r\n`call ut.run('demo_1,demo_2');`\r\n\r\nResults are:\r\n```\r\ndemo_2\r\n Context 2\r\n Third [.006 sec]\r\n Context 1\r\n Second [.003 sec]\r\n First [.003 sec]\r\n Forth [.003 sec]\r\n\r\ndemo_1\r\n First [.001 sec]\r\n Second [.001 sec]\r\n Third [.001 sec]\r\n Forth [.001 sec]\r\n\r\nFinished in .028732 seconds\r\n8 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)\r\n```\r\n\r\n**Expected behavior**\r\nRun tests:\r\n`call ut.run('demo_1,demo_2');`\r\n\r\nResults are:\r\n```\r\ndemo_2\r\n First [.003 sec]\r\n Context 1\r\n Second [.003 sec]\r\n Context 2\r\n Third [.006 sec]\r\n Forth [.003 sec]\r\n\r\ndemo_1\r\n First [.001 sec]\r\n Second [.001 sec]\r\n Third [.001 sec]\r\n Forth [.001 sec]\r\n\r\nFinished in .028732 seconds\r\n8 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)\r\n```\r\n\r\n**Additional context**\r\nThe ordering of tests is mostly relevant when trying to write tests as documentation for your code, so that the tests tell a story.\r\n\r\n","author":{"url":"https://github.com/jgebal","@type":"Person","name":"jgebal"},"datePublished":"2019-12-29T00:58:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1036/utPLSQL/issues/1036"}
| 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:30634e46-acc2-76be-5768-c52a413b9938 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECBA:F3B95:5571C4:7ACF07:6A637408 |
| html-safe-nonce | eb352c7937e76f75b46d617b58b63551b4489a10fd388e7e8cbc9e398c06ae8a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0JBOkYzQjk1OjU1NzFDNDo3QUNGMDc6NkE2Mzc0MDgiLCJ2aXNpdG9yX2lkIjoiNzA2NjkwMDg4ODEwNDk1NjkzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f585c81238a616d4a8b3e00ed939271ee5fb6d05ee99128b3e7025a00d1171ae |
| hovercard-subject-tag | issue:543299785 |
| 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/1036/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f06fa31e8ffefd50c1b9f5a76e774cbc6ab00689a1357d77655f0771de344eb/utPLSQL/utPLSQL/issues/1036 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f06fa31e8ffefd50c1b9f5a76e774cbc6ab00689a1357d77655f0771de344eb/utPLSQL/utPLSQL/issues/1036 |
| og:image:alt | Describe the bug When a test suite doesn't contain contexts, the default ordering of tests is determined by test procedure position in package specification. When test suite contains a context, the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jgebal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 15e78334bb345f3864e70c5a376ed0383374123629b9e3022398d9431f6cd8bf |
| 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 | 51da2d8d0a841a1393b806a6559fa9ad757e1666 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width