GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feature/1042 add `and` to tags by lwasylow · Pull Request #1250 · utPLSQL/utPLSQL

Conversation

@lwasylow

@lwasylow lwasylow commented Mar 31, 2023 •
edited by jgebal
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #1042

Introduction of expressions for running tests with tags

Tag Expressions

Tag expressions are boolean expressions created by combining tags with the !, &, | operators. Tag expressions can be grouped using ( and ) braces. Grouping tag expressions affects operator precedence.

Two reserved keywords, any and none, can be used when creating a tag expression to run tests.

  • any keyword represents tests and suites with any tags
  • none keyword represents tests and suites without tags

These keywords may be combined with other expressions just like normal tags.

Note: When specifying none, be aware that it will exclude any tests/suites/contexts contained within a tagged suite.

Operator Meaning
! not
& and
| or

If you are tagging your tests across multiple dimensions, tag expressions help you to select which tests to execute. When tagging by test type (e.g., micro, integration, end-to-end) and feature (e.g., product, catalog, shipping), the following tag expressions can be useful.

Tag Expression Selection
product all tests for product
catalog | shipping all tests for catalog plus all tests for shipping
catalog & shipping all tests that are tagged with both catalog and shipping tags
product & !end-to-end all tests tagged product, except the tests tagged end-to-end
(micro | integration) & (product | shipping) all micro or integration tests for product or shipping

Taking the last expression above (micro | integration) & (product | shipping)

--%tags included in run
micro no
integration no
micro no
product no
shipping no
micro no
micro, integration no
product, shipping no
micro, product yes
micro, shipping yes
integration, product yes
integration, shipping yes
integration, micro, shipping yes
integration, micro, product yes
integration, shipping ,product yes
micro, shipping ,product yes
integration, micro, shipping ,product yes

Excluding tests/suites by tags

It is possible to exclude parts of test suites with tags.
In order to do so, prefix the tag name to exclude with a ! (exclamation) sign when invoking the test run which is equivalent of - (dash) in legacy notation.
Examples:

select * from table(ut.run(a_tags => '(api|fast)&!complex'));
select * from table(ut.run(a_tags => '(api|fast)&!complex&!test1'));

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lwasylow added 9 commits March 27, 2023 21:56
@lwasylow
Checkpoint
0daab33
@lwasylow
Address too long identified in 11g.
adbc76e
Address flaky expression checker to be reworked.
@lwasylow
Adding validation for tag expression
1478b0d
@lwasylow
Comment out to see why its failing.
b5ad747
@lwasylow
Revert "Comment out to see why its failing."
06cb054
This reverts commit b5ad747.

Revert "Adding validation for tag expression"

This reverts commit 1478b0d.
@lwasylow
Adding validate function, with no calls
e87d39f
@lwasylow
Remove a & from text
97537de
@lwasylow
Extra changes and added tests
2a0f99a
@lwasylow
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
5b46140
…ture/1042_add_and_to_tags
@codecov

codecov Bot commented Mar 31, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Patch coverage: 99.24% and project coverage change: +0.11 🎉

Comparison is base (8b01a39) 94.78% compared to head (46ffe73) 94.89%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1250      +/-   ##
===========================================
+ Coverage    94.78%   94.89%   +0.11%     
===========================================
  Files          109      111       +2     
  Lines         5173     5286     +113     
  Branches        24       24              
===========================================
+ Hits          4903     5016     +113     
- Misses         262      263       +1     
+ Partials         8        7       -1     
Flag Coverage Δ
11XE 94.27% <99.24%> (+0.15%) ⬆️
12.1EE 94.27% <98.48%> (+0.13%) ⬆️
18XE 94.48% <99.24%> (+0.10%) ⬆️
21XE 94.65% <99.24%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
source/core/types/ut_run.tpb 93.93% <ø> (ø)
source/core/ut_utils.pkb 94.69% <ø> (+0.24%) ⬆️
source/core/ut_suite_tag_filter.pkb 99.09% <99.09%> (ø)
source/api/ut_runner.pkb 95.91% <100.00%> (-0.13%) ⬇️
source/core/types/ut_stack.tpb 100.00% <100.00%> (ø)
source/core/ut_suite_cache_manager.pkb 97.01% <100.00%> (-0.43%) ⬇️
source/core/ut_suite_manager.pkb 96.72% <100.00%> (+0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Mar 31, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Unit Test Results

       1 files         2 suites   5m 24s ⏱️
1 047 tests 1 043 ✔️ 4 💤 0 ❌
1 050 runs  1 042 ✔️ 8 💤 0 ❌

Results for commit 46ffe73.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasylow added 2 commits April 1, 2023 08:31
@lwasylow
Address sonar coverage issues.
b30688c
@lwasylow
Adding tests covering exception of invalid tags
0c41a0f
@lwasylow

lwasylow commented Apr 1, 2023

Copy link
Copy Markdown
Member Author

So seems like there is no hit in perf:
New code:
Finished in 9.393748 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

First run took+000000000 00:01:26.587663000

Finished in 16.495174 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Second run took+000000000 00:01:17.189142000

Finished in 13.658072 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

third run took+000000000 00:01:20.499584000

old

Finished in 16.167675 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

First run took+000000000 00:03:37.830094000

Finished in 13.127262 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Second run took+000000000 00:03:29.262099000

Finished in 10.98218 seconds
2000 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)

Third run took+000000000 00:03:01.665203000

jgebal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasylow added 2 commits April 1, 2023 11:26
@lwasylow
Removing that , we will not implement that, there is no benefit at th…
543685d
…e moment.
@lwasylow
Removing force
0d3cfa1
@lwasylow
lwasylow requested a review from jgebal April 7, 2023 05:29
@lwasylow

lwasylow commented Apr 7, 2023

Copy link
Copy Markdown
Member Author

@jgebal I'm also considering to add keywords none() and any(). What you think? It will take an extra time to implement.
Also not sure if that would have any usage so maybe keep it simple :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal

jgebal commented Apr 7, 2023

Copy link
Copy Markdown
Member

I can review this PR after Wednesday.
Sorry for delay.

What is the idea behind any() and none()?
Can you explain how it would work?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow

lwasylow commented Apr 7, 2023

Copy link
Copy Markdown
Member Author

Aye, no rush. As for keyword as per junit5
Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags. docs

jgebal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow

lwasylow commented Apr 7, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Got some small changes to do still.
Want to validate using a shunting algorithm and polish reverse notation.
That should allow me to put a back later on to SQL filter of tag members string in infix notation.
The initial idea of using regex was flaky and unreliable.
The RPN supports all complex expressions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasylow added 9 commits April 9, 2023 18:47
@lwasylow
Changing to use Dijkstra algorithm to parse infix notation into postf…
20e3177
…ix ( Reverse Polish Notation).

This allows us to more flexibility of using boolean expressions and not limited to flaky regex.
@lwasylow
Missing slash at end of type
f51cc99
@lwasylow
Cleanup.
4b8e2ab
Fix object name length.
@lwasylow
Update tests after removed function
84e8684
@lwasylow
Tidy up tests
2e7a766
@lwasylow
Added ut_stack to uninstall
cbdf83a
@lwasylow
Addressing test failures and sonar smells
436eb5b
@lwasylow
Update name
3d77514
@lwasylow
Update tests and code
bf6959f
lwasylow added 2 commits April 11, 2023 20:33
@lwasylow
fixing typo in docs
d8233ff
@lwasylow
Removed unused variable
bd860f6
jgebal
jgebal reviewed Apr 12, 2023
View reviewed changes

@jgebal jgebal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the code you wrote. It's realitvely easy to digest. The except rnp and infix/postfix logic is of course quite complex and hard to grasp without some reading.

I added quite few comments but they are mostly cosmetic/readability and maintainability oriented.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/userguide/annotations.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/annotations.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/api/ut_runner.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/types/ut_stack.tps Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/types/ut_stack.tpb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_utils.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_utils.pks Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_suite_cache_manager.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/ut3_tester/core/test_ut_utils.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/ut3_tester/core/test_ut_utils.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

lwasylow added 5 commits April 12, 2023 18:40
@lwasylow
Stage 1 Resolving PR comments
313d5e9
@lwasylow
Separate tag logic.
02a071c
@lwasylow
Fix uninstall
b8b66ee
@lwasylow
Various PR fixe
077fdb1
@lwasylow
Update tests and code
01e5364
jgebal
jgebal reviewed Apr 17, 2023
View reviewed changes

@jgebal jgebal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a complete review yet, but few comments.
I'll need a bit more time to look through it all.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasylow reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/annotations.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_suite_cache_manager.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_suite_cache_manager.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_suite_cache_manager.pks Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread source/core/ut_suite_cache_manager.pks Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow
Addressing changes via PR review.
dc0b4a6
@jgebal

jgebal commented Apr 18, 2023

Copy link
Copy Markdown
Member

Aye, no rush. As for keyword as per junit5 Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags. docs

Sounds like a great idea.
You want to do it as part of this PR or separate after this one is done?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jgebal
jgebal reviewed Apr 18, 2023
View reviewed changes
Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow
Update docs
ef1c02b
@lwasylow

lwasylow commented Apr 19, 2023

Copy link
Copy Markdown
Member Author

Aye, no rush. As for keyword as per junit5 Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags. docs

Sounds like a great idea. You want to do it as part of this PR or separate after this one is done?

Let's get that in new PR.
It will be cleaner to review and write tests as well as update documentation.
I started already working on change and seems like it small one but need to write more complex tests and scenarios.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow
Adding any and none
1551ea5
@lwasylow

lwasylow commented Apr 25, 2023

Copy link
Copy Markdown
Member Author

Aye, no rush. As for keyword as per junit5 Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags. docs

Sounds like a great idea. You want to do it as part of this PR or separate after this one is done?

Let's get that in new PR. It will be cleaner to review and write tests as well as update documentation. I started already working on change and seems like it small one but need to write more complex tests and scenarios.

I have added into existing PR as the change was minimal.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lwasylow
Update docs
9dee7e0
jgebal
jgebal reviewed Apr 26, 2023
View reviewed changes
Comment thread source/core/ut_suite_cache_manager.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/annotations.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/userguide/running-unit-tests.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

jgebal
jgebal reviewed Apr 26, 2023
View reviewed changes
Comment thread source/core/ut_suite_tag_filter.pkb Resolved

Uh oh!

There was an error while loading. Please reload this page.

lwasylow added 2 commits April 26, 2023 17:30
@lwasylow
Resolving PR
beb9a3a
@lwasylow
Update note
46ffe73
@sonarqubecloud

sonarqubecloud Bot commented Apr 27, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

99.3% 99.3% Coverage
0.0% 0.0% Duplication

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jgebal
jgebal approved these changes Apr 28, 2023
View reviewed changes
@jgebal
jgebal merged commit 46e0a8e into develop Apr 28, 2023
@jgebal
jgebal deleted the feature/1042_add_and_to_tags branch April 28, 2023 09:09
@alexeyhimself

alexeyhimself commented Apr 28, 2023

Copy link
Copy Markdown

👏👏👏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal jgebal changed the title Feature/1042 add and to tags Feature/1042 add and to tags May 21, 2023
@jgebal jgebal added this to the v3.1.14 milestone May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jgebal jgebal jgebal approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v3.1.14

Development

Successfully merging this pull request may close these issues.

Support "AND" logic to tags for the tests runner

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@lwasylow @jgebal @alexeyhimself
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.