-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add docker-based setup for running test workflows #274
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like where this is going, but left a few comments/questions 🙏🏽
@@ -0,0 +1,24 @@ | |||
services: | |||
n8n: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we want everything in docker here? I thought what we wanted was to run only external services in docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally, I'd also love to run n8n in docker, so that I don't need to tear down my n8n home instance. Of course I can do that differently, but this means that you don't forget when running your tests.
Do you think we should remove it from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus: this makes it easy to create your test-workflows inside the docker; makes it easy to connect over the local docker-network, etc.
echo | pnpm install | ||
|
||
echo building n8n | ||
pnpm build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could save some time by skipping frontend build using pnpm build:backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by building inside docker (instead of directly on the CI VM), we can't use the turbo build cache. We also can't reuse a built version of n8n from a previous step in the CI.
perhaps we should update this script to assume that n8n is already built when these tests start?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can remove that step!
The clean command might fail if `turbo` isn't installed, which means there's probably nothing left to clean.
- ../n8n:/n8n | ||
- ./:/test-workflows | ||
- ./output:/output | ||
- ./docker-data/dot-n8n:/home/node/.n8n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add this variable to make it work for me, without it it fails on git hooks which are disabled for docker
environment:
- DOCKER_BUILD=true
For snapshot, a separate helper command has been created: | ||
|
||
``` | ||
COMMAND="snapshot SNAPSHOT_ID" dc up --exit-code-from n8n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMMAND="snapshot SNAPSHOT_ID" dc up --exit-code-from n8n | |
COMMAND="snapshot SNAPSHOT_ID" docker compose up --exit-code-from n8n |
You can use multiple, comma-separated snapshot ids like so: | ||
|
||
``` | ||
COMMAND="snapshot 251,252" dc up --exit-code-from n8n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMMAND="snapshot 251,252" dc up --exit-code-from n8n | |
COMMAND="snapshot 251,252" docker compose up --exit-code-from n8n |
@@ -1 +1 @@ | |||
1,4,5,10,19,20,21,22,26,27,28,29,30,31,33,34,38,39,40,41,42,43,45,46,47,49,50,51,54,56,57,59,64,65,66,68,69,72,73,74,75,76,77,78,79,80,82,85,89,92,94,102,106,109,110,112,113,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,134,133,135,136,137,138,139,141,142,144,145,146,147,148,149,151,157,158,159,160,163,164,165,167,168,169,170,171,173,176,179,180,183,184,185,186,187,188,189,190,191,192,193,196,197,198,199,200,201,204,206,207,208,214,215,217,218,219,220,221,222,224,225,226,227,252 | |||
1,4,5,10,19,20,21,22,26,27,28,29,30,31,33,34,38,39,40,41,42,43,45,46,47,49,50,51,54,56,57,59,64,65,66,68,69,72,73,74,75,76,77,78,79,80,82,85,89,92,94,102,106,109,110,112,113,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,134,133,135,136,137,138,139,141,142,144,145,146,147,148,149,151,157,158,159,160,163,164,165,167,168,169,170,171,173,176,179,180,183,184,185,186,187,188,189,190,191,192,193,196,197,198,199,200,201,204,206,207,208,214,215,217,218,219,220,221,222,224,225,226,227 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool 🎉
I left some minor comments apart from that looks great 🙏
This setup allows you to run the tests with docker compose, without ensuring your own
~/.n8n
is clean and/or backed up.