Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Verifying db migrations in testfm? #78

Open
mirekdlugosz opened this issue Jun 24, 2019 · 2 comments
Open

Verifying db migrations in testfm? #78

mirekdlugosz opened this issue Jun 24, 2019 · 2 comments

Comments

@mirekdlugosz
Copy link

From user perspective, foreman_docker removal is done largely by foreman-maintain - relevant db migrations are run as part of upgrade procedure. I briefly checked code here, but it seems that testfm doesn't have any support for db migrations testing yet.

Is my assertion correct?

If it is, what would need to be done to enable db migrations testing here? Is this relatively small, or rather large task?

@ntkathole
Copy link
Contributor

@Mirzal We are not testing db migration in testfm. The goal behind this is to validate foreman-maintain. Db migration is validated via our upgrade job and customer db jobs. In case of foreman-maintain, what we can test is whether removal of docker using foreman-maintain is successful or not.

Removal of foreman_docker is post-migration task.
foreman-maintain upgrade run --phase post_migrations

@Mirzal We can add test case for this post-migration phase. will it work for you?

@mirekdlugosz
Copy link
Author

@ntkathole In fact, there are two things done - db migrations during upgrade, and later post_migrations (which runs foreman-rake foreman_docker:cleanup and then removes RPM).

I guess covering post_migrations part in testfm would work for me.
But I have a question: when during Satellite upgrade cycle testfm tests are run? Before upgrade? After upgrade? something else?

Command you provided also requires --target-version. It will fail on Satellite 6.6, as there is no version you can upgrade to.
It probably will work on Satellite 6.5 (haven't checked yet), but I'm afraid it will mess up with 6.5->6.6 upgrade process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants