Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run-multiple - Output directory path appended to test root path by codecept, So unable to create output directories #571

Closed
shrikanthkm07 opened this issue Jun 23, 2017 · 7 comments
Assignees
Labels

Comments

@shrikanthkm07
Copy link

shrikanthkm07 commented Jun 23, 2017

What are you trying to achieve?

After upgrading to [email protected] for run-multiple

I am using run-multiple command for parallel execution. I am using mocha-reporter to generate output xml file. So I pass my custom directory path in output: /Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports
I am expecting the report file to be saved in this path.

What do you get instead?

Internally codecept is appending the "test root path" which is /Users/madhusus/hydra-dev/src/node_modules/nextgen-test/ to the path which I have passed in output.

So the end result for output directory will be '/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports/desktop_browser_chrome_1' which is invalid.

Provide console output if related. Use --verbose mode for more details.

creating output directory: /Users/madhusus/hydra-dev/src/node_modules/nextgen-test/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports/desktop_browser_chrome_1
fs.js:922
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: ENOENT: no such file or directory, mkdir '/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports/desktop_browser_chrome_1'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:922:18)
    at Command.module.exports (/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/node_modules/codeceptjs/lib/command/run.js:26:8)
    at Command.listener (/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/node_modules/commander/index.js:301:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:191:7)
    at Command.parseArgs (/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/node_modules/commander/index.js:615:12)
    at Command.parse (/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/node_modules/commander/index.js:458:21)
    at Object.<anonymous> (/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/node_modules/codeceptjs/bin/codecept.js:106:9)
    at Module._compile (module.js:570:32)

Provide test source code if related

// paste test

Details

  • CodeceptJS version: 0.6.3
  • NodeJS Version: v6.9.4
  • Operating System: MAC OS Sierra v10.12.5
  • WebDriverIO
  • Configuration file:
@APshenkin
Copy link
Collaborator

@shrikanthkm07 Could you, please, provide your codecept.conf.js file? Are you using something like mocha-multi or mochawesome?

I see only one place, where we override output path

overriddenConfig = replaceValue(overriddenConfig, 'output', path.join(config.output, outputDir));
overriddenConfig = replaceValue(overriddenConfig, 'reportDir', path.join(config.output, outputDir));

where config.output is output from config and outputDir is
suite + JSON.stringify(browserConfig).replace(/[^\d\w]+/g, '_') + suiteId

@shrikanthkm07
Copy link
Author

shrikanthkm07 commented Jun 27, 2017

@APshenkin here is the config I export to codecept. I have filled the values.
As you can see, I am passing output value here, which means all my test results should be saved here but codecept is internally appending test root path to the output. So, the resulting output path will be test root + output, which will look like this.

/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports/desktop_browser_chrome_1

where

/Users/madhusus/hydra-dev/src/node_modules/nextgen-test/ is the test-root

and

Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports/desktop_browser_chrome_1

is what I pass custom folder path

Codecept.conf.js

   tests: "<tests>",
    timeout: 20000,
    output: "/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports",
    helpers: {
        Codecept: {
            require: "<helpersjs>"
        }
    },
    include: {
        I: "<stepsjs>"
    },
    mocha: {
        "reporterOptions": {
            "mochaFile": "/Users/madhusus/hydra-dev/src/node_modules/consumer-automation/test-reports" + "/" + "Acceptance_results.xml"
        }
    },
    multiple: {
        "basic": {
            "browsers": ["chrome", "firefox"]
        },
        "sauce": {
            "browsers": [
                {
                    browser: 'chrome',
                    "browserName": "chrome",
                    "name": "TEST_CHROME",
                    "platform": "ANY",
                    "version": "55.0",
                    "screenResolution": "1280x960",
                    "unexpectedAlertBehaviour": "ignore",
                    "chromeOptions": {
                        "args": [
                            "disable-extensions"
                        ]
                    },
                    "parentTunnel": "adplm"
                },
                {
                    browser: 'firefox',
                    "browserName": "firefox",
                    "name": "TEST_FIREFOX",
                    "platform": "ANY",
                    "version": "51.0",
                    "screenResolution": "1280x960",
                    "parentTunnel": "adplm"
                }
            ]
        }
    },
    name: "nextgen-test"
}

@shrikanthkm07
Copy link
Author

shrikanthkm07 commented Jun 27, 2017

@APshenkin
I found that , this line is appending test-root path to output path in run.js when we use run-multiple command.
PR : https://github.com/Codeception/CodeceptJS/pull/482/files
Any idea on this ?

@APshenkin
Copy link
Collaborator

@shrikanthkm07 I think, we should call @DavertMik for this)

@shrikanthkm07
Copy link
Author

@DavertMik Can you look into this..?
Thanks in advance

@shrikanthkm07
Copy link
Author

Is there any update on this ? @DavertMik @APshenkin I am still facing this issue. Thanks

@APshenkin
Copy link
Collaborator

@shrikanthkm07 I will take a look on it this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants