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

Launches do not get merged on parallel execution even though autoMerge flag is set #188

Open
noopurmath3 opened this issue Apr 11, 2024 · 3 comments

Comments

@noopurmath3
Copy link

Hello,

I executing parallel tests to gitlab CI. I have configured the project to publish reports to a report portal instance. From what I understood from the documentation, setting "autoMerge" option to true should merge reports for all launches of current execution into a single launch on report portal. However, that is not what I am observing. I still see launch for each node that is executing the tests.
I also tried passing --ci-build-id value as $CI_PIPELINE_ID as well. That did not help either.
Please let me know if there is anything wrong I am doing or if my understanding of the working is incorrect.

Please refer following files for details:
cypress.config.js:

// const { defineConfig } = require('cypress');
const registerReportPortalPlugin = require('@reportportal/agent-js-cypress/lib/plugin');
module.exports = {
  projectId: 'xxxxx',
  // reporter: 'cypress-mochawesome-reporter',
  // reporter: "@reportportal/agent-js-cypress",
  // reporterOptions: {
  //   overwrite: false
  // },
  reporter: '@reportportal/agent-js-cypress',
  reporterOptions: {
    endpoint: 'https://reportportal-<some report portal instance>/api/v1',
    apiKey: '<api key>',
    launch: '<name>',
    project: '<name>',
    autoMerge: true,
    parallel: true,
    description: 'Test description',
  },
  e2e: {
    setupNodeEvents(on, config) {
      return registerReportPortalPlugin(on, config);
    },
  },
};

Execution command:
npx cypress run --browser chrome --record --parallel --ci-build-id $CI_PIPELINE_ID

@noopurmath3
Copy link
Author

Has anyone else faced this issue and found a solution for this?
Highly appreciate any help on this.

Thanks!

@AmsterGet
Copy link
Member

AmsterGet commented Apr 15, 2024

Hello @noopurmath3 !
The CI_BUILD_ID variable must be provided as an ENVIRONMENT variable because Cypress itself does not share this option with the reporter.
Please let me know if this helps!

@AmsterGet
Copy link
Member

As an alternative approach you can follow the 1st step, described here. Variant of its implementation available in this repo.

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

No branches or pull requests

2 participants