Austin
Austin
I have multiple GraphQL servers with the same API, and I want to write one client class which may be parameterized by (server + authentication for that server), e.g ```ruby...
I have quite a few tests (Groovy Spock tests that use PowerMock to mock static features of Java classes). In my case, my `stderr` output ends up like this: ```...
Could you elaborate a bit on your test setup? E.g., how your code-under-test is calling `sh(...)` and what invocation(s) you're trying to capture? As far as I can tell, `[returnStdout:true],...
This `Jenkinsfile`: https://github.com/homeaway/jenkins-spock/blob/issue-50/examples/whole-pipeline/Jenkinsfile#L1-L4 And this test: https://github.com/homeaway/jenkins-spock/blob/issue-50/examples/whole-pipeline/src/test/groovy/JenkinsfileSpec.groovy#L12-L16 demonstrate how to assert & stub a call to the `sh(...)` pipeline step that uses named parameters. It is a characteristic of Spock...
`sh( returnStdout: true, "echo 'hello world'")` does not evaluate on an actual Jenkins server: `Jenkinsfile`: ```groovy node { sh( returnStdout: true, "echo 'hello world'" ) } ``` ``` java.lang.IllegalArgumentException: Expected...
Having updated your mock/stub to use just one parameter: a map with key/value pairs for each named parameter of `sh`, are you able to get the code-under-test to connect with...
Ahh, I see. Specifically regarding this: > Also doesn't seem to work if you set your scripts or other hash variables to wildcard _. That's where > Mocking / Stubbing...
You're, right, this does not work: ```groovy getPipelineMock('sh')([script: _, label: _, returnStdout: true]) >> "test" ``` This is because _Spock_ - the Groovy testing framework on which `jenkins-spock` is based...
If you're running Spock with Maven, the actual test-runner is the `maven-surefire-plugin` which will kick off the Spock tests. In that case, you _may_ find a complete stack trace by...
There isn't anything I know of that works out-of-the-box. It should be possible in theory, but I haven't done any research into it yet.