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 expected models are in output #52690

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

azaslavsky
Copy link
Contributor

We add a new decorator, @targets_models, for the .../backup/test_models.py test suite. The goal is two-fold: for each individual test, the decorator provides a concise way to express which models must be included in the output, lest we end up with a test that passes the equality check, but only because it excluded our target model(s) altogether. The second goal is to make the set of models being exercised in the ModelBackupTests class easily visible to static analysis tools like flake8, so that we may later create a check ensuring that all __include_in_export__ = True marked models in this repository are included in this test suite.

Issue: getsentry/team-ospo#156
Issue: getsentry/team-ospo#160

@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch from 3524e25 to 3a1a138 Compare July 13, 2023 16:59
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from 343e98c to 53f568c Compare July 13, 2023 16:59
@azaslavsky azaslavsky marked this pull request as ready for review July 13, 2023 17:06
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch from 3a1a138 to 7d04736 Compare July 13, 2023 19:35
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from 53f568c to 2e6e042 Compare July 13, 2023 19:35
@azaslavsky azaslavsky requested a review from chadwhitacre July 13, 2023 20:46
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from c697e1a to 5774faf Compare July 13, 2023 20:54
@azaslavsky azaslavsky requested review from a team July 13, 2023 20:54
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from 5774faf to e45420c Compare July 13, 2023 20:55
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jul 13, 2023
@github-actions
Copy link
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch from fcaea59 to d9f8423 Compare July 14, 2023 17:39
@azaslavsky azaslavsky requested a review from a team as a July 14, 2023 17:39
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from faa54f8 to 2251d81 Compare July 14, 2023 17:39
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch from d9f8423 to 9d825bf Compare July 14, 2023 18:29
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from 2251d81 to bcdff0c Compare July 14, 2023 18:29
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch from 9d825bf to 31afbf3 Compare July 14, 2023 18:33
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from bcdff0c to d72d146 Compare July 14, 2023 18:33
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/support_alert_rules branch 2 times, most recently from e91cdae to 17479e4 Compare July 14, 2023 21:44
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from d72d146 to ffa3026 Compare July 14, 2023 21:44
@azaslavsky azaslavsky removed Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jul 14, 2023
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #52690 (12b1476) into master (dde6eb1) will increase coverage by 2.36%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #52690      +/-   ##
==========================================
+ Coverage   77.00%   79.37%   +2.36%     
==========================================
  Files        4934     4934              
  Lines      207215   207215              
  Branches    35403    35403              
==========================================
+ Hits       159573   164478    +4905     
+ Misses      42482    37706    -4776     
+ Partials     5160     5031     -129     

see 337 files with indirect coverage changes

Base automatically changed from azaslavsky/backup/support_alert_rules to master July 14, 2023 22:37
We add a new decorator, `@targets_models`, for the
`.../backup/test_models.py` test suite. The goal is two-fold: for each
individual test, the decorator provides a concise way to express which
models must be included in the output, lest we end up with a test that
passes the equality check, but only because it excluded our target
model(s) altogether. The second goal is to make the set of models being
exercised in the `ModelBackupTests` class easily visible to static
analysis tools like flake8, so that we may later create a check ensuring
that all `__include_in_export__ = True` marked models in this repository
are included in this test suite.

Issue: getsentry/team-ospo#156
Issue: getsentry/team-ospo#160
@azaslavsky azaslavsky force-pushed the azaslavsky/backup/target_models_decorator branch from ffa3026 to 12b1476 Compare July 14, 2023 22:38
@azaslavsky azaslavsky enabled auto-merge (squash) July 14, 2023 22:39
@azaslavsky azaslavsky merged commit d4a0ce2 into master Jul 14, 2023
@azaslavsky azaslavsky deleted the azaslavsky/backup/target_models_decorator branch July 14, 2023 23:12
armenzg pushed a commit that referenced this pull request Jul 17, 2023
We add a new decorator, `@targets_models`, for the
`.../backup/test_models.py` test suite. The goal is two-fold: for each
individual test, the decorator provides a concise way to express which
models must be included in the output, lest we end up with a test that
passes the equality check, but only because it excluded our target
model(s) altogether. The second goal is to make the set of models being
exercised in the `ModelBackupTests` class easily visible to static
analysis tools like flake8, so that we may later create a check ensuring
that all `__include_in_export__ = True` marked models in this repository
are included in this test suite.

Issue: getsentry/team-ospo#156
Issue: getsentry/team-ospo#160
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants