Report on Playwright flakes in the merge queue (#33750)
This commit is contained in:
committed by
GitHub
parent
a7b70ee9cc
commit
afc4e52df4
@@ -139,7 +139,8 @@ class FlakyReporter implements Reporter {
|
||||
console.log(flake);
|
||||
}
|
||||
|
||||
const { GITHUB_TOKEN, GITHUB_API_URL, GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID } = process.env;
|
||||
const { GITHUB_TOKEN, GITHUB_API_URL, GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID, GITHUB_EVENT_NAME } =
|
||||
process.env;
|
||||
if (!GITHUB_TOKEN) return;
|
||||
|
||||
const issues = await this.getAllIssues();
|
||||
@@ -147,13 +148,17 @@ class FlakyReporter implements Reporter {
|
||||
const title = ISSUE_TITLE_PREFIX + "`" + flake + "`";
|
||||
const existingIssue = issues.find((issue) => issue.title === title);
|
||||
const headers = { Authorization: `Bearer ${GITHUB_TOKEN}` };
|
||||
const body = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;
|
||||
let body = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;
|
||||
|
||||
if (GITHUB_EVENT_NAME === "merge_group") {
|
||||
body += " (merge queue run, may be a false positive)";
|
||||
}
|
||||
|
||||
const labels = [LABEL, ...results.map((test) => `${LABEL}-${test.parent.project()?.name}`)];
|
||||
|
||||
if (existingIssue) {
|
||||
console.log(`Found issue ${existingIssue.number} for ${flake}, adding comment...`);
|
||||
// Ensure that the test is open
|
||||
// Ensure that the issue is open
|
||||
await fetch(existingIssue.url, {
|
||||
method: "PATCH",
|
||||
headers,
|
||||
|
||||
Reference in New Issue
Block a user