Improving generation of frontend-fixtures
What is the productivity problem to solve?
Generating frontend-fixtures takes a rather long time. It takes ~15 minutes locally and ~17 minutes on CI. This affects productivity both in local development as well as in getting feedback from CI, as front end test job is dependent on the fixtures.
Based on investigation in #207071 (closed), the root cause is due to use of rspec in generating fixtures, where the database is repeatedly called during test set up in order to create test data.
Problem identification checklist
-
The root cause of the problem is identified. -
The surface of the problem is as small as possible. => We discovered several areas where the frontend fixtures generation could be improved. Therefore, we tried different approaches to iterate on these areas and explore potential improvements.
What are the potential solutions?
- Commit generated fixture files into the repository, to avoid having to create and seed database
- Use a fixed database seeds to seed the data for fixture generation
Verify that the solution has improved the situation
-
The solution improved the situation => Frontend MRs with .jsfile changes now reuse frontend fixtures. This has reduced the time for therspec-all frontend-fixturejob to complete from 6-8 minutes to just 3-4 minutes. Additionally, we have an upcoming issue that will enable reusing fixtures for.js,.vue,.md,.scssfile changes.- If yes, check this box and close the issue. Well done!
🎉 - Otherwise, create a new "Productivity Improvement" issue. You can re-use the description from this issue, but obviously another solution should be chosen this time.
- If yes, check this box and close the issue. Well done!
Related issues
There have been multiple issues and discussions in the past related to this problem. Listing here for reference:
Edited by Nao Hashizume