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

Report failed to consolidate all specs results when run in parallel mode #189

Open
nikhilgupta1789 opened this issue Nov 21, 2019 · 9 comments

Comments

@nikhilgupta1789
Copy link

Issue: When running protractor multiple spec files in parallel mode then beautiful report failed to consolidate all specs executed results and in meantime it also got deleted automatically.

It would be good if it can be handle in a parallel mode nowadays parallel execution is in fashion to reduce execution time. Hope this feature would be added soon.

@miller45
Copy link
Collaborator

It is just not supported. You can either dump the result in different folders, or you can run against multiple browsers with shard test files. But the current implementation is only able to read and write to single results file without locking/synchronization of multiple "threads"

@praveendvd
Copy link

It is just not supported. You can either dump the result in different folders, or you can run against multiple browsers with shard test files. But the current implementation is only able to read and write to single results file without locking/synchronization of multiple "threads"

How to put it in different folder ? is there a way to get thread id

@praveendvd
Copy link

praveendvd commented Apr 26, 2020

Hi I figured out that running in multiple capabilities will fix this issue,

multiCapabilities: [{
  'browserName': 'chrome',
specs:['blabla1'],
}, {
  'browserName': 'chrome',
specs:['blabla2']
}]

Else you have to set preserverootdirectory to true , and also sort the result if using sharded tests

jasmine.getEnv().addReporter(new HtmlReporter({
    baseDirectory: 'tmp/screenshots',
    preserveDirectory: true,
    sortFunction:function sortFunction(a, b) {
    if (a.instanceId < b.instanceId) return -1;
    else if (a.instanceId > b.instanceId) return 1;
 
    if (a.timestamp < b.timestamp) return -1;
    else if (a.timestamp > b.timestamp) return 1;
 
    return 0;
}
}).getJasmine2Reporter());

@nikhilgupta1789
Copy link
Author

@praveendvd Tried with your first solution as also given in the npm beautiful protractor report but question here is how many times you will keep specs/test cases in specs[]? it is unrealistic and not a correct way of mentioning specs for an example if wanted to run suites then what will be the syntax for it?
And for second solution also it overrides the results I tried with different combinations and several times ran the scripts and the result is it overrides the result and in report it shows result of last ran spec file, not a consistent.

I hope @miller45 @Evilweed come up with better solution to add feature supporting of parallel execution of specs in shardTestFiles:true and consolidate all specs result in single report.

Please add this feature soon, people are waiting for this feature because no other protractor reports supports parallel execution.

@praveendvd
Copy link

@praveendvd Tried with your first solution as also given in the npm beautiful protractor report but question here is how many times you will keep specs/test cases in specs[]? it is unrealistic and not a correct way of mentioning specs for an example if wanted to run suites then what will be the syntax for it?
And for second solution also it overrides the results I tried with different combinations and several times ran the scripts and the result is it overrides the result and in report it shows result of last ran spec file, not a consistent.

I hope @miller45 @Evilweed come up with better solution to add feature supporting of parallel execution of specs in shardTestFiles:true and consolidate all specs result in single report.

Please add this feature soon, people are waiting for this feature because no other protractor reports supports parallel execution.

For second solution you don't have to give spec files , you can set maxInstance property in protractor config and it will work fine as expected

@nikhilgupta1789
Copy link
Author

Hi Praveen @praveendvd , could you please attach a configuration file to run specs in parallel and get all executed results in a consolidated report. It will be very helpful for me to run and see the results in a consolidated report with parallel execution without getting overriding the results.

@rahulkedia1409
Copy link

Let's say i want to keep a count of fail and passed specs and at the end of the suite do some post action like to email the result how can it be achieved any pointers will be much appriciated.

@bose1413
Copy link

Hi I figured out that running in multiple capabilities will fix this issue,

multiCapabilities: [{
  'browserName': 'chrome',
specs:['blabla1'],
}, {
  'browserName': 'chrome',
specs:['blabla2']
}]

Else you have to set preserverootdirectory to true , and also sort the result if using sharded tests

jasmine.getEnv().addReporter(new HtmlReporter({
    baseDirectory: 'tmp/screenshots',
    preserveDirectory: true,
    sortFunction:function sortFunction(a, b) {
    if (a.instanceId < b.instanceId) return -1;
    else if (a.instanceId > b.instanceId) return 1;
 
    if (a.timestamp < b.timestamp) return -1;
    else if (a.timestamp > b.timestamp) return 1;
 
    return 0;
}
}).getJasmine2Reporter());

Hi @praveendvd . second solution is working fine.. Thanks for the solution.. cheers

@bose1413
Copy link

bose1413 commented Mar 17, 2021

Hi Praveen @praveendvd , could you please attach a configuration file to run specs in parallel and get all executed results in a consolidated report. It will be very helpful for me to run and see the results in a consolidated report with parallel execution without getting overriding the results.

conf.txt

Just do follow Configuration uploaded above.. you will get Perfect result for parallel execution with consolidated report

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

No branches or pull requests

5 participants