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
pact-jvm-junit5 writes all pacts to target/pacts instead of $buildDir/pacts #690
Comments
I just ran ArticlesTest from the pact-jvm project and it definitely writes the pacts to the correct directory, it must be your setup that has an issue.
try this test {
useJUnitPlatform()
systemProperty 'pact.rootDir', "$buildDir/pacts"
} |
I have to following two lines that are working for me:
|
I'm having the same issue running 3.6.1 on JUnit 4 (Android project) I've tried your suggestions without luck |
For some reason PactConsumerConfig doesn't detect that it's running inside gradle. Maybe Android doesn't set That said, I've been able to overwrite the pactDirectory by extending from @CallSuper
override fun runTest(mockServer: MockServer, context: PactTestExecutionContext) {
context.pactFolder = PACT_FOLDER
} |
@Maragues it is not Android, I have noticed this with my builds. Something has changed with an upgrade to Gradle. |
@Maragues looks like |
This fix has been released with version 3.6.4 |
Thank you Ronald! Great work as always! :) |
Still facing the issue that version 3.6.7 is writing my generated pacts to 'target/pacts' instead of '$buildDir/pacts'. And the publish tasks default directory for hooking the pacts is in the "$buildDir/pacts" I am running on gradle 5.3.1 Any ideas ? |
@HaMatthias have a look at https://github.com/uglyog/pact-junit5-test and compare it with your project. That project writes the pact files to |
Hey @HaMatthias and @uglyog, I had the same issue where the pact files are actually stored in the target dir by default. I noticed that it actually happens only when I run my pact tests using IntelliJ. If instead I run the same tests from CLI, it works correctly. The issue is that I was running the tests using Changing it to |
@kekko1212 when running from IntelliJ you'll need to set the |
@uglyog I am trying to change pact directory in JVM and it is not writting in my specified directory it always write in target/pacts |
Yep, that was my problem. Problem solved for me! I preferably use IntelliJ test runner, so i added property to the test run config |
The title explains it.
Here is my build.gradle file for reference
The text was updated successfully, but these errors were encountered: