chore: improve slow tests #2258
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The below tests are slow due to the feedback test data creation. I reduced the amount of feedback created to reduce to slowness. In test
planner/spec/features/admin/feedback_spec.rb:11
10 pieces of feedback are generated withFabricate
. To me 10 seems excessive so I have reduced this to 2 to speed the test up. In the other test 3 pieces of feedback and 3 pieces of other_feedback were being created and I have reduced this to 1 in each (total of 2).The slow tests:
planner/spec/features/admin/feedback_spec.rb:11
'can access the feedback page'
locally the test run time went from 27.41s to 6.45s
planner/spec/features/admin/chapter/feedback_spec.rb:4
'is only available to chapter organisers'
locally the test run time went from 25.19s to 13.27s