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

allow pytest --migrations to succeed #14663

Commits on Nov 16, 2023

  1. allow pytest --migrations to succeed

    * We actually subvert migrations from running in test via pytest.ini
      --no-migrations option. This has led to bit rot for the sqlite
      migrations happy path. This changeset pays off that tech debt and
      allows for an sqlite migration happy path.
    * This paves the way for programatic invocation of individual migrations
      and weaving of the creation of resources (i.e. Instance, Job Template,
      etc). With this, a developer can instantiate various database states,
      trigger a migration, assert the state of the db, and then have pytest
      rollback all of that.
    * I will note that in practice, running these migrations is dog shit
      slow BUT this work also opens up the possibility of saving and
      re-using sqlite3 database files. Normally, caching is not THE answer
      and causes more harm than good. But in this case, our migrations are
      mostly write-once (I say mostly because this change set violates
      that :) so cache invalidation isn't a major issue.
    chrismeyersfsu committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    bcd10be View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2023

  1. functional test for migrations on sqlite

    * We commonly subvert running migrations in test land. Test land uses
      sqlite. By not constantly exercising this code path it atrophies. The
      smoke test here is to continuously exercise that code path.
    * Add ci test to run migration tests separately, they take =~ 2-3
      minutes each on my laptop.
    * The smoke tests also serves as an example of how to write migration
      tests.
    chrismeyersfsu committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    5a021eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3d040c3 View commit details
    Browse the repository at this point in the history