Skip to content
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

Added major Tagged Test Filter configurations #639

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Yemaneberhan-Lemma
Copy link
Contributor

For this to function, we need to have tagged test scripts.

Copy link

Npm packages

Package From To
@cypress/grep NEW 4.1.0

@@ -6,7 +6,9 @@ on:
tags:
- "*"
pull_request:

schedule: # Scheduled nightly and weekly jobs
Copy link
Member

Choose a reason for hiding this comment

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

Will this schedule also deploy the job? Either we should skip the deployment or create a new workflow with just the Cypress tests running.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hussainweb Creating a new separate workflow with just Cypress tests is a good idea since the above triggers all the ci.yml workflow.

export default defineConfig({
projectId: 'contrib-tracker',
chromeWebSecurity: false, // To Bypass Same-Origin Policy - Useful for social-media-link-check test
video: process.env.CYPRESS_VIDEO !== 'false', // Defaults to true unless explicitly set to 'false'
e2e: {
baseUrl: process.env.CYPRESS_BASE_URL || 'https://contrib.axelerant.com', // Default to prod url if no base URL is set
env: {
grepTags: 'expensive'
Copy link
Member

Choose a reason for hiding this comment

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

What does this line do? From my limited knowledge, it seems it will assign all tests this tag which seems incorrect. Please clarify.

Copy link
Contributor Author

@Yemaneberhan-Lemma Yemaneberhan-Lemma Oct 28, 2024

Choose a reason for hiding this comment

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

@hussainweb This line sets a default value for grepTags as expensive in the Cypress environment. This means, unless overridden, Cypress will only run tests that have been specifically tagged - expensive.

web/themes/custom/contribtracker/cypress/support/index.js Outdated Show resolved Hide resolved
Comment on lines +6 to +11
"cypress-open": "cypress open --env version=prod --browser chrome",
"cypress-run": "cypress run --env version=prod --browser chrome",
"cypress:run:without-video": "CYPRESS_VIDEO=false cypress run --env version=prod",
"test:smoke": "cypress run --env grepTags=smoke",
"test:regression": "cypress run --env grepTags=regression",
"test:expensive": "cypress run --env grepTags=expensive"
Copy link
Member

Choose a reason for hiding this comment

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

Let's have a consistent syntax to run the tests. This is too confusing: some with hyphen, some with a different prefix...

"cypress-run": "cypress run --browser chrome",
"cypress:run:without-video": "CYPRESS_VIDEO=false cypress run"
"cypress-open": "cypress open --env version=prod --browser chrome",
"cypress-run": "cypress run --env version=prod --browser chrome",
Copy link
Member

Choose a reason for hiding this comment

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

Didn't we get rid of version=prod previously? @zeshanziya, do you remember?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hussainweb Yes, we removed this. I kind of remember the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants