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

Add if: condition to search for *.cy* before attempting to run them #10

Merged

Conversation

BrianHenryIE
Copy link
Contributor

@BrianHenryIE BrianHenryIE commented May 8, 2024

Proposed changes

Module workflows are failing when the modules have no Cypress tests to run.

See: https://github.com/newfold-labs/wp-module-data/actions/runs/9006556236/job/24744362247?pr=72

I.e. npm run test:e2e -- --browser chrome --spec "vendor/(newfold-labs/wp-module-data/**/*.cy.js)" fails.

Can't run because no spec files were found.

We searched for specs matching this glob pattern:

  > /home/runner/work/wp-module-data/wp-module-data/vendor/(newfold-labs/wp-module-data/**/*.cy.js)
Error: Process completed with exit code 1.

Note: Are those brackets correct? That's how it is in the workflow currently.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)

Checklist

Further comments

In a plugin, run:

$([[ ! $(find ./vendor/newfold-labs/wp-module-coming-soon -depth -name '*.cy*') ]])
echo $?     

and observe the output is

1

Run

$([[ ! $(find ./vendor/newfold-labs/wp-module-data -depth -name '*.cy*') ]])
echo $?     

and observe the output is

0

I think this should be enough to fix this, although GitHub Actions might not like the expression being evaluated where it is and it might need to be moved to its own step and write to a variable first.

Another solution would be to add continue-on-error: true

@BrianHenryIE BrianHenryIE requested a review from circlecube May 8, 2024 18:34
@BrianHenryIE BrianHenryIE merged commit 1de12fd into main May 9, 2024
1 check passed
@BrianHenryIE BrianHenryIE deleted the add/check-module-has-Cypress-tests-before-running-them branch May 9, 2024 16:55
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