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

test(backup): Ensure coverage of all exportable models #53295

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

azaslavsky
Copy link
Contributor

The basic idea here is to include a test that finds all non-abstract descendants of our BaseModel, filter down to just the exportable ones (ie, those that set __include_in_export__ = True), and then ensure that each of them is included in at least one of the tests seen in test_models.py. This is done by introducing a new mark wrapper class which ingests all of the "target" models used by the @targets test decorator at init time, allowing us to create an exhaustive list of all types passed to @targets.

Issue: getsentry/team-ospo#156

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 20, 2023
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/flake8 branch from 073e863 to 25906ad Compare July 20, 2023 18:32
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/test_coverage branch from 5c09cc8 to 1e07fda Compare July 20, 2023 18:32
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #53295 (22f26b5) into master (9fd943a) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 22f26b5 differs from pull request most recent head c057e81. Consider uploading reports for the commit c057e81 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #53295      +/-   ##
==========================================
- Coverage   79.55%   79.52%   -0.03%     
==========================================
  Files        4942     4939       -3     
  Lines      208542   208076     -466     
  Branches    35525    35479      -46     
==========================================
- Hits       165903   165478     -425     
+ Misses      37586    37560      -26     
+ Partials     5053     5038      -15     

see 71 files with indirect coverage changes

@azaslavsky azaslavsky requested a review from chadwhitacre July 20, 2023 19:03
Base automatically changed from azaslavsky/backup/flake8 to master July 20, 2023 19:40
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/test_coverage branch from 1e07fda to 6a518ba Compare July 20, 2023 20:45
@azaslavsky azaslavsky requested review from hubertdeng123 and removed request for chadwhitacre July 21, 2023 16:07
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/test_coverage branch from efdb281 to dc8dfc1 Compare July 21, 2023 16:23
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/test_coverage branch from dc8dfc1 to 162371c Compare July 21, 2023 16:40
@azaslavsky azaslavsky changed the base branch from master to azaslavsky/backup/in_place2 July 21, 2023 16:42
Base automatically changed from azaslavsky/backup/in_place2 to master July 21, 2023 17:10
Copy link
Member

@chadwhitacre chadwhitacre left a comment

Choose a reason for hiding this comment

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

Approved with minor docstring suggestion.

The basic idea here is to include a test that finds all non-abstract
descendants of our `BaseModel`, filter down to just the exportable ones
(ie, those that set `__include_in_export__ = True`), and then ensure
that each of them is included in at least one of the tests seen in
`test_models.py`. This is done by introducing a new `mark` wrapper class
which ingests all of the "target" models used by the `@targets` test
decorator at init time, allowing us to create an exhaustive list of all
types passed to `@targets`.

Issue: getsentry/team-ospo#156
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/test_coverage branch from 162371c to c057e81 Compare July 21, 2023 21:46
@azaslavsky azaslavsky enabled auto-merge (squash) July 21, 2023 21:50
@azaslavsky azaslavsky merged commit 95260f3 into master Jul 21, 2023
@azaslavsky azaslavsky deleted the azaslavsky/backup/test_coverage branch July 21, 2023 22:13
armenzg pushed a commit that referenced this pull request Jul 24, 2023
The basic idea here is to include a test that finds all non-abstract
descendants of our `BaseModel`, filter down to just the exportable ones
(ie, those that set `__include_in_export__ = True`), and then ensure
that each of them is included in at least one of the tests seen in
`test_models.py`. This is done by introducing a new `mark` wrapper class
which ingests all of the "target" models used by the `@targets` test
decorator at init time, allowing us to create an exhaustive list of all
types passed to `@targets`.

Issue: getsentry/team-ospo#156
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants