Skip to content

Reduce number of teams created in the seeds#6177

Merged
thomasleese merged 3 commits intonextfrom
speed-up-seeds
Mar 4, 2026
Merged

Reduce number of teams created in the seeds#6177
thomasleese merged 3 commits intonextfrom
speed-up-seeds

Conversation

@thomasleese
Copy link
Copy Markdown
Contributor

This changes the seeds so that we don't create CIS2 teams in non-CIS2 environments, which means the seeds run quicker for local development.

There's definitely more we could do to improve the speed of seeding the database, but this helps a lot.

Before

❯ time bin/rails db:seed:replant
________________________________________________________
Executed in   76.13 secs    fish           external
   usr time   50.15 secs    0.20 millis   50.15 secs
   sys time    3.22 secs    1.70 millis    3.22 secs

After

❯ time bin/rails db:seed:replant
________________________________________________________
Executed in   43.53 secs    fish           external
   usr time   28.21 secs    0.34 millis   28.21 secs
   sys time    2.31 secs    2.03 millis    2.31 secs

These are not useful in non-CIS2 environments since they can't be logged
in to.
These were once necessary when seeding the QA environment, but the end
to end tests now pick schools at random.
@thomasleese thomasleese added this to the v7.2.0 milestone Mar 3, 2026
@thomasleese thomasleese requested a review from a team as a code owner March 3, 2026 21:02
@thomasleese thomasleese added refactor Improving maintainability performance Improving performance labels Mar 3, 2026
@thomasleese thomasleese enabled auto-merge March 3, 2026 21:02
This should introduce a slight performance improvement when running the
seeds.
@thomasleese thomasleese merged commit 4c9cf31 into next Mar 4, 2026
13 checks passed
@thomasleese thomasleese deleted the speed-up-seeds branch March 4, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Improving performance refactor Improving maintainability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants