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

cucumber-json-formatter doesn't work in github actions #3

Open
vojtech-cerveny opened this issue Nov 25, 2022 · 7 comments
Open

cucumber-json-formatter doesn't work in github actions #3

vojtech-cerveny opened this issue Nov 25, 2022 · 7 comments

Comments

@vojtech-cerveny
Copy link

vojtech-cerveny commented Nov 25, 2022

Hey, I was trying your script from and it seems that it doesn't work properly. I tried to debug and check this - https://github.com/vojtech-cerveny/cypress-cucumber-framework/actions/runs/3548944356/jobs/5960727834

I only added cucumber-json-formatter --help to verify, that it works properly and it fails.
https://github.com/vojtech-cerveny/cypress-cucumber-framework/blob/master/.github/workflows/automation.yml#L40

it seems, that cucumber-json-formatter is not on PATH and it doesn't work. It works locally, but not on Github Actions.
Also it means, that it doesn't generate json file from ndjson from cypress-preprocessor - it is pitty that it doesn't return any error, but it is what it is :)

@vojtech-cerveny
Copy link
Author

Ok, update: if you split steps and create separate step for PATH, after that it doesn't throw error, but formatter doesn't show anything... 🤔

@vojtech-cerveny
Copy link
Author

  • I added artefacts into repo
      - name: Store test results into artifacts
        uses: actions/upload-artifact@v3
        if: always()
        with:
          name: test-results
          path: cypress/results/

and this is result:
Screenshot 2022-11-25 at 5 31 30 PM

@vojtech-cerveny
Copy link
Author

And final message - I create issue for that in json-formatter - cucumber/json-formatter#33

@a8trejo
Copy link
Owner

a8trejo commented Nov 25, 2022

Interesting, I think I remember experiencing something similar, and that's why I removed the cucumber-json-formatter --help command from that step, I also used to have it there

Although I think the issue belongs more to GitHub Actions than to cucumber/json-formatter because of this
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path

Prepends a directory to the system PATH variable and automatically makes it available to all subsequent actions in the current job; the currently running action cannot access the updated path variable.

@a8trejo
Copy link
Owner

a8trejo commented Nov 25, 2022

What happens if you try on this line

this instead?
cat cypress/results/reports/cucumber_json/cucumber-messages.ndjson | cucumber-json-formatter > cypress/results/cucumber-standalone.json

@vojtech-cerveny
Copy link
Author

Yup, well, if standalone cucumber-json-formatter --help doesn't work, then formatter in cypress doesn't work either - this is the problem, that currently I am not able to generate json file from ndjson on github actions

cat cypress/results/reports/cucumber_json/cucumber-messages.ndjson | cucumber-json-formatter > cypress/results/cucumber-standalone.json

^^ I tried this and it returns error cat: write error: Broken pipe - and what I googled, it should be problem with cucumber-json-formatter, that it doesn't accept anything from pipeline. 🤷‍♂️

@a8trejo
Copy link
Owner

a8trejo commented Nov 25, 2022

got it, next week I'll see if I find anything different but thanks for looking into it! Will definitely follow the issue you raised with them 👍

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