Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Failing test step do not show all logs

Adam Whiteland January 16, 2022

Hello,

I have a monorepo setup which runs a large set of tests on commits to master. If a test fails I don't receive the full output of the failing test suite, in the logs of the pipline, so cannot determine what test failed.

Does anyone know why I wouldn't be getting the full  all the logs? It consistently happens running React unit tests with React Testing Library using the circleci/node:16.7-browsers image. Here is the step definition:

 

- step:
name: Run tests
image: circleci/node:16.7-browsers
size: 2x
script:
- npm run test

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 19, 2022

Hi @Adam Whiteland,

I'm not really sure what output you are missing from the Pipelines log. Do you see additional output when you run these failed tests locally that is not in the Pipelines log?

If you have a computer with more than 4GB memory available, I would suggest as a first step to debug this build locally with the same Docker image, and see if you get the same output as in Pipelines or not.

You can do this the following way:

1. Take a new clone of the repo on your machine (don't use an existing one)

2. Navigate to the directory of that new clone, and do a git reset --hard to the commit of the failed build with the issue

3. Afterwards, start a Docker container with the following command

docker run -it --volume=/Users/myUserName/code/my-repo:/localDebugRepo --workdir="/localDebugRepo" --memory=4g --memory-swap=4g --memory-swappiness=0 --cpus=4 --entrypoint=/bin/bash circleci/node:16.7-browsers

Replace /Users/myUserName/code/my-repo in the command with the path of the clone you took on step 1.

4. After the Docker container starts, you can run the commands of the script in your yml file (in this case npm run test) and observe the output. Do you see in the output of that command additional output that is not in the Pipelines log?

Kind regards,
Theodora

Adam Whiteland January 20, 2022

Thanks for your reply @Theodora Boudale, I'll definitely give this a go and get back to you with my results.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2022

You are very welcome Adam, I will wait for your update then! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events