-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: Move worker billing functionality to shared #436
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
- Coverage 90.56% 89.81% -0.75%
==========================================
Files 390 324 -66
Lines 11768 9379 -2389
Branches 1974 1677 -297
==========================================
- Hits 10658 8424 -2234
+ Misses 1026 891 -135
+ Partials 84 64 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dbsession.add(owner) | ||
dbsession.flush() | ||
|
||
encrypted_license = "wxWEJyYgIcFpi6nBSyKQZQeaQ9Eqpo3SXyUomAqQOzOFjdYB3A8fFM1rm+kOt2ehy9w95AzrQqrqfxi9HJIb2zLOMOB9tSy52OykVCzFtKPBNsXU/y5pQKOfV7iI3w9CHFh3tDwSwgjg8UsMXwQPOhrpvl2GdHpwEhFdaM2O3vY7iElFgZfk5D9E7qEnp+WysQwHKxDeKLI7jWCnBCBJLDjBJRSz0H7AfU55RQDqtTrnR+rsLDHOzJ80/VxwVYhb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used in API, if they pose a security issue it would've been flagged.
class TestBillingServiceTestCase(object): | ||
@override_settings(IS_ENTERPRISE=True) | ||
@pytest.fixture | ||
def dbsession(self, db): | ||
return db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer these to remain fn-based tests rather than class-based tests in general.
Also this specific fixture seems to only be responsible for renaming the magic fn argument?
I believe it would be clearer to just use the existing fixture, or to add the dbsession
fixture globally so all tests can use it. I would also clean up the used fixtures a bit, though it might not be quite clear which ones are used, as pytest fixtures are often just triggering sideeffects :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the parts that required the tests to be class-based when I cleaned up the API tests, so function-based tests now make more sense
As part of adding the new plan work, we are moving billing and plan stuff to shared.
This file can be found in https://github.com/codecov/worker/blob/main/services/billing.py
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.