bahmutov / cypress-split

Split Cypress specs across parallel CI machines for speed
MIT License
201 stars 23 forks source link

fix: Use absolute spec path as result key #115

Closed juliushaertl closed 9 months ago

juliushaertl commented 9 months ago

This should fix publishing individual spec results to github actions when using specPattern cypress config. Before this change the specResults where using the relative path as object key while the specRows output of the split result was using the absolute paths

I only tested this locally as I could find a quick way to run our cypress tests in https://github.com/nextcloud/text/pull/4847 against a custom patched version of this package. Would be glad to get your feedback about this change.

bahmutov commented 9 months ago

Why would we display absolute spec paths in the summary?

Screenshot 2023-10-11 at 15 22 46
juliushaertl commented 9 months ago

That was not intentional, I amended a small adjustment to only take the name for the output. The main purpose is to properly map and display the statistics (passes, failures, pending, skipped, wallClockDuriation)

bahmutov commented 9 months ago

Is the error (blank results) happening when the cypress config is in a sub folder?Sent from my iPhoneOn Oct 11, 2023, at 15:30, Julius Härtl @.***> wrote: That was not intentional, I ammended a small adjustment to only take the name for the output. The main purpose is to properly map and display the statistics (passes, failures, pending, skipped, wallClockDuriation)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

juliushaertl commented 9 months ago

Is the error (blank results) happening when the cypress config is in a sub folder?

The config is in the root, but we have a custom pattern to match spec files within subdirectories and multiple extensions

https://github.com/nextcloud/text/blob/7109fc142cb3efe384ef91f1ac22929bd9187b0f/cypress.config.js#L21

        specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
juliushaertl commented 9 months ago

Another thing that might have an effect on this is that the action itself runs in a subfolder: https://github.com/nextcloud/text/blob/main/.github/workflows/cypress.yml#L168

Screenshot 2023-10-11 at 21 44 10
bahmutov commented 9 months ago

Ok, I see the problem in this repo too, will make an issue and will fix it to transform the paths to relative ones, like Cypress reports

bahmutov commented 9 months ago

closing in favor of #118 which seems to solve this problem

juliushaertl commented 9 months ago

Wow, thanks a lot for that. Looks much more sane and works like a charm 🎉