Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18099

Mocha Test Runner wild card does not work in multi directory test

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Node.js plugin
    • None
    • 0
    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Summary

      If there is multi directory test files, the wild card "*" asterisk does not work well in Mocha Test Runner

      Steps to Reproduce

      1. Create the following test files:
        • test/test.js
        • test/firstLevel/test.js
        • test/secondLevel/test.js
      2. Create a Mocha Test Runner with the following settings:
        • Test files and directories: test/*
        • Advanced options - Arguments: --recursive
      3. 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            klfoong Foong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: