TestKit with Spock - Mismatch between directory set in GradleRunner to what the plugin uses


(Gabriel Kohen) #1

Hi Folks,

We’re using the Gradle 4.8. the development env is MacOS.
We set up the Build result as follows:
BuildResult buildResult = GradleRunner.create()
.withArguments(’–debug’, ‘–stacktrace’, ‘–dry-run’, task)
Where testProjectDir is set in the class as:
private final TemporaryFolder testProjectDir = new TemporaryFolder()
When inspecting the value in the test stackframe I see something in the lines of:

However on the same run, when putting a breakpoint inside of the plugin itself which is under test, I see the project location as:

I thought the directory used should be what we specify in the runner. There reason it’s important for us is because as part of the test setup we’re creating a directory under testProjectDir which the plugin needs to interact with.

Any ideas of what I’m missing.