From 9d896028bd4b1780614b7ffa3120973f62ec9e57 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Thu, 28 Aug 2025 12:50:23 +0200 Subject: [PATCH] tests: Disable `Create review from commit` flaky e2e test (#9049) This test fails on unrelated changes (see for instance https://codeberg.org/forgejo/forgejo/actions/runs/98626/jobs/3 or #9047). This defeats the purpose of such a test and hinders development for all Forgejo contributors, so I am proposing to disable it. I have notified PR #7155 (which introduced it) about the need to fix it. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9049 Reviewed-by: Earl Warren Co-authored-by: Antonin Delpeuch Co-committed-by: Antonin Delpeuch --- tests/e2e/pr-review.test.e2e.ts | 104 ++++++++++++++++---------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/tests/e2e/pr-review.test.e2e.ts b/tests/e2e/pr-review.test.e2e.ts index 03f3a3d8b3..5da06e9a64 100644 --- a/tests/e2e/pr-review.test.e2e.ts +++ b/tests/e2e/pr-review.test.e2e.ts @@ -30,57 +30,59 @@ test('PR: Create review from files', async ({page}) => { await save_visual(page); }); -test('PR: Create review from commit', async ({page}) => { - const response = await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); - expect(response?.status()).toBe(200); - - await page.locator('button.add-code-comment').click(); - const code_comment = page.locator('.comment-code-cloud form textarea.markdown-text-editor'); - await expect(code_comment).toBeVisible(); - - await code_comment.fill('This is a code comment'); - await save_visual(page); - - const start_button = page.locator('.comment-code-cloud form button.btn-start-review'); - // Workaround for #7152, where there might already be a pending review state from previous - // test runs (most likely to happen when debugging tests). - if (await start_button.isVisible({timeout: 100})) { - await start_button.click(); - } else { - await page.locator('.comment-code-cloud form button[name="pending_review"]').click(); - } - - await expect(page.locator('.comment-list .comment-container')).toBeVisible(); - - // We need to wait for the review to be processed. Checking the comment counter - // conveniently does that. - await expect(page.locator('#review-box .js-btn-review > span.review-comments-counter')).toHaveText('1'); - - await page.locator('#review-box .js-btn-review').click(); - await expect(page.locator('.tippy-box .review-box-panel')).toBeVisible(); - await save_visual(page); - - await page.locator('.review-box-panel textarea.markdown-text-editor') - .fill('This is a review'); - await page.locator('.review-box-panel button.btn-submit[value="approve"]').click(); - await page.waitForURL(/.*\/user2\/repo1\/pulls\/3#issuecomment-\d+/); - await save_visual(page); - - // In addition to testing the ability to delete comments, this also - // performs clean up. If tests are run for multiple platforms, the data isn't reset - // in-between, and subsequent runs of this test would fail, because when there already is - // a comment, the on-hover button to start a conversation doesn't appear anymore. - await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); - await page.locator('.comment-header-right.actions a.context-menu').click(); - - await expect(page.locator('.comment-header-right.actions div.menu').getByText(/Copy link.*/)).toBeVisible(); - // The button to delete a comment will prompt for confirmation using a browser alert. - page.on('dialog', (dialog) => dialog.accept()); - await page.locator('.comment-header-right.actions div.menu .delete-comment').click(); - - await expect(page.locator('.comment-list .comment-container')).toBeHidden(); - await save_visual(page); -}); +// Test disabled because it is flaky. +// TODO: re-enable it +// test('PR: Create review from commit', async ({page}) => { +// const response = await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); +// expect(response?.status()).toBe(200); +// +// await page.locator('button.add-code-comment').click(); +// const code_comment = page.locator('.comment-code-cloud form textarea.markdown-text-editor'); +// await expect(code_comment).toBeVisible(); +// +// await code_comment.fill('This is a code comment'); +// await save_visual(page); +// +// const start_button = page.locator('.comment-code-cloud form button.btn-start-review'); +// // Workaround for #7152, where there might already be a pending review state from previous +// // test runs (most likely to happen when debugging tests). +// if (await start_button.isVisible({timeout: 100})) { +// await start_button.click(); +// } else { +// await page.locator('.comment-code-cloud form button[name="pending_review"]').click(); +// } +// +// await expect(page.locator('.comment-list .comment-container')).toBeVisible(); +// +// // We need to wait for the review to be processed. Checking the comment counter +// // conveniently does that. +// await expect(page.locator('#review-box .js-btn-review > span.review-comments-counter')).toHaveText('1'); +// +// await page.locator('#review-box .js-btn-review').click(); +// await expect(page.locator('.tippy-box .review-box-panel')).toBeVisible(); +// await save_visual(page); +// +// await page.locator('.review-box-panel textarea.markdown-text-editor') +// .fill('This is a review'); +// await page.locator('.review-box-panel button.btn-submit[value="approve"]').click(); +// await page.waitForURL(/.*\/user2\/repo1\/pulls\/3#issuecomment-\d+/); +// await save_visual(page); +// +// // In addition to testing the ability to delete comments, this also +// // performs clean up. If tests are run for multiple platforms, the data isn't reset +// // in-between, and subsequent runs of this test would fail, because when there already is +// // a comment, the on-hover button to start a conversation doesn't appear anymore. +// await page.goto('/user2/repo1/pulls/3/commits/4a357436d925b5c974181ff12a994538ddc5a269'); +// await page.locator('.comment-header-right.actions a.context-menu').click(); +// +// await expect(page.locator('.comment-header-right.actions div.menu').getByText(/Copy link.*/)).toBeVisible(); +// // The button to delete a comment will prompt for confirmation using a browser alert. +// page.on('dialog', (dialog) => dialog.accept()); +// await page.locator('.comment-header-right.actions div.menu .delete-comment').click(); +// +// await expect(page.locator('.comment-list .comment-container')).toBeHidden(); +// await save_visual(page); +// }); test('PR: Navigate by single commit', async ({page}) => { const response = await page.goto('/user2/repo1/pulls/3/commits');