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

fix: create parent directory before report files #1212

Merged
merged 2 commits into from May 31, 2023

Conversation

nathanperkins
Copy link
Contributor

- Add os.MkdirAll(dst) before any os.Create(dst) calls within the
reporters/ folder.
- Fix onsi#1210, where the report file fails to create because the parent
  directory doesn't exist.
@nathanperkins
Copy link
Contributor Author

I need to manually test this locally to ensure it fixes the problem.

@onsi, do you think this needs automated test coverage?

@onsi
Copy link
Owner

onsi commented May 30, 2023

hey - most of the heavy stuff is integration tested but i think a simple unit test in junit_report_test.go would make sense for this. lemme know if you need help adding one.

@nathanperkins
Copy link
Contributor Author

You got it! One sec :)

@onsi
Copy link
Owner

onsi commented May 31, 2023

thanks will pull it in once ci runs

@nathanperkins
Copy link
Contributor Author

@onsi, I added test coverage for JSON, JUnit and TeamCity. For JSON and TeamCity, there were no tests so I copied some setup data over.

There weren't any existing test cases for the MergeAndCleanup functions so I didn't make coverage for those.

Let me know if you need anything else! Thanks again for your quick responses and maintaining this so carefully! :)

@onsi
Copy link
Owner

onsi commented May 31, 2023

Thanks for the PR and for adding the tests!

@onsi onsi merged commit 0ac65de into onsi:master May 31, 2023
6 checks passed
@nathanperkins nathanperkins deleted the create-folders branch May 31, 2023 00:55
@onsi
Copy link
Owner

onsi commented May 31, 2023

this is out now in 2.9.6 - thanks @nathanperkins !

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.

After updating from v1.16 to v2.9, JUnit report fails with "open <file>: no such file or directory"
2 participants