-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactor tests to use fixtures #797
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 98.00% 98.00% -0.01%
==========================================
Files 443 443
Lines 36566 36532 -34
==========================================
- Hits 35838 35804 -34
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 98.00% 98.00% -0.01%
==========================================
Files 443 443
Lines 36566 36532 -34
==========================================
- Hits 35838 35804 -34
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 98.00% 98.00% -0.01%
==========================================
Files 443 443
Lines 36566 36532 -34
==========================================
- Hits 35838 35804 -34
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This is because the tests were failing on duplicate keys. Fixtures reuses existing objects, which avoids creating objects with duplicate keys.
Because pullid=1 was removed from the CommitFactory (due to unintended consequences of creating a Pull object), we now need to be explicit about setting it in a few places.
ccdd38b
to
8d85121
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
- Coverage 98.00% 98.00% -0.01%
==========================================
Files 443 443
Lines 36566 36532 -34
==========================================
- Hits 35838 35804 -34
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This is because the tests were failing on duplicate keys. Fixtures reuses existing objects, which avoids creating objects with duplicate keys.
This was also extracted from #729 .
Also, since I also got rid of the Test Class, there's also a lot of white space changes. I would suggest selecting
Hide whitespace
when reviewing this.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.