Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

test migrations in CI #134

Open
1 task done
markus2330 opened this issue Mar 21, 2023 · 6 comments · Fixed by #596 · May be fixed by #1247
Open
1 task done

test migrations in CI #134

markus2330 opened this issue Mar 21, 2023 · 6 comments · Fixed by #596 · May be fixed by #1247
Assignees
Labels

Comments

@markus2330
Copy link
Contributor

markus2330 commented Mar 21, 2023

We should run:

  • diesel migration redo and diesel migration redo -a within the PR CI job
  • diesel migration redo within the master (dev) CI jobs

to test if migrations can successfully be redone.

  • Missing: check if schema is the same afterwards
@markus2330 markus2330 added the CI label May 31, 2023
@4ydan 4ydan self-assigned this Jun 30, 2023
This was referenced Jul 9, 2023
@4ydan 4ydan linked a pull request Jul 13, 2023 that will close this issue
20 tasks
@4ydan
Copy link
Contributor

4ydan commented Jul 15, 2023

Not execatly sure how to do this in the current state of the pipeline. There is no docker inside the PR and master stage, so there is no possibilities of running diesel inside those stages.
Do I stash the diesel executable over into those stages? Would that even work?

@markus2330
Copy link
Contributor Author

When you build the backend, it always runs the migrations. So the easiest way probably is to run these tests directly after building.

Btw. #644 would fail these migration tests (on purpose).

@4ydan
Copy link
Contributor

4ydan commented Jul 16, 2023

Ok, that was a misunderstanding from my side, I see what you want now.

@markus2330
Copy link
Contributor Author

I think the tests are not yet complete.

The test should also check if the generated schema stays the same after redoing the migrations.

Ideally, they would also test if no data gets removed.

(Changes in triggers etc. like done in #684 are out-of-scope as this can be easily seen in code reviews and the potential harm for the productive system is small.)

@markus2330 markus2330 reopened this Jul 23, 2023
@markus2330 markus2330 moved this to Current Sprint in PermaplanT Apr 2, 2024
@filo14 filo14 moved this from Current Sprint to In Progress in PermaplanT Apr 4, 2024
@filo14 filo14 linked a pull request Apr 5, 2024 that will close this issue
27 tasks
@markus2330
Copy link
Contributor Author

@filo14 great work, are all scenarios written in the top post tested now? Please check them.

@filo14
Copy link
Contributor

filo14 commented Apr 8, 2024

@markus2330 we check all of these, if that is what is meant:

  • do migration
  • check schema
  • do remigration
  • check if schema changed compared to only one migration (with no remigration)

@filo14 filo14 moved this from In Progress to In Review in PermaplanT Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: In Review
4 participants