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

chore: enable manual testing of migrations #5645

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

gastonfournier
Copy link
Contributor

About the changes

This adds a Makefile to make it easy to test migrations from one version of Unleash to another.

The script depends on docker compose V2

Before starting: make sure you're inside test-migrations folder and run make clean to be in a clean state.

We can run 2 versions of Unleash side by side with a shared database (the second version will apply migrations to the DB):

UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:latest make start-another-unleash # defaults to port 4243
make test # run basic UI tests against port 4242 (first image)
EXPOSED_PORT=4243 make test # run basic UI tests against port 4243

This also enables us to test our local repository with our code of Unleash server running at port 4244 (EXPOSE_PORT=4444 make run-current if you want to change it):

UNLEASH_DOCKER_IMAGE=unleashorg/unleash-server:5.6.10 make start-unleash # defaults to port 4242
make run-current # exposes the current backend at 4244

You can also connect the latest UI to any of the ports specified above, starting the UI at port 3000:

EXPOSED_PORT=4242 make run-current-ui # exposed port defaults to 4244 which is the port of the current backend

Copy link

vercel bot commented Dec 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2023 0:27am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Dec 14, 2023 0:27am

Copy link
Member

@chriswk chriswk left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +10 to +11
db: process.env.DATABASE_URL
? undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way we can send DATABASE_URL instead of what we're doing currently. The problem with our current solution is that this db object always takes precedence

@gastonfournier gastonfournier merged commit 1338496 into main Dec 14, 2023
14 checks passed
@gastonfournier gastonfournier deleted the migrations-manual-testing branch December 14, 2023 14:12
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.

2 participants