-
Notifications
You must be signed in to change notification settings - Fork 973
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
Run Teardown after each test #1818
Run Teardown after each test #1818
Conversation
We currently run Teardown at the end of a scenario, but whenever we fail to load in a scenario the tests are erroring and we don't perform the cleanup Fixes: redwoodjs#1815
I need to test this against a PR package since the local RWT flow is broken at the moment. |
I don't have full context of this, but wouldn't it make more sense to use |
@dac09 You want to reload the scenario's on a per test basis. Otherwise they start to interfere with each other. |
Thanks for this @jvanbaarsen This looks good to me and I'd like to get it into the v0.26.0 release. Will loop in @cannikin for the final ok.
^^ Do either of you have any suggestions about how to test for this. And/or could you confirm you've tested this locally and it's working as intended? |
Yeah if you can confirm this is working as planned it looks good to me @jvanbaarsen Were you ever able to test it against a PR release? Does this take care of the case where a scenario seed fails? We've got an open issue #1804 to address that, but this change might fix it. One way to test is to add another model to the scenario that doesn't exist: const standard = defineScenario({
post: {
one: {
title: 'First post'
}
},
foo: 'bar'
}) That should throw an error like /cc @agiannelli this PR might have coincidentally fixed your issue as well! |
@thedavidprice / @cannikin Please hold back a bit with merging this. I haven't been able to properly test this just yet (Should have put this back in Draft -- edit: Turns out I'm not able to return this as a draft 🙈 ) |
Ready for review! You can test this by running the following steps:
|
Yep! Sorry @agiannelli I wasn’t aware that these issues were overlapping :( |
@jvanbaarsen no need to apologize! I'm still working on getting my local up and running anyway 🙈 |
@agiannelli Let me know if you need any help with that 👍 |
Hi All! I'm looking into this now as a potential patch release. brb!! |
In this GIF metaphor the water is the extra records left around in the database. |
We currently run Teardown at the end of a scenario, but whenever we fail
to load in a scenario the tests are erroring and we don't perform the
cleanup
Fixes: #1815