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

Oh no! An error occured: ENOENT: no such file or directory #48

Closed
okkimus opened this issue Feb 21, 2023 · 6 comments
Closed

Oh no! An error occured: ENOENT: no such file or directory #48

okkimus opened this issue Feb 21, 2023 · 6 comments

Comments

@okkimus
Copy link

okkimus commented Feb 21, 2023

Hi!

I am trying to add this action to my project. Repo is here.

I'm generating the needed report json. In the action, I can see that the file exists and even cat the contents. But when this action starts generating the badges, it fails to find the file.

At first I was using relative paths when the action was failing in earlier step. But then I decided to just use the absolute paths. However, still the action can't find the report.

You can see my action here and example of failed run here.

If you have an idea what could cause this, I'm also happy to help. (No experience in creating actions for marketplace, but happy to learn more on it.)

@jpb06
Copy link
Owner

jpb06 commented Feb 21, 2023

Hey.

That's odd. I forked your repo to take a look!

@jpb06
Copy link
Owner

jpb06 commented Feb 21, 2023

Looks like it's linked with the usage of working-directory that changes pwd. readJson works within action code but doesn't in the dependency node-jest-badges.

Hang in there, I will try to debug this locally using act to find the issue.

@okkimus
Copy link
Author

okkimus commented Feb 21, 2023

I saw you debugging this. Thanks for that.

I tried also to just move the whole backend to the root of the repo and updated the paths and removed the working-directory setting etc. but that didn't work either. But when I removed the extra params (coverage-summary-path and output-folder) it worked. I think something funky is going on how those params are handled.

I was browsing through the source code in the morning to see if there was something obvious, but couldn't spot any weirdness with a quick look at it.

@jpb06
Copy link
Owner

jpb06 commented Feb 22, 2023

I think I found the issue. outputPath was improperly set and we also checked if badges were generated.... after generating them.

#50 should fix that.

@jpb06
Copy link
Owner

jpb06 commented Feb 22, 2023

Released as 1.9.11.

Validated using these params:

     [...]

      - name: Generating coverage badges for backend
        uses: jpb06/jest-badges-action@v1.9.11
        with:
          coverage-summary-path: ./src/backend/coverage/coverage-summary.json
          output-folder: ./src/backend/badges

Let me know how it works for you 🙇🏻

@okkimus
Copy link
Author

okkimus commented Feb 22, 2023

Excellent, this works now! Much appreciated, the badges look cool 😎 Have a nice week! 👍

@okkimus okkimus closed this as completed Feb 22, 2023
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

No branches or pull requests

2 participants