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

explicitly migrate the test DB #492

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions theforeman.org/pipelines/lib/foreman.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def configureDatabase(ruby) {
bundleInstall(ruby, '--without=development')
archiveArtifacts(artifacts: 'Gemfile.lock')
bundleExec(ruby, 'rake db:drop >/dev/null 2>/dev/null || true')
bundleExec(ruby, 'rake db:create --trace')
bundleExec(ruby, 'rake db:create --trace RAILS_ENV=test')
bundleExec(ruby, 'rake db:create --trace RAILS_ENV=production')
bundleExec(ruby, 'rake db:migrate --trace')
Copy link
Member

Choose a reason for hiding this comment

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

I'd like consistency with the db:create statements.

Copy link
Member Author

Choose a reason for hiding this comment

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

and by consistency you mean "delete the creates, they are implicit by migrate"? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

mhh, we still need create for prod (which is not migrated, but needs to exist for asset compilation, and we probably do not properly set DATABASE_URL=nulldb://nohost everywhere)

Copy link
Member Author

Choose a reason for hiding this comment

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

so I updated the create to have RAILS_ENV=test, that should be safe, we can get things rolling (again) and do the cleanup later.

bundleExec(ruby, 'rake db:migrate --trace RAILS_ENV=test')
}

def cleanup(ruby) {
Expand Down