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

Support parallel execution and fix issue with testcase stats not available #8

Merged
merged 2 commits into from
Jan 7, 2022

Conversation

ilangv
Copy link

@ilangv ilangv commented Nov 5, 2021

This PR addresses below issues:

Parallel Execution:

Running codecept tests in parallel using run-multiple or run-workers creates a new launch for each child process. With this approach test config can implement bootstrapAll and teardownAll functions to create a launch and pass the launch id to child processes and env variable as shown below:

bootstrapAll: async () => {
       const launchId = await startLaunch(config)
       process.env.RP_LAUNCH_ID = launchId
    },
      teardownAll: async () => {
      await finishLaunch()
    }

Testcase widget issues

Reportportal widgets like Most time consuming tests , Flaky tests table do not render any data. This is because all the nested steps are published with hasStats=false . In-order to get test or BDD scenario level stats, reportportal expects a Test -> Step -> Nested Step structure. Updated the events to follow this structure.

@m3t4n
Copy link

m3t4n commented Jan 7, 2022

@AmsterGet @peterngtr @DavertMik any chance of merging this guys?

@kobenguyent kobenguyent merged commit 0c3222f into reportportal:master Jan 7, 2022
dwentland24 referenced this pull request in dwentland24/agent-js-codecept Jan 7, 2022
@m3t4n
Copy link

m3t4n commented Jan 10, 2022

thank you for the merge @peterngtr 🙏 is it possible to trigger the publish the new version to npm registry? so that the dependency can be picked up from codeceptjs plugin side....

@kobenguyent
Copy link

Hi @m3t4n i don't think i have any permissions to publish the new version of this repo. 😅

@m3t4n
Copy link

m3t4n commented Jan 10, 2022

thank you @peterngtr for the prompt response.
in that case, @AmsterGet or @DavertMik maybe? 🙏

@@ -102,7 +102,7 @@ module.exports = (config) => {

event.dispatcher.on(event.suite.before, (suite) => {
recorder.add(async () => {
suiteObj = startTestItem(suite.title, rp_SUITE);
suiteObj = startTestItem(suite.title, rp_TEST);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After that changes the structure TEST -> STEP -> NESTED STEP (if applicable) will be presented.
Is it a good idea to avoid suites in the reporting structure? I suggest to use the following structure: SUITE -> TEST (if applicable) -> STEP -> NESTED STEP (if applicable), as from reportportal side we expect the top level suite as a container of tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m3t4n & @ilangv guys, could you please look at my notes, will it suit you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what do you think about @DavertMik work on this for Codecept 3.0+
#3
May be better to implement it on the integration side to avoid additional work with bootstrapAll and teardownAll?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @AmsterGet thank you for your attention.
I agree with the suite > test > step > nestedStep structure. However, on the RP side it's represented as LaunchName > Suite > Test > Step > nestedStep and hence I believe @ilangv 's change (i might be wrong). Whereas I agree with you but maybe an improvement point on this is that after Suite the tests can be expanded instead of navigating to a new page (like nested steps do). Personally, I find it hard to reach the steps.

On the other hand @DavertMik's change seems to be the stable choice. Currently, it is not possible to properly display the parallel executions without any update on this plugin side. The suites are randomly placed under launches and this makes it really hard to see which ones are under which launch. Another option might be appending the suite name to launch id (thinking out loud).

@DavertMik: any chance on finalizing the PR? CodeceptJS is already 3.2.3.

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

Successfully merging this pull request may close these issues.

4 participants