-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from craigatk/parse-save
(feature) Verifying results payload can parse on server in sync request and adding configurable retry to plugin
- Loading branch information
Showing
25 changed files
with
320 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...hers/gradle-plugin/src/main/groovy/projektor/plugin/ProjektorBuildFinishedListener.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ers/gradle-plugin/src/test/groovy/projektor/plugin/testkit/PublishResultsRetrySpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package projektor.plugin.testkit | ||
|
||
import org.gradle.testkit.runner.BuildResult | ||
import projektor.plugin.SpecWriter | ||
|
||
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS | ||
|
||
class PublishResultsRetrySpec extends SingleProjectSpec { | ||
def "can configure retry max attempts and interval"() { | ||
given: | ||
buildFile << """ | ||
projektor { | ||
serverUrl = '${serverUrl}' | ||
autoPublishOnFailureOnly = false | ||
publishRetryMaxAttempts = 2 | ||
publishRetryInterval = 50 | ||
} | ||
""".stripIndent() | ||
|
||
SpecWriter.createTestDirectoryWithPassingTest(projectRootDir, "SampleSpec") | ||
|
||
resultsStubber.stubResultsPostFailure(400) | ||
|
||
when: | ||
BuildResult result = runSuccessfulBuild('test') | ||
|
||
then: | ||
result.task(":test").outcome == SUCCESS | ||
|
||
and: | ||
resultsStubber.findResultsRequests().size() == 2 | ||
} | ||
|
||
def "can configure timeout"() { | ||
given: | ||
buildFile << """ | ||
projektor { | ||
serverUrl = '${serverUrl}' | ||
autoPublishOnFailureOnly = false | ||
publishRetryMaxAttempts = 2 | ||
publishRetryInterval = 0 | ||
publishTimeout = 500 | ||
} | ||
""".stripIndent() | ||
|
||
SpecWriter.createTestDirectoryWithPassingTest(projectRootDir, "SampleSpec") | ||
|
||
resultsStubber.stubResultsPostWithDelay(600) | ||
|
||
when: | ||
BuildResult result = runSuccessfulBuild('test') | ||
|
||
then: | ||
result.task(":test").outcome == SUCCESS | ||
|
||
and: | ||
resultsStubber.findResultsRequests().size() == 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
server/server-api/src/main/kotlin/projektor/server/api/results/SaveResultsErrorResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package projektor.server.api.results | ||
|
||
data class SaveResultsErrorResponse(val id: String, val errorMessage: String) |
Oops, something went wrong.