Skip to content

fix: Inverted tag and grep untagged #28256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

CaiqueCoelho
Copy link

@CaiqueCoelho CaiqueCoelho commented Nov 7, 2023

Additional details

Problem: Improper Handling of Negative Tags in shouldTestRun

The shouldTestRun function needs to correctly interpret negative tags (e.g., -@burn). If it does not, then it might incorrectly determine that tests with the @burn tag should run when they should not, or it might exclude tests without any tags.

Fix: Refactor shouldTestRun to handle negative tags and grepUntagged with true

We have ensured that the shouldTestRun function (and any helper function like shouldTestRunTags it relies on) interprets negative tags correctly. This means if -@burn is passed, the function should return false for any test with the @burn tag and true for tests without the @burn tag. Also when passing grepUntagged as true now we analyze test by test whether it has a direct tag from the it block or inherits a tag from the describe block

Steps to test

All the following unit tests using shouldTestRun and shouldTestRunTags methods should pass on the following file npm/grep/cypress/e2e/unit.js

@CLAassistant
Copy link

CLAassistant commented Nov 7, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ jennifer-shehane
✅ CaiqueCoelho
✅ caique-rd
❌ Caíque Coelho


Caíque Coelho seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cypress-app-bot
Copy link
Collaborator

@CaiqueCoelho CaiqueCoelho changed the title Inverted tag and grep untagged fix: Inverted tag and grep untagged Nov 7, 2023
@CaiqueCoelho
Copy link
Author

Hey folks, could we have someone taking a look on this, please? 🙏 cc @ryanthemanuel @jennifer-shehane

@cypress-app-bot
Copy link
Collaborator

This PR has not had any activity in 180 days. If no activity is detected in the next 14 days, this PR will be closed.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jul 18, 2024
@cypress-app-bot
Copy link
Collaborator

This PR has been closed due to inactivity

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm: @cypress/grep @cypress/grep package issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inverted tag for cypress-grep and grepUntagged doesn't work
5 participants