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

fix: Use absolute spec path as result key #115

Closed

Conversation

juliusknorr
Copy link

@juliusknorr juliusknorr commented Oct 11, 2023

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 nextcloud/text#4847 against a custom patched version of this package. Would be glad to get your feedback about this change.

@bahmutov
Copy link
Owner

Why would we display absolute spec paths in the summary?

Screenshot 2023-10-11 at 15 22 46

@juliusknorr juliusknorr force-pushed the fix/github-action-spec-results branch from 1e42d63 to 867bdff Compare October 11, 2023 19:29
@juliusknorr
Copy link
Author

juliusknorr commented Oct 11, 2023

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
Copy link
Owner

bahmutov commented Oct 11, 2023 via email

@juliusknorr
Copy link
Author

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}',

@juliusknorr
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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

@bahmutov bahmutov closed this Oct 12, 2023
@juliusknorr
Copy link
Author

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

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.

2 participants