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

Provide ability to share same report portal launch ID #86

Closed
sumit-gupta91 opened this issue Mar 14, 2023 · 10 comments · Fixed by #100
Closed

Provide ability to share same report portal launch ID #86

sumit-gupta91 opened this issue Mar 14, 2023 · 10 comments · Fixed by #100
Assignees

Comments

@sumit-gupta91
Copy link

Playwright provides support for grouping tests using annotations. Using these annotations I can group tests and run them in the order we want.

For example :
yarn run e2e -- --grep '@flow=auth' --project 'chromium'
yarn run e2e -- --grep-invert '@flow=auth'

Above, all the auth test cases are run first followed by all the other test cases which can leverage already established auth sessions.

The problem is, report portal integration generates different launch ID for each of these runs even though they are for the same commitID, which causes problems in reporting on report portal.

@AmsterGet
Copy link
Member

AmsterGet commented Mar 14, 2023

As the Playwright has excellent support of running tests in parallel or sequentially out of the box, we didn't consider this feature for agent-js-playwright.
Recently (in version 1.31.1) the Playwright introduced the project dependencies, seems like this can help you make the dependency on establishing auth sessions for other tests.
See also Playwright release notes.

@sumit-gupta91
Copy link
Author

@AmsterGet Sure, let me experiment with new version of playwright and see if it fulfills all the needs. If not will revert back on this issue.

@sterschl
Copy link

I have another use case that goes in a similar direction:

I use GitlabCI to run Playwright tests for five different browsers. To increase performance, each browser runs parallel in a separate job. However, this also gives me five different launches in the ReportPortal. I would like to combine the results into one launch.

@AmsterGet
Copy link
Member

Hello @sterschl !
Since there are independent runs on different machines, Playwright does not provide an orchestration mechanism for their reports.
From our side, I can offer two options:

  1. Trigger a launch before all tests manually via the API, then specify its id in the reporter config for each job.
    As a run post-step (when all tests finished), launch also needs to be finished manually.
    Our client-javascript already supports the existing launch id for reporting, but it's not yet implemented in this agent, so it needs to be implemented by our team. ETA is unknown at the moment, because our priorities are concentrated on other things.
  2. Specify a unique CI run ID as a launch attribute, which will be the same for different jobs in the same run (this could be a commit hash or something else).
    As a follow up step, you can use the API to filter the required launches by the provided attribute, collect their ids, and then simply call the "merge" launch API endpoint to combine the launches into one.

Please let me know if there are any questions.

@sterschl
Copy link

Hi @AmsterGet,
thanks for your help and suggestions. I have implemented your second option and it works very well.

The only disadvantage is that the merge can only be done after the tests are finished. But this is not a problem. It would be great if in the future the Id could also be set via the playwright client. Then I would probably try the first option.

@AmsterGet
Copy link
Member

Hi @sterschl !
That's great!
I've added an improvement with providing an existing launch id to the agent config in our roadmap.
I will let you know as soon as it is implemented.
Thanks for your feedback!

@AmsterGet
Copy link
Member

@sumit-gupta91 Hello!
Have you tried my suggestion for your request?
Is it works?

@sumit-gupta91
Copy link
Author

@AmsterGet We are in process to upgrade to latest version of playwright and use the projects approach. If we have any more such requirements then I would prefer 1st approach as we are doing something similar with our unit tests as well. We use report portal for creating reports of unit tests runs as well and it has a similar issue.

reportportal/agent-js-jest#121

We use agent-js-jest ability to accept report portal launch ID.

@AmsterGet AmsterGet self-assigned this Apr 28, 2023
@AmsterGet AmsterGet linked a pull request May 21, 2023 that will close this issue
@AmsterGet
Copy link
Member

Hello guys!
@sumit-gupta91 @sterschl
I've added support of existing launch ID to this agent.
I plan to release it this week with some small other improvements.
I'll notify you when it will be ready.

@AmsterGet
Copy link
Member

@sumit-gupta91 @sterschl
Published in agent-js-playwright 5.1.0.

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

Successfully merging a pull request may close this issue.

3 participants