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

Report generation fails if scenario name contains non allowed characters #689

Closed
javiertuya opened this issue Oct 20, 2024 · 1 comment · Fixed by #692
Closed

Report generation fails if scenario name contains non allowed characters #689

javiertuya opened this issue Oct 20, 2024 · 1 comment · Fixed by #692
Assignees
Labels

Comments

@javiertuya
Copy link
Collaborator

javiertuya commented Oct 20, 2024

About The Problem

If the scenario name contains characters that are invalid for a file name (e.g. / on windows/linux, or : on windows), the report generation fails to produce the report of this scenario.

To reproduce:

  • Clean-up the target folder
  • Edit a scenario file an set a / in the name (e.g. integration_test_files/helloworld/get_api_integration_test.json)
  • Run the test for this scenario: mvn test -ntp -pl core -Dtest=**/HelloWorldInMemoryTest

Expected: Report generation succeeds, see e.g. this action run: https://github.com/javiertuya/zerocode/actions/runs/11425689187

Actual: Report generation fails, see e.g. this action run: https://github.com/javiertuya/zerocode/actions/runs/11425675217. Report generation displays this message:

2024-10-20 10:45:40,538 [main] INFO org.jsmart.zerocode.core.engine.listener.TestUtilityListener - Generating test-statistics reports. please wait...
2024-10-20 10:45:40,539 [main] ERROR org.jsmart.zerocode.core.report.ZeroCodeReportGeneratorImpl - 
			************
Now files were found in folder:target/zerocode-test-reports/, hence could not proceed. 
(If this was intentional, then you can safely ignore this error) 
			************** 

Implemented Solution

The special chars replaced via "_". More details are in the PR below.
Please go to the "Motivation & Context" section in this PR.

@javiertuya
Copy link
Collaborator Author

The cause is that, reporting produces a json file for each scenario in target/zerocode-test-reports. The scenario name is used to give the name to this file, failing it it contains illegal characters. Sanitize this file name to fix it.

I can prepare a PR to fix it. @authorjapps can you please assign this to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant