Skip to content

Conversation

@rnakade
Copy link
Collaborator

@rnakade rnakade commented Sep 13, 2023

Retrieve results successfully when merged_results.xml is missing

@rnakade rnakade requested review from liutikas and yigit September 13, 2023 04:03
return emptyList()
}
val deviceId = byFullDeviceId.values.first().deviceRun.deviceId
val mergedResults = byFullDeviceId.values.first().xmlResults.first()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not merged anymore so we shouldn't call it mergedResults.

why do we return the first one instead of all available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, these are not mergedResults. But there should only be 1 result present in the byFullDeviceId map. So, using the xmlResult file here from that result would essentially have the same content as merged results file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then we shouldn't call the variable mergedResults.

Furthermore, i think it is more consistent for this to be:
if merged results exists, return it
otherwise, return all others.

byDeviceId.values.map { TestRunResult(...) }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made mergedResults nullable so that when mreged_results.xml file is not present, we can set it to null and incorporated rest of your feedback. Please review.

rnakade and others added 2 commits September 13, 2023 14:36
…RunnerServiceImpl.kt

Co-authored-by: Yigit Boyar <yboyar@google.com>
@rnakade rnakade merged commit c0b0888 into main Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants