question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CRA 2.x > 3.0 upgrade - test script with --watchAll=false never exits in docker build

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

Created fresh brand new CRA app and reproduced

Which terms did you search for in User Guide?

docker, test

Environment

Environment Info:

System: OS: macOS 10.14.4 CPU: (4) x64 Intel® Core™ i7-7567U CPU @ 3.50GHz Binaries: Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node Yarn: Not Found npm: 6.4.1 - ~/.nvm/versions/node/v10.15.1/bin/npm Browsers: Chrome: 73.0.3683.103 Firefox: 66.0.3 Safari: 12.1 npmPackages: react: ^16.8.6 => 16.8.6 react-dom: ^16.8.6 => 16.8.6 react-scripts: 3.0.0 => 3.0.0 npmGlobalPackages: create-react-app: Not Found

Original issue found on a shared gitlab pipeline runner

Steps to Reproduce

  1. Add watchAll=false to test script
  2. Add npm test in a Dockerfile stage
  3. Run docker build .

Expected Behavior

Docker should continue to the next step after running the test script

Actual Behavior

> docker-test@0.1.0 test /app
> react-scripts test --watchAll=false

PASS src/App.test.js
  ✓ renders without crashing (45ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        2.247s
Ran all test suites.

Never continues

Reproducible Demo

https://github.com/bvalyou/create-react-app-docker-test-issue

Clone, run docker build . - reaches test script and never continues

In my main project the CI build timed out after one hour

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:11

github_iconTop GitHub Comments

2reactions
bvalyoucommented, Apr 28, 2019

That worked, thanks! Maybe we should add a note to the breaking changes list for 3.0 that the CI env variable is now required for test builds to work on docker.

0reactions
bugzpoddercommented, Aug 9, 2019

Fixed as part of 3.1 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run your tests - Docker Documentation
Let's take a look at pulling the testing commands into our Dockerfile. Below is our updated multi-stage Dockerfile that we will use to...
Read more >
Dockerfile build - possible to ignore error? - Stack Overflow
Docker is just responding to the error codes returned by the RUN shell scripts ... make test 2>&1 > /where/ever/make.log || echo "There...
Read more >
CRA 5.0 fails to hot-reload in a docker container built ... - GitHub
npx create-react-app my-app ... docker build -t react-test-2 ./ ... React to hot-reload as it did in react-scripts@4.0.3 inside a mounted ...
Read more >
Containers For Deep Learning Frameworks User Guide
Sending build context to Docker daemon 2.048kB Step 1/3 : FROM nvcr.io/nvidia/tensorflow:1903 –--> 56f2980ble37 Step 2/3 : RUN apt-get update –--> Running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found