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 support for running E2E tests without seeded data #14285
Conversation
Thinking about the seed file for admin onboarding @Ridhwana, and correct me if I'm wrong, but I don't think we need a seed file at all, just the initial DB state correct? If that's the case, it makes things even simpler. |
@nickytonline correct, just the initial db state is good for now. |
…ue to seeds_e2e.rb" This reverts commit 6018ae7.
…erent-seed-support
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.
There are minimal changes in this PR. It looks like a lot of files, but it's because all current E2E tests have been moved to a seededFlows
folder in Cypress' integration folder.
cypress/integration/seededFlows/readingListFlows/readingListArchive.spec.js
Show resolved
Hide resolved
Just looking into why the new E2E build node is failing even though the tests pass in Cypress. The error it's giving is related to the Bluepird Promise library, but I'm not sure why. And it's having difficulty with ====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ nonSeededFlows/test.spec.js 69ms 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 69ms 1 1 - - -
(node:8819) Warning: a promise was created in a handler at internal/timers.js:461:21 but was not returned from it, see http://goo.gl/rRqMUw
at Function.Promise.cast (/home/travis/.cache/Cypress/7.7.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:225:13)
(Use `Cypress --trace-warnings ...` to show where the warning was created)
Cleaning up and stopping server for end to end tests.
/home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task_manager.rb:59:in `[]': Don't know how to build task 'db:truncate_all' (See the list of available tasks with `rake --tasks`) (RuntimeError)
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:405:in `[]'
from /home/travis/build/forem/forem/config/initializers/cypress_[secure].rb:28:in `block in <main>'
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/cypress-[secure]-0.5.1/lib/cypress-[secure]/initializer_hooks.rb:38:in `block in run'
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/cypress-[secure]-0.5.1/lib/cypress-[secure]/initializer_hooks.rb:37:in `each'
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/cypress-[secure]-0.5.1/lib/cypress-[secure]/initializer_hooks.rb:37:in `run'
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/cypress-[secure]-0.5.1/lib/cypress-[secure]/launches_cypress.rb:58:in `run_exit_hooks_if_necessary!'
from /home/travis/build/forem/forem/vendor/bundle/ruby/2.7.0/gems/cypress-[secure]-0.5.1/lib/cypress-[secure]/launches_cypress.rb:43:in `block in set_exit_hooks!'
The command "SKIP_SEED_DATA=1 E2E_FOLDER=nonSeededFlows bin/e2e-ci" exited with 1.
cache.2
store build cache
Artifacts support disabled for pull requests
Done. Your build exited with 1. |
The only thing about these changes that I have on my mind is DX when folks need to write non-seeded E2E tests. Are they OK running |
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'm sure whatever DX pains we're going to have we'll understand better once we do have them.
It definitely can be done in a follow up PR once we exhibit the DX pains. 😎 |
I'm waiting the US SRE team to be online to merge this because if we missed anything it'll block the CI pipeline for all :) |
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.
🎉 Super excited for this! Thanks Nick, it looks good.
I'm going to go ahead and merge as we're almost 9am Eastern. |
What type of PR is this? (check all applicable)
Description
This makes changes to E2E testing infrastructure allowing folks to write tests that use seeded data (typical use case) or no seed data (atypical use case), e.g. admin onboarding.
Related Tickets & Documents
#14259
QA Instructions, Screenshots, Recordings
N/A This is testing infrastructure
UI accessibility concerns?
N/A This is testing infrastructure
Added/updated tests?
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Admin Guide, or
Storybook (for Crayons components)
or in a forem.dev post
replace this line with details on why this change doesn't need to be
shared
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?