Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make WebSection seeds idempotent #3658

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Make WebSection seeds idempotent #3658

merged 1 commit into from
Aug 7, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Jul 9, 2019

References

Objectives

  • Make the seeds task idempotent
  • Reduce the number of records created when running the tests
  • Fix some flaky specs which failed because they loaded too many records

Notes

Creating more records before every test meant after running model tests the table had potentially thousands of records, and tests rendering all of them were slower and sometimes exceeded Capybara's wait time.

I've updated #3621 so after upgrading to Rails 5.1 at least the seeds will only be loaded once when running the tests. Maybe we shouldn't even load the seeds file, and just execute Setting.reset_defaults 🤔, but then we would need to change the tests relying on default custom pages being created.

@javierm javierm self-assigned this Jul 9, 2019
Each time we were loading the seeds file, more web sections were
created.

On production it meant running `db:seeds` several times created the
records even if they already existed.

During the test, it meant 5 more records were created before every test,
so after ending a test run, thousands of records existed, making banner
tests very slow.
@javierm javierm merged commit 7985271 into master Aug 7, 2019
@javierm javierm deleted the fix_web_section_seeds branch August 7, 2019 01:07
@javierm javierm added this to Release 1.1.0 in Roadmap Sep 10, 2019
@javierm javierm added the seeds label Sep 11, 2019
@javierm javierm added Maintenance and removed seeds labels Sep 30, 2019
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

Flaky spec: Admin banners magement Edit banner with live refresh
2 participants