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
chore: [Multi-domain] Break out separate CI tasks to test the driver with experimentalSessionAndOrigin on #21148
Conversation
Thanks for taking the time to open a PR!
|
@@ -2306,32 +2280,6 @@ describe('src/cy/commands/navigation', () => { | |||
return null | |||
}) | |||
}) | |||
|
|||
it('does not wait for stability at the end of the command queue when not stable with experimentalSessionAndOrigin', (done) => { |
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.
test moved to the stability test file
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.
Now it's been combined with the test here, so it flexes the test based on the experimental flag
}) | ||
}) | ||
|
||
context('#page loading', () => { |
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.
this test was added from the navigation test file.
@@ -5,7 +5,9 @@ | |||
"scripts": { | |||
"clean-deps": "rm -rf node_modules", | |||
"cypress:open": "node ../../scripts/cypress open", | |||
"cypress:run": "node ../../scripts/cypress run", | |||
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(multi-domain)/**/*\"", |
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 had to do this in two passes. The first glob includes all test files at the level of the multi-domain folder, the second glob includes all tests files beyond the multi-domain folder but not including it.
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 think the serialization unit tests outside the multi-domain
directory will run twice once #20949 makes it way in. They should work in both scenarios with the flag on/off, but one of the runs will be redundant. I don't think it's a big deal, but I figure I would surface it here.
packages/driver/package.json
Outdated
"cypress:run": "node ../../scripts/cypress run", | ||
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(multi-domain)/**/*\"", | ||
"cypress:open-experimentalSessionAndOrigin": "node ../../scripts/cypress open --config experimentalSessionAndOrigin=true", | ||
"cypress:run-experimentalSessionAndOrigin": "node ../../scripts/cypress run --config experimentalSessionAndOrigin=true --spec \"cypress/integration/e2e/multi-domain/**/*\"", |
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.
the 'multi-domain' folder should probably be renamed, but that is a task for another PR
packages/driver/cypress/integration/commands/navigation_spec.js
Outdated
Show resolved
Hide resolved
packages/driver/cypress/integration/e2e/multi-domain/stability_spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Matt Schile <mschile@gmail.com>
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.
This implementation does not spark joy. We are creating 4 new jobs bringing us to 90 jobs once 10.0-release
merges, and there is a hard limit of 100. Also, it's just... not the most elegant solution 😄
@mjhenkes tells me that the target date for x-origin is ~2 months out, so it's not the worst thing to have this temporarily. But if this was for longer-term, I'd prefer to see a neater solution, like using an internal Cypress.backend()
to signal to the proxy that cy.origin is enabled for these tests.
@mjhenkes I see that this doesn't revert most of the changes made to the driver-integration
test suite in feature-multidomain
, will there be a future PR to revert those changes?
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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 think the e2e cross origin navigation
system tests and some of the other cy.origin
system needs needs to still be system tests because they may completely fail depending on whether the experimentalSessionAndOrigin
is on or off, but we can migrate these tests back into integration tests once we have a solution similar to what @flotwig is talking about?
@@ -5,7 +5,9 @@ | |||
"scripts": { | |||
"clean-deps": "rm -rf node_modules", | |||
"cypress:open": "node ../../scripts/cypress open", | |||
"cypress:run": "node ../../scripts/cypress run", | |||
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(multi-domain)/**/*\"", |
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 think the serialization unit tests outside the multi-domain
directory will run twice once #20949 makes it way in. They should work in both scenarios with the flag on/off, but one of the runs will be redundant. I don't think it's a big deal, but I figure I would surface it here.
driver-integration-tests-firefox-experimentalSessionAndOrigin: | ||
<<: *defaults | ||
resource_class: medium | ||
parallelism: 5 |
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.
Should we bump this to 6 or 7 since so many tests for multi-domain since we were concerned with longer CI times?
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.
It's hard to get a direct comparison but with current parallelization the CI job seems to run for roughly the same duration as our existing job. So I don't think we need to bump these right now.
I was not planning on reverting changes made to the driver-integration test suite that were not addressed in this PR. The changes made are preparing us to be able to enable this feature flag in the future and in general align with our best practice stance of isolating tests from each other. Additionally, with this setup we are proving that the tests will work with the feature flag both on and off. |
@mjhenkes It does change the nature of a lot of assertions though... I don't really think it's a good idea to change a bunch of unrelated tests in a PR. If we're merging the experimental version of a feature, why would it need to change tests for non-experimental code? We can always cherry-pick the test changes back in, not like we'd lose much. Also, it was a conscious choice to not follow "best practices" of using |
Could you point out some examples of this? The changes to enable sessions should in theory largely be visiting for each test instead of visiting once in a before. If we're changing what we're asserting on, we should give that a deeper look.
You're right. If we could do it over we would have made these changes in develop then merged them down into our brach. Unfortunately at this point we're running up against a time constraint, and while I don't think it's ideal to have these test changes, I also don't think it should prevent the PR from being merged as we have test case coverage.
We do need these changes, with this PR we are running all driver tests with
I pass no judgement on either approach, however, once I also really really wish github would let me respond to general comments so I didn't have to do all this quoting nonsense. 😞 |
User facing changelog
n/a
Additional details
This pr creates 4 new CI jobs to run driver tests with the
experimentalSessionAndOrigin
feature flag enabled.They are creatively named:
driver-integration-tests-firefox-experimentalSessionAndOrigin
driver-integration-tests-chrome-experimentalSessionAndOrigin
driver-integration-tests-chrome-beta-experimentalSessionAndOrigin
driver-integration-tests-electron-experimentalSessionAndOrigin
These jobs only run tests in the 'e2e/multi-domain' folder
The standard jobs have be updated to run all tests not in the 'e2e/multi-domain' folder.
Before
driver-integration-tests-chrome
test count was 4748After
driver-integration-tests-chrome
test count is 4419driver-integration-tests-chrome-experimentalSessionAndOrigin
test count is 329for a total of 4748 (4419 + 329)
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?