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

FileNotFoundException error during Pact verification due to @VerificationReports' no longer setting a default reportDir #1836

Open
diogo-hs opened this issue Oct 31, 2024 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@diogo-hs
Copy link

After upgrading to a more recent version of Pact provider (4.0.10 -> 4.6.15), we started to get the following error:

/XXX.md (Read-only file system)java.io.FileNotFoundException: /XXX.md (Read-only file system)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
	at java.base/java.io.FileWriter.<init>(FileWriter.java:113)
	at au.com.dius.pact.provider.reporters.MarkdownReporter.generateReportFile(MarkdownReporter.kt:90)
	at au.com.dius.pact.provider.reporters.MarkdownReporter.finaliseReport(MarkdownReporter.kt:85)
	at au.com.dius.pact.provider.ProviderVerifier.finaliseReports(ProviderVerifier.kt:911)
	at au.com.dius.pact.provider.junit5.PactVerificationContext.verifyInteraction(PactVerificationContext.kt:80)
	...

Debugging a bit, we realized that @VerificationReports("console", "markdown") was no longer working because its reportDir no longer sets the default value it previously used to (and which's stated in the docs).

I'm not sure about the motivation for removing the default value on the following commit, but if that's required, it'd be good to have the docs updated (since they're misleading as of now):

616d880#diff-85bd7c5d2cbc991a6a28288452241974a39a8d3f2c6a1b1bf94c1a2ac424325f

@rholshausen rholshausen added the bug Indicates an unexpected problem or unintended behavior label Nov 14, 2024
@rholshausen
Copy link
Contributor

That's a regression

@rholshausen
Copy link
Contributor

Ok, that's not quite true. The reason for the change, is that the default value should be different depending if the project is using Gradle or Maven (previous default value is for a Maven project). So the docs are out of date in that sense.

However, that change only meant that the default should now change between build/pacts/reports and target/pacts/reports. Something must be setting it to / for you.

@rholshausen
Copy link
Contributor

With my test, the default value is set correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants