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

"No tests found" however it has 118 matches

Matt Haff January 18, 2019
No tests found
In /opt/atlassian/pipelines/agent/build
305 files checked.
testMatch: /opt/atlassian/pipelines/agent/build/src/**/__tests__/**/*.{js,jsx,mjs},
/opt/atlassian/pipelines/agent/build/src/**/?(*.)(spec|test).{js,jsx,mjs} - 118 matches
testPathIgnorePatterns: ./build/,
./node_modules/,
./documentation/,
./coverage/ - 0 matches
Pattern: "" - 0 matches
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|


 I don't know what I'm doing wrong here, in my pipeline I'm running the same commands as locally yet bitbucket doesn't run the tests. I'm using Jest for my tests, it looks like Bitbucket is trying to run my tests from within the `build` directory but that doesn't make sense. Why would I save my test files inside of my build directory?

 

pipelines:
default:
- step:
name: Build Application
caches:
- node
script:
- npm install
- npm test
- npm run build
artifacts:
- build/**

 

1 answer

1 vote
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2019

Hey @Matt Haff,

the build directory that is being searched is the name of the directory in which the initial clone of your repository happened. From the looks of it, you have another `build` directory within that one. 

Could you maybe try removing the `build` directory from your test exclusion list? 

jcleach September 5, 2020

This was the problem I had. I was excluding `/build/` which matched the name of the path the pipeline cloned to `/opt/atlassian/pipelines/agent/build`

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events