Tests: Use a videos fixture instead of seeding videos.csv #27788
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.
Use a videos fixture file instead of seeding videos from videos.csv for dashboard unit tests. Follow-up work to #27780, see that PR for original context.
Will mentioned on Friday that we could stop depending on videos.csv entirely and add a videos fixture for tests instead. I thought this was worth a try.
Concerns
One concern that's been raised is that testing with videos.csv does actually catch issues. I'm not worried about this, because the same validation step that caused problems in the unit tests Friday is also run as part of the regular
rake seed:videos
task, so these issues should be caught even if we're using fixtures for tests.Another: I see more than 90 different video keys referenced in ourlevel.yml
fixture file. We've only got 340 rows in videos.csv. If I end up needed to add fixtures for all of those videos to get tests passing, is it worth maintaining video fixtures separate from our videos.csv file at all?See also: https://api.rubyonrails.org/v3.1/classes/ActiveRecord/Fixtures.html