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 for missing migrations #71

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

mgax
Copy link
Contributor

@mgax mgax commented Dec 13, 2023

Check if there are missing migrations and, if so, fail the test.

mgax added a commit to mgax/wagtail-ab-testing that referenced this pull request Dec 13, 2023
@mgax mgax marked this pull request as ready for review December 13, 2023 12:40
@Stormheg Stormheg mentioned this pull request Dec 13, 2023
@Stormheg Stormheg force-pushed the test-for-missing-migrations branch from e6962bc to 3cefd2b Compare December 13, 2023 14:00
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (52fd72c) 87.84% compared to head (73f6bfa) 87.84%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #71   +/-   ##
=======================================
  Coverage   87.84%   87.84%           
=======================================
  Files          15       15           
  Lines         732      732           
  Branches      137      137           
=======================================
  Hits          643      643           
  Misses         54       54           
  Partials       35       35           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

from django.test import TestCase


class TestReportView(TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe the test class name here needs to be updated...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, copypasta fail :) Thanks for spotting this!

@jhonatan-lopes
Copy link
Collaborator

I hadn't seen missing migrations being tested like this before, but it seems like an elegant solution 👍

I usually call the makemigrations --check somewhere in the CI, but I guess a test in the suite seems fine

@mgax mgax requested a review from jhonatan-lopes December 14, 2023 13:44
Copy link
Collaborator

@jhonatan-lopes jhonatan-lopes left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Stormheg Stormheg merged commit bc80443 into wagtail-nest:main Dec 14, 2023
11 checks passed
@mgax mgax deleted the test-for-missing-migrations branch December 14, 2023 13:57
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.

3 participants