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
Running tests in docker does not wait for completion #6
Comments
hm. I am using it within github-ci which i believe is docker/osi based. could you provide a repro? |
@betaboon There you go: https://github.com/bmz1/vite-wtr-plugin-repro |
adapted from here diff --git a/Dockerfile b/Dockerfile
index 28b322d..d25fb95 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,12 +14,6 @@ RUN apt-get update \
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV DOCKER=true
-COPY package.json yarn.lock /app/
+RUN npm i puppeteer
-RUN yarn install
-
-COPY . /app/
-
-RUN yarn test
-
-ENTRYPOINT [ "" ]
+CMD ["google-chrome-stable"]
diff --git a/package.json b/package.json
index a6a4067..25f8f0e 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,9 @@
"scripts": {
"dev": "vite",
"build": "vite build",
- "test": "web-test-runner --coverage"
+ "test": "web-test-runner --coverage",
+ "docker-build": "docker build -t wtr:v1 .",
+ "docker-test": "docker run -i --init --rm -v $(pwd):/app wtr:v1 yarn test"
},
"dependencies": {
"lit-element": "^2.4.0" |
@betaboon My problem is not running puppeteer, but the following: When I run the tests with the same Dockerfile without the plugin, it waits for the tests to finish. |
tbh I'm not sure if it's the right approach to run the tests in the build-phase of a docker image oO Edit: i think the main issue here is that during Edit2: i just tried to apply the same approach with snowpack. there it somehow works. |
I'm having this same problem as well, in Github actions. @betaboon if it's working for you, what versions of web-test-runner and vite are you using? |
@IanVS that issue/codepath is a nice find. that would completly explain the behavior.
But i currently don't have the time to look into it. so thank you very much for spending the time and working on a solution :) |
Merged: vitejs/vite#3659 |
@bmz1 after a new version of vite is released, it would be great if you could check that it solves your issue. |
|
@IanVS Yes it does 🍾 . Setting |
🎉 should this issue be closed, then? |
perfect. thank you guys for following up :) |
Hi!
First of all, thank you for creating this plugin.
From the command line it works great, but I've tried running the tests with docker, and it actually doesn't wait for the tests to complete. I think this is because the vite dev server startup gives back a 0 exit code. This is just a guess though.
Have you tried this plugin in docker? If so, have you faced the same problem?
The text was updated successfully, but these errors were encountered: