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

Move simplecov config into rails_helper #30302

Merged
merged 2 commits into from
May 15, 2024

Conversation

mjankowski
Copy link
Contributor

Extracted from #30284

I had previously done the extraction into the .simplecov file, which seemed harmless at the time, but introduced a subtle load order bug that I finally hit on that flatware PR.

When you require simplecov, it checks if the .simplecov file exists, and if it does, immediately loads/runs it. This is fine when you do that once, but if you have multiple places that need to do different portion of the config (the flatware PR has one place for flatware to interact with the at_fork setting of simplecov and other place for the core/regular config) it means you've lost control of when to do which things.

So, this is a few changes:

  • Delete .simplecov and move its contents into rails_helper (it needs to be here instead of spec_helper for similar load order reasons ... we want it loaded after the core initial rspec setup, but before all the rails loading happens)
  • Add a monkey patch for a simplecov branch merge bug (see linked PR in the file)
  • Small style improvement on how the formatter is assigned

I'm curious to confirm the codecov results on this one by itself - but also this felt like a good extraction from the flatware PR to keep that one focused on just adding flatware and not on unrelated simplecov config.

@ClearlyClaire ClearlyClaire added this pull request to the merge queue May 15, 2024
Merged via the queue into mastodon:main with commit 6beead3 May 15, 2024
30 checks passed
@mjankowski mjankowski deleted the simplecov-config-changes-only branch May 15, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants