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

Stop createing invalid test data #43964

Merged
merged 2 commits into from
Jan 4, 2022
Merged

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Dec 7, 2021

Use build instead, rather than trying to persist these. They don't need to be persisted, and because they're being created without associated mapping objects, they fail validation.

Failing validation is not a serious problem right now, but starting with Rails 6 it will cause the tests themselves to start failing. Switching to build ensures the tests will work consistently between versions.

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Use `build` instead, rather than trying to persist these. They don't need to be persisted, and because they're being created without associated mapping objects, they fail validation.

Failing validation is not a serious problem right now, but starting with Rails 6 it will cause the tests themselves to start failing. Switching to `build` ensures the tests will work consistently between versions.
@Hamms Hamms added the Rails Upgrade All work related to upgrading the version of Ruby on Rails we use. label Dec 7, 2021
@Hamms Hamms marked this pull request as ready for review January 4, 2022 20:35
@Hamms Hamms requested review from a team January 4, 2022 20:35
@cat5inthecradle
Copy link
Contributor

Does this also speed things up?

Copy link
Member

@davidsbailey davidsbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

@Hamms
Copy link
Contributor Author

Hamms commented Jan 4, 2022

It theoretically will speed things up a little just because we're not persisting anything anymore, but I'd be surprised if changing so few tests has have any kind of noticeable effect.

@Hamms Hamms merged commit 9eb5324 into staging Jan 4, 2022
@Hamms Hamms deleted the stop-creating-invalid-test-data branch January 4, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rails Upgrade All work related to upgrading the version of Ruby on Rails we use.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants