Added script to verify all tests scenario are associated with a version tag#2421
Added script to verify all tests scenario are associated with a version tag#2421SylvainSenechal wants to merge 2 commits into
Conversation
Hello sylvainsenechal,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
|
|
||
| import 'cli-testing/hooks/KeycloakSetup'; | ||
| import 'cli-testing/hooks/Logger'; | ||
| import 'cli-testing/hooks/versionTags'; |
There was a problem hiding this comment.
wrote why im doing this in the top comment of the pr
e44d3eb to
9cc8b56
Compare
| }, | ||
| "dependencies": { | ||
| "@cucumber/cucumber": "^12.7.0", | ||
| "@cucumber/cucumber": "^12.9.0", |
There was a problem hiding this comment.
kinda useless because of the caret but still did it as im adding the dev dependencies
9cc8b56 to
eb6b33b
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
eb6b33b to
25c5bee
Compare
DarkIsDude
left a comment
There was a problem hiding this comment.
Adding a check to enforce that all scenarios are tagged with a version, this will be nice for documentation for which documentation ?
https://github.com/scality/Zenko/pull/2421/changes#r3281331971 reading that. Why ? We have git history for that if needed ?
There was a problem hiding this comment.
We usually put them in .github/scripts ? Also we should have tests for it 🙏
| } | ||
| } | ||
| } | ||
| // Background nodes are intentionally ignored |
There was a problem hiding this comment.
You have twice the same comment https://github.com/scality/Zenko/pull/2421/changes#diff-637785e467dea30f38c5f19d551eefd93a7feffae2da263d44066c7d8c8c2adcR55. It's maybe better to add the why, than just describing the code (if relevant).
| totalScenarios++; | ||
| const hasVersion = featureHasVersion || child.scenario.tags.some(t => VERSION_TAG_REGEX.test(t.name)); | ||
| if (!hasVersion) { | ||
| offenders.push(` ${rel}:${child.scenario.location.line} — "${child.scenario.name}"`); |
| offenders.push(` ${rel}:${child.scenario.location.line} — "${child.scenario.name}"`); | ||
| } | ||
| } else if (child.rule) { | ||
| // Version tag can be inherited from Feature or Rule |
There was a problem hiding this comment.
| // Version tag can be inherited from Feature or Rule |
| const hasVersion = featureHasVersion || ruleHasVersion | ||
| || ruleChild.scenario.tags.some(t => VERSION_TAG_REGEX.test(t.name)); | ||
| if (!hasVersion) { | ||
| offenders.push(` ${rel}:${ruleChild.scenario.location.line} — "${ruleChild.scenario.name}"`); |
There was a problem hiding this comment.
You can create a new function to do that instead of duplicating the logic (ruleChild vs child).
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following reviewers are expecting changes from the author, or must review again: |
| - name: Check for unused step definitions | ||
| working-directory: tests/functional | ||
| run: yarn unused-steps | ||
| - name: Check that all scenarios have a version tag |
There was a problem hiding this comment.
why do we want that?
this "tagging" was introduced when CTST was used in Artesca, and embedded the tests : so there was one version of CTST and tests targeting multiple zenko versions.
the tests are now managed in git -so the information is really available via git blame or others-, I don't see the benefit of manually adding the tag on every test?
There was a problem hiding this comment.
Well, yes, there is another version of this pr where I just remove all tags + the useless before hook
I kinda liked having directly visible tags attached to the scenarios as its faster to read than commits but you're right

Issue: ZENKO-5282
Some cleanup of a hook defined in cli-testing.
So the hook is simply removed for now.