Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
1
-
Description
Summary
If there is multi directory test files, the wild card "*" asterisk does not work well in Mocha Test Runner
Steps to Reproduce
- Create the following test files:
- test/test.js
- test/firstLevel/test.js
- test/secondLevel/test.js
- Create a Mocha Test Runner with the following settings:
- Test files and directories: test/*
- Advanced options - Arguments: --recursive
- Run the build
Expected Results
The three tests will run successfully
Actual Results
The build fail with the following errors:
command 22-Dec-2016 23:43:42 Beginning to execute external process for build 'bamboo - test - Default Job #25 (BAM-TEST-JOB1-25)'\n ... running command line: \n/usr/local/bin/node node_modules/mocha/bin/mocha -R mocha-bamboo-reporter test/* --recursive\n ... in: /Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.14.3.1/home/xml-data/build-dir/BAM-TEST-JOB1\n ... using extra environment variables: ... error 22-Dec-2016 23:43:42 module.js:327 error 22-Dec-2016 23:43:42 throw err; error 22-Dec-2016 23:43:42 ^ error 22-Dec-2016 23:43:42 error 22-Dec-2016 23:43:42 Error: Cannot find module '/Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.14.3.1/home/xml-data/build-dir/BAM-TEST-JOB1/test/firstLevel' error 22-Dec-2016 23:43:42 at Function.Module._resolveFilename (module.js:325:15) error 22-Dec-2016 23:43:42 at Function.Module._load (module.js:276:25) error 22-Dec-2016 23:43:42 at Module.require (module.js:353:17) error 22-Dec-2016 23:43:42 at require (internal/module.js:12:17) error 22-Dec-2016 23:43:42 at /Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.14.3.1/home/xml-data/build-dir/BAM-TEST-JOB1/node_modules/mocha/lib/mocha.js:222:27 error 22-Dec-2016 23:43:42 at Array.forEach (native) error 22-Dec-2016 23:43:42 at Mocha.loadFiles (/Users/klfoong/Desktop/ServiceRocket/bamboo/atlassian-bamboo-5.14.3.1/home/xml-data/build-dir/BAM-TEST-JOB1/node_modules/mocha/lib/mocha.js:219:14)
Notes
- Running the same command "/usr/local/bin/node node_modules/mocha/bin/mocha -R mocha-bamboo-reporter test/* --recursive" works successfully
- Bamboo is trying to use the folder "firstLevel" as a test file
Proper use of the options
- Use the following setting as "Test files and directories"
test
- Add --recursive to the Arguments field