-
Notifications
You must be signed in to change notification settings - Fork 125
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
Question about: Some test suites likely terminated without passing on results #90
Comments
I am also facing a similar kind of issue, This is the error I am getting: npm ERR! A complete log of this run can be found in: |
I am also facing same issue any updates? |
Mahanthi-arun-kumar, I believe your problem is in the command line for cypress-parallel. |
I passed correct tests directory with correct regexp and in 95% tests pass without any issues. But sometimes randomly I've got results like It mentions specific suites that were not found, but I see results for these suites. Any ideas why it could happen? |
Also tests failed with the same message in console ^^ - if launch by specific tag. |
@tnicola is this package abandoned? Maybe someone has working fork? This script should using glob/pattern for spec files, there is no reason to do this differently than Cypress itself. I'm using Cypress for component testing, and like many other people I have spec files together with component files. All my specs are passing, but I'm still getting false error from cypress-parallel :/ |
I am also facing similar issue, but for me, results shows only 0 even though tests are running successfully. |
Has anyone managed to solve/bypass this issue? Still getting this issue on version 0.13.0 |
For us it was an issue with different threads that used the same results folder. After small update to put results in different folders for different threads (unfortunately it's hardcoded in source lib) we didn't meet these problem. For now 2nd month without this issue |
Since we don't get answers here I've been digging through the code because I think this plugin is really nice and I think I found what the issue was for us... First of all, the error I was getting is:
So, it was false failing even if all the tests passed and the statement triggering the error is this: Line 99 in 710dd19
To make shorter the story, after debugging it I realized that for "some" unknown reason none of the tests was generating the We have mochawesome, mocha-junit-reporter and cypress-multi-reporters, so our code looked like this: cypress v10.11
^ That way, I was getting the error... So, after almost a full day of trial and error, I found that when I was executing this way then the
So, it immediately made me think that my cypress-parallel/lib/thread.js Line 36 in 710dd19
effectively it was not recognizing my reporting flags. Note: I tried passing The solution? ... I made it work by doing this:
I found that cypress-parallel/lib/settings.js Line 50 in 710dd19
which is not documented in README but it was the correct for us, now I'm not passing a reporter flag and letting the reporter-config.json to drive the enabled reporters.
Hope it helps anyone to solve the issue, I don't know if it's a bug or a miss by me while following instructions but that's what it is. cc @tnicola |
hi @ezunigaf90 |
hi @olga-govor |
hi @guychienll So changes in settings.js
in cli.js: in shared-config.js: |
hi @olga-govor thanks lots ! you are awesome ! |
hi @olga-govor thank your reply , |
Hello, any news on this? Im wondering how this can be fixed, it is a little annoying that same build is failing due to missing results. I'm running one testing procedure with multiple test suits split into 4 threads. Maybe there is any workaround? |
The issue "Some test suites likely terminated without passing on results" can happen for valid reasons, such as the reason in the error message. However, this is a bug and essentially makes this library unusable without forking. We can verify that the test suite output results and the JSON file exist, but in the mocha folder, there is no JSON for it. As mentioned by another poster above, the tests are overwritten and they had to modify the source to use different folders. It would be nice to get a bug fix, but from what I gather, we're on our own if we decide to use this library. |
This is too irritating, I would rather let the tests run longer than fail randomly. Unfortunately, this was a deal breaker for us at https://coretex.ai so we are moving away from using cypress-parallel until this issue is fixed. |
@olga-govor can you please share the npm script, how to store the execution of threads in different folders and merge them all for reporting purpose. |
@ketteq-neon I'm not storing results of execution of threads in different folders as I don't need it. But as I use this plugin in one space for different types of tests I need to store results from different test types in different folders ( you can see in prev.comments how it was achieved) |
I have the same issue using @cypress/grep:
|
Firstly, thanks for your work on this project! 🙂 I've raised this as a PR #203 to get this working with monorepos, and my solution is to enable
reporter-config.jsmodule.exports = {
reporterEnabled:
'cypress-parallel/json-stream.reporter.js, cypress-parallel/simple-spec.reporter.js, mocha-junit-reporter',
cypressParallelJsonStreamReporterJsReporterOptions: {
reportDir: '../../runner-results',
},
mochaJunitReporterReporterOptions: {
mochaFile: '../../junit/settings-frontend/collaboration-[hash].xml',
testsuitesTitle: process.env.SEMAPHORE_JOB_NAME ?? 'cypress',
},
}; Package patch diffdiff --git a/node_modules/cypress-parallel/json-stream.reporter.js b/node_modules/cypress-parallel/json-stream.reporter.js
index 14dea14..06e87f5 100644
--- a/node_modules/cypress-parallel/json-stream.reporter.js
+++ b/node_modules/cypress-parallel/json-stream.reporter.js
@@ -10,7 +10,7 @@ var constants = require('mocha/lib/runner').constants;
var path = require('path');
var fs = require('fs');
-const { resultsPath } = require('./shared-config');
+const { resultsPath: defaultResultsPath } = require('./shared-config');
const { EVENT_SUITE_END } = constants;
@@ -43,7 +43,7 @@ function JSONStreamCustom(runner, options) {
}
runner.on(EVENT_SUITE_END, function () {
- writeFile(cleanStatistics());
+ writeFile.apply(self, [cleanStatistics()]);
});
}
@@ -54,10 +54,11 @@ function calculateDuration(start, end) {
}
function writeFile(statistics) {
+ const resultsPath = this.options.reporterOptions.reportDir ? path.join(process.cwd(), this.options.reporterOptions.reportDir) : defaultResultsPath;
// replace forward and backward slash with _ to generate filename
const fileName = statistics.file.replace(/\\|\//g, '_');
if (!fs.existsSync(resultsPath)) {
- fs.mkdirSync(resultsPath);
+ fs.mkdirSync(resultsPath, { recursive: true });
}
const specResultPath = path.join(resultsPath, `${fileName}.json`);
fs.writeFileSync(specResultPath, JSON.stringify(statistics, null, 2));
diff --git a/node_modules/cypress-parallel/utility.js b/node_modules/cypress-parallel/utility.js
index 0ed59c9..b0a725c 100644
--- a/node_modules/cypress-parallel/utility.js
+++ b/node_modules/cypress-parallel/utility.js
@@ -24,7 +24,12 @@ function generateWeightsFile(specWeights, totalDuration, totalWeight) {
});
const weightsJson = JSON.stringify(specWeights);
try {
- fs.writeFileSync(`${settings.weightsJSON}`, weightsJson, 'utf8');
+ const filepath = path.join(process.cwd(), settings.weightsJSON);
+ const directory = path.dirname(filepath);
+ if(!fs.existsSync(directory)) {
+ fs.mkdirSync(directory, { recursive: true });
+ }
+ fs.writeFileSync(filepath, weightsJson, 'utf8');
console.log('Weights file generated.')
} catch(e) {
console.error(e) This issue body was partially generated by patch-package. |
Hi, Example package.json script: Hope this helps others. |
Hi,
First off, thanks for the repo and work :)
So i want to use this package in our tests, but am seeing the following error randomly on my test runs:
Some test suites likely terminated without passing on results
I know that it's a validation, but do we know why this is happening?
Thanks,
-arnon
The text was updated successfully, but these errors were encountered: