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 .js file changes now reuse frontend fixtures. This has reduced the time for the rspec-all frontend-fixture job 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, .scss file 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.

Related issues

There have been multiple issues and discussions in the past related to this problem. Listing here for reference:

/cc @gl-quality/eng-prod @leipert @mikegreiling

Edited by Nao Hashizume