-
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 #38 from craigatk/failure
(fix) Better handle parsing errors when saving results and standardize on JUnit5 style test annotations
- Loading branch information
Showing
39 changed files
with
185 additions
and
96 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
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
2 changes: 1 addition & 1 deletion
2
server/server-app/src/test/kotlin/projektor/attachment/AttachmentDatabaseRepositoryTest.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
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
2 changes: 1 addition & 1 deletion
2
server/server-app/src/test/kotlin/projektor/incomingresults/GroupedTestResultsServiceTest.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
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
55 changes: 55 additions & 0 deletions
55
...r-app/src/test/kotlin/projektor/incomingresults/SaveGroupedResultsErrorApplicationTest.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,55 @@ | ||
package projektor.incomingresults | ||
|
||
import io.ktor.http.HttpHeaders | ||
import io.ktor.http.HttpMethod | ||
import io.ktor.server.testing.handleRequest | ||
import io.ktor.server.testing.setBody | ||
import io.ktor.server.testing.withTestApplication | ||
import io.ktor.util.KtorExperimentalAPI | ||
import kotlin.test.assertNotNull | ||
import org.awaitility.kotlin.await | ||
import org.awaitility.kotlin.until | ||
import org.junit.jupiter.api.Test | ||
import projektor.ApplicationTestCase | ||
import projektor.parser.GroupedResultsXmlLoader | ||
import projektor.server.api.results.ResultsProcessingStatus | ||
import projektor.server.api.results.SaveResultsResponse | ||
|
||
@KtorExperimentalAPI | ||
class SaveGroupedResultsErrorApplicationTest : ApplicationTestCase() { | ||
@Test | ||
fun `should still process results after multiple failures`() { | ||
val malformedResults = GroupedResultsXmlLoader().passingGroupedResults().replace("testsuite", "") | ||
val successfulResults = GroupedResultsXmlLoader().passingGroupedResults() | ||
|
||
withTestApplication(::createTestApplication) { | ||
(1..10).forEach { _ -> | ||
handleRequest(HttpMethod.Post, "/groupedResults") { | ||
addHeader(HttpHeaders.ContentType, "application/json") | ||
setBody(malformedResults) | ||
}.apply { | ||
val resultsResponse = objectMapper.readValue(response.content, SaveResultsResponse::class.java) | ||
|
||
val publicId = resultsResponse.id | ||
assertNotNull(publicId) | ||
|
||
await until { resultsProcessingDao.fetchOneByPublicId(publicId).status == ResultsProcessingStatus.ERROR.name } | ||
} | ||
} | ||
|
||
(1..10).forEach { _ -> | ||
handleRequest(HttpMethod.Post, "/groupedResults") { | ||
addHeader(HttpHeaders.ContentType, "application/json") | ||
setBody(successfulResults) | ||
}.apply { | ||
val resultsResponse = objectMapper.readValue(response.content, SaveResultsResponse::class.java) | ||
|
||
val publicId = resultsResponse.id | ||
assertNotNull(publicId) | ||
|
||
await until { resultsProcessingDao.fetchOneByPublicId(publicId).status == ResultsProcessingStatus.SUCCESS.name } | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.