tests: attempt to persist seed data and truncate test data#5410
tests: attempt to persist seed data and truncate test data#5410BenTopping merged 22 commits intoy25-181-upgrade-to-rails-72from
Conversation
3146399 to
7bdd744
Compare
…into cucumber-fix
…ditor cucumber test
| } | ||
| """ | ||
|
|
||
| @create @error |
There was a problem hiding this comment.
The submission template is generated here https://github.com/sanger/sequencescape/blob/develop/features/support/step_definitions/submission_steps.rb#L21.
It creates a pulldown_isc request type which has no validators for requiring read_length validation as expected in the test. So I am unsure why it would expect to fail.
| } | ||
| """ | ||
|
|
||
| @create @error @asset |
There was a problem hiding this comment.
Again this tests is v1 api submissions so should be safe to remove. I suspect it is something to do with transactions here https://github.com/sanger/sequencescape/blob/develop/app/api/endpoints/submissions.rb#L17. I don't think this is getting hit though so unsure.
| @create @batch @authorised @error | ||
| Scenario Outline: Attempting to create a batch with invalid request details | ||
| Given the maximum batch size for the pipeline "Cluster formation PE" is 2 | ||
| Given the UUID for the pipeline "HiSeq 2500 PE (spiked in controls)" is "00000000-1111-2222-3333-444444444445" |
There was a problem hiding this comment.
Instead of mutating the seed data (Clust formation PE) to have a max_size of 2, we are using an different template with an existing max size of 2 so we dont need to edit seed data.
There was a problem hiding this comment.
Changes here prevent editing seed data
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## y25-181-upgrade-to-rails-72 #5410 +/- ##
===============================================================
+ Coverage 83.94% 87.33% +3.39%
===============================================================
Files 1456 1456
Lines 32654 32651 -3
Branches 3405 3405
===============================================================
+ Hits 27411 28517 +1106
+ Misses 5229 4120 -1109
Partials 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
StephenHulme
left a comment
There was a problem hiding this comment.
Great work - thanks so much for tackling this!
There was a problem hiding this comment.
This is a restricted / deprecated action and has been for almost 10 years. With removal of API V1 imminent I just removed this to save time.
d3596f1
into
y25-181-upgrade-to-rails-72
Attempts at handling cucumber test data consistently. The general approach is to seed the database once on test run start and then rely on tests not mutating it. There have been several cases we have fixed where tests were mutating it and there may be more hidden but we have got to the point it is passing.
We have changed the db cleaner strategy to only clean new data created from the current test (ignore seed data). We have had to go with this approach because transactions were not working correctly after a couple of different attempts. This approach also means we can't parallelise CI using knapsack as the shared db instance causes issues when using truncation as one test may truncate another tests data.
A lot of these tests can be removed when we deprecate V1 API which will reduce the run time. We should also focus on moving off cucumber.
Proposed changes