Logger doesn't work for parallel test runs
Describe the bug When tests are executed in parallel, the logging section disappears completely.
To Reproduce Steps to reproduce the behavior:
- Clone the mocha example repo
- Run the example tests in parallel with
npm run tests -- --parallel --jobs=2 - Click on the report URL, and observe that the report for "logs should be added to the testomatio report" has no logs attached
Expected behavior Logs should be displayed on the test run (as they are if the parallelism is disabled)
Additional context I assume that the test log capture is based on timing which might make it too difficult to capture logs and associate the correct test. If that's the case, and running tests in parallel is not supported, then the documentation should be updated to reflect this.
@cjol did you checked?
https://docs.testomat.io/getting-started/running-automated-tests/#reporting-parallel-tests
Thanks for the link, I did not see that at first. However it seems to describe a different problem "you might end with multiple reports per each executed process".
Just in case, I have tried "Strategy 2" as described in that document, but that makes no difference to the outcome.
TESTOMATIO_SHARED_RUN=1 TESTOMATIO_TITLE="UniqTitleForThisBuild" npm test -- --parallel --jobs=5
@cjol please tell which logs do you expect? I assume you have some logs in your terminal on testrun but they are not uploaded to Testomat? Share screenshot.
Hi, the reproduction in the issue I reported is from your own test suite.
https://github.com/testomatio/examples/blob/master/mocha-ts-multi-reporters/spec/logger.spec.ts#L5-L7
@cjol
the reason is that some time ago we disabled automatic console logs sending to testomat. to enable, set TESTOMATIO_INTERCEPT_CONSOLE_LOGS=1