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

[Bug]: Issue with Slashes (/) in File Names When Using the --shard Option #525

Open
hiraly opened this issue Dec 19, 2024 · 0 comments
Open
Labels
bug Something isn't working needs triage

Comments

@hiraly
Copy link

hiraly commented Dec 19, 2024

To Reproduce

When running the Storybook Test Runner with the --shard option in GitHub Actions, issues occur due to the inclusion of slashes (e.g., 1/10) in shard names. This is particularly problematic when renaming files or uploading artifacts.

Steps to reproduce:

  1. Execute the following GitHub Actions job:
    jobs:
      storybook-test:
        strategy:
          matrix:
            shard: [1/10, 2/10]
        steps:
          - name: Run Storybook Tests
            run: npx storybook test --shard=${{ matrix.shard }} --coverage
          - name: Upload Coverage File
            run: mv coverage/storybook/coverage.json coverage/storybook/coverage-${{ matrix.shard }}.json
  2. The job fails with an error because file names containing slashes (e.g., coverage-1/10.json) are invalid:
    mv: cannot move 'coverage/storybook/coverage.json' to 'coverage/storybook/coverage-1/10.json': No such file or directory
    

System

Its on Github Action CI


Additional Context

In GitHub Actions, file and artifact names containing slashes (/) are invalid and result in errors. Currently, we use the following workaround:

  1. Escape shard names (e.g., 1/10) using a custom script:
    mv coverage/storybook/coverage.json coverage/storybook/coverage-1_10.json
  2. Use the escaped shard names (e.g., 1_10) as artifact names.

To improve usability, we propose the following enhancements:

  • Add internal logic to escape slashes in shard names.
  • Alternatively, provide an option to customize the shard name format.

These changes would eliminate the need for manual scripting and make the Test Runner more CI-friendly.

@hiraly hiraly added bug Something isn't working needs triage labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant