-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix: JUnitReport.xml only contained 50 test results #1649
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import com.google.api.services.toolresults.model.ListEnvironmentsResponse | |
import com.google.api.services.toolresults.model.ListStepsResponse | ||
import com.google.api.services.toolresults.model.ListTestCasesResponse | ||
import com.google.api.services.toolresults.model.Step | ||
import com.google.api.services.toolresults.model.TestCase | ||
import com.google.testing.model.TestExecution | ||
import com.google.testing.model.ToolResultsExecution | ||
import com.google.testing.model.ToolResultsHistory | ||
|
@@ -123,7 +124,10 @@ object GcToolResults { | |
.executeWithRetry() | ||
|
||
// Lists Test Cases attached to a Step | ||
fun listTestCases(toolResultsStep: ToolResultsStep): ListTestCasesResponse { | ||
fun listTestCases( | ||
toolResultsStep: ToolResultsStep, | ||
pageToken: String? = null | ||
): ListTestCasesResponse { | ||
return service | ||
.projects() | ||
.histories() | ||
|
@@ -135,7 +139,19 @@ object GcToolResults { | |
toolResultsStep.historyId, | ||
toolResultsStep.executionId, | ||
toolResultsStep.stepId | ||
).executeWithRetry() | ||
) | ||
.setPageToken(pageToken) | ||
.executeWithRetry() | ||
} | ||
|
||
fun listAllTestCases(results: ToolResultsStep): List<TestCase> { | ||
var response = listTestCases(results) | ||
val testCases = response.testCases.toMutableList() | ||
while (response.nextPageToken != null) { | ||
response = listTestCases(results, response.nextPageToken) | ||
testCases += response.testCases ?: emptyList() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we break the loop if an empty list found? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure, this code is just copy/paste from a similar code in this file (see |
||
} | ||
return testCases | ||
} | ||
|
||
fun getDefaultBucket(projectId: String, source: String? = null): String? = try { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should update unit tests as well.