[failedTestReporter] don't search for existing issues unless we're writing to GH (#120820) (#120830)

Co-authored-by: Spencer <email@spalger.com>
This commit is contained in:
Kibana Machine 2021-12-08 16:24:00 -05:00 committed by GitHub
parent c46b52e9c2
commit 0e7dccef43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,11 +124,13 @@ export function runFailedTestsReporterCli() {
continue;
}
let existingIssue: GithubIssueMini | undefined = await githubApi.findFailedTestIssue(
(i) =>
getIssueMetadata(i.body, 'test.class') === failure.classname &&
getIssueMetadata(i.body, 'test.name') === failure.name
);
let existingIssue: GithubIssueMini | undefined = updateGithub
? await githubApi.findFailedTestIssue(
(i) =>
getIssueMetadata(i.body, 'test.class') === failure.classname &&
getIssueMetadata(i.body, 'test.name') === failure.name
)
: undefined;
if (!existingIssue) {
const newlyCreated = newlyCreatedIssues.find(