Update heartwood version

The update resulted in changes to all issue and patch IDs. We adapt the
tests so that they do not rely on fixed IDs.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
Thomas Scholtes
2023-11-23 09:21:37 +01:00
committed by Rūdolfs Ošiņš
parent 6cf78832de
commit 72352835eb
12 changed files with 138 additions and 160 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
</style>
<div class="header">
<div class="summary">
<div role="heading" aria-level={2} class="summary">
<slot name="title" />
</div>
<div class="subtitle">
+2 -2
View File
@@ -479,10 +479,10 @@ test("internal file markdown link", async ({ page }) => {
test("diff selection de-select", async ({ page }) => {
await page.goto(
`${cobUrl}/patches/1cd7fe9598c0a877c32c516bddb3de70dfb53366?tab=changes#README.md:H0L0H0L3`,
`${cobUrl}/patches/7db70f2ed80235db7f0ab9e5537e76572a304991?tab=changes#README.md:H0L0H0L3`,
);
await page.getByText("Add subtitle to README").click();
await expect(page).toHaveURL(
`${cobUrl}/patches/1cd7fe9598c0a877c32c516bddb3de70dfb53366?tab=changes`,
`${cobUrl}/patches/7db70f2ed80235db7f0ab9e5537e76572a304991?tab=changes`,
);
});
+6 -3
View File
@@ -18,9 +18,12 @@ test("add and remove assignees", async ({ page, authenticatedPeer }) => {
],
{ cwd: projectFolder },
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/4fe061828a067ae52bda43537ca61b7aeeb44563`,
);
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page
.getByRole("link", {
name: "This is an issue to test assignee handling",
})
.click();
await expect(page.getByText("No assignees")).toBeVisible();
+18 -23
View File
@@ -5,9 +5,7 @@ test("navigate single issue", async ({ page }) => {
await page.goto(`${cobUrl}/issues`);
await page.getByText("This title has markdown").click();
await expect(page).toHaveURL(
`${cobUrl}/issues/d72196335761c1d5fa7883f6620e7334b34e38f9`,
);
await expect(page).toHaveURL(/\/issues\/[0-9a-f]{40}/);
});
test("test issue editing failing", async ({ page, authenticatedPeer }) => {
@@ -27,21 +25,16 @@ test("test issue editing failing", async ({ page, authenticatedPeer }) => {
{ cwd: projectFolder },
);
await page.route(
`**/v1/projects/${rid}/issues/ecd5f103110b08b93bede17163d35de1e1068148`,
route => {
if (route.request().method() !== "PATCH") {
void route.fallback();
return;
}
void route.fulfill({ status: 500 });
},
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/ecd5f103110b08b93bede17163d35de1e1068148`,
);
await page.route(`**/v1/projects/${rid}/issues/*`, async route => {
if (route.request().method() === "PATCH") {
return route.fulfill({ status: 500 });
} else {
return route.fallback();
}
});
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page.getByRole("link", { name: "This issue is going to fail" }).click();
await page.getByRole("button", { name: "Leave your comment" }).click();
await page.getByPlaceholder("Leave your comment").fill("This is a comment");
await page.getByRole("button", { name: "Comment" }).first().click();
@@ -65,9 +58,10 @@ test("edit issue", async ({ page, authenticatedPeer }) => {
],
{ cwd: projectFolder },
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/df476a2b747a782c20991a258bfb7fc726cb4b0b`,
);
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page
.getByRole("link", { name: "This is an issue to edit its title" })
.click();
await expect(
page.getByText("This is an issue to edit its title"),
@@ -127,8 +121,9 @@ test("add and remove reactions", async ({ page, authenticatedPeer }) => {
],
{ cwd: projectFolder },
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/cb5f9b2de24ecfdd293a607c96d78aacc911b589`,
);
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page
.getByRole("link", { name: "This is an issue to test reactions" })
.click();
await expectReactionsToWork(page);
});
+2 -3
View File
@@ -22,9 +22,8 @@ test("add and remove labels", async ({ page, authenticatedPeer }) => {
{ cwd: projectFolder },
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/5129d02476bc8c85f35e06a7d19dde487b0a8b13`,
);
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page.getByRole("link", { name: "This is an issue to test" }).click();
await expectLabelEditingToWork(page);
await authenticatedPeer.git(["switch", "-c", "handle-labels"], {
+26 -24
View File
@@ -4,24 +4,19 @@ import { createProject, extractPatchId } from "@tests/support/project";
test("navigate patch details", async ({ page }) => {
await page.goto(`${cobUrl}/patches`);
await page.getByText("Add subtitle to README").click();
await expect(page).toHaveURL(
`${cobUrl}/patches/1cd7fe9598c0a877c32c516bddb3de70dfb53366`,
);
await expect(page).toHaveURL(/patches\/[a-f0-9]{40}$/);
await page.getByRole("link", { name: "Add subtitle to README" }).click();
await expect(page).toHaveURL(
`${cobUrl}/commits/8c900d6cb38811e099efb3cbbdbfaba817bcf970`,
);
await expect(page).toHaveURL(/commits\/[a-f0-9]{40}$/);
await page.goBack();
{
await page.getByRole("link", { name: "Changes" }).click();
await expect(page).toHaveURL(
`${cobUrl}/patches/1cd7fe9598c0a877c32c516bddb3de70dfb53366?tab=changes`,
);
}
await page.getByRole("link", { name: "Changes" }).click();
await expect(page).toHaveURL(/patches\/[a-f0-9]{40}\?tab=changes$/);
});
test("use revision selector", async ({ page }) => {
await page.goto(`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`);
await page.goto(`${cobUrl}/patches`);
await page
.getByRole("link", { name: "Taking another stab at the README" })
.click();
await page.getByRole("link", { name: "Changes" }).click();
// Validating the latest revision state
@@ -45,23 +40,26 @@ test("use revision selector", async ({ page }) => {
await page.getByRole("link", { name: "Changes" }).click();
// Switching to the initial revision
await page.getByRole("button", { name: "Revision 92f6a0c" }).click();
await page.getByRole("button", { name: "Revision fa393ed" }).click();
// getByRole("link", { name: "Revision 92f6a0c" })
await page.getByRole("button", { name: "Revision" }).first().click();
await page.getByRole("button", { name: "Revision" }).nth(1).click();
await expect(
page.getByRole("cell", { name: "Had to push a new revision" }),
).toBeHidden();
await expect(page).toHaveURL(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595/fa393edeb28bdd189bd0c0d7a262cb30d9109595?tab=changes`,
/patches\/[a-f0-9]{40}\/[a-f0-9]{40}\?tab=changes$/,
);
});
test("navigate through revision diffs", async ({ page }) => {
await page.goto(`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`);
await page.goto(`${cobUrl}/patches`);
await page
.getByRole("link", { name: "Taking another stab at the README" })
.click();
const firstRevision = page.locator(".revision").first();
const firstRevisionId = "a27a6b7";
const secondRevision = page.locator(".revision").nth(1);
// Second revision
@@ -77,7 +75,7 @@ test("navigate through revision diffs", async ({ page }) => {
page.getByRole("button", { name: "Compare 38c225..9e4fea" }),
).toBeVisible();
await expect(page).toHaveURL(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?diff=38c225e2a0b47ba59def211f4e4825c31d9463ec..9e4feab1b2123dfa5f22bd0e4656060ec9296638`,
/patches\/[a-f0-9]{40}\?diff=38c225e2a0b47ba59def211f4e4825c31d9463ec\.\.9e4feab1b2123dfa5f22bd0e4656060ec9296638$/,
);
await page.goBack();
await secondRevision
@@ -85,14 +83,16 @@ test("navigate through revision diffs", async ({ page }) => {
.first()
.click();
await secondRevision
.getByRole("link", { name: "Compare to previous revision: fa393ed" })
.getByRole("link", {
name: `Compare to previous revision: ${firstRevisionId}`,
})
.click();
await expect(
page.getByRole("button", { name: "Compare 88b7fd..9e4fea" }),
).toBeVisible();
await expect(page).toHaveURL(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?diff=88b7fd90389c1a629f91ed7bf838d4b947426622..9e4feab1b2123dfa5f22bd0e4656060ec9296638`,
/patches\/[a-f0-9]{40}\?diff=88b7fd90389c1a629f91ed7bf838d4b947426622\.\.9e4feab1b2123dfa5f22bd0e4656060ec9296638$/,
);
await page.goBack();
@@ -118,17 +118,19 @@ test("navigate through revision diffs", async ({ page }) => {
page.getByRole("button", { name: "Compare 38c225..88b7fd" }),
).toBeVisible();
await expect(page).toHaveURL(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?diff=38c225e2a0b47ba59def211f4e4825c31d9463ec..88b7fd90389c1a629f91ed7bf838d4b947426622`,
/patches\/[a-f0-9]{40}\?diff=38c225e2a0b47ba59def211f4e4825c31d9463ec\.\.88b7fd90389c1a629f91ed7bf838d4b947426622$/,
);
}
});
test("view file navigation from changes tab", async ({ page }) => {
await page.goto(`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`);
await page.goto(`${cobUrl}/patches`);
await page.getByRole("link", { name: "Add subtitle to README" }).click();
await page.getByRole("link", { name: "Changes" }).click();
await page.getByRole("button", { name: "Changes" }).click();
await page.getByRole("button", { name: "View file" }).click();
await expect(page).toHaveURL(
`${cobUrl}/tree/9e4feab1b2123dfa5f22bd0e4656060ec9296638/README.md`,
`${cobUrl}/tree/8c900d6cb38811e099efb3cbbdbfaba817bcf970/README.md`,
);
});
+6 -3
View File
@@ -22,9 +22,12 @@ test("leave comments and replies", async ({ page, authenticatedPeer }) => {
],
{ cwd: projectFolder },
);
await page.goto(
`${authenticatedPeer.uiUrl()}/${rid}/issues/017f0c6827fb19e4cfd5103e452ba58665f01798`,
);
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
await page
.getByRole("link", {
name: "This is an issue to write comments and replies",
})
.click();
await expectThreadCommentingToWork(page);
await authenticatedPeer.git(["switch", "-c", "feature-1"], {
+1 -1
View File
@@ -1 +1 @@
342b05f88d0ab9e81b03db9427b1d641cc5cb749
79644941bdfd595456e3b66a7d6630fcac9c7699
+14 -10
View File
@@ -127,6 +127,7 @@ export const NodeConfigSchema = object({
routingMaxSize: number(),
routingMaxAge: number(),
fetchConcurrency: number(),
gossipMaxAge: number(),
}),
policy: union([literal("track"), literal("block")]),
scope: union([literal("trusted"), literal("all")]),
@@ -255,23 +256,26 @@ export class RadiclePeer {
}
public async startNode(nodeParams: Partial<NodeConfig["node"]> = {}) {
const gitPort = await getPort();
const gitSocketAddr = `0.0.0.0:${gitPort}`;
const listenPort = await getPort();
this.#listenSocketAddr = `0.0.0.0:${listenPort}`;
// We need to set the `config.json` file after creating the node identity and before starting it.
// Since we aren't able to pass these configuration options through the CLI.
await updateNodeConfig(this.#radHome, nodeParams);
const args = [
"--git-daemon",
gitSocketAddr,
// Because of a bug in `radicle-node`, `limits.gossipMaxAge` is not included
// in the default config. We add it manually.
await updateNodeConfig(this.#radHome, {
limits: {
routingMaxSize: 1000,
routingMaxAge: 604800,
fetchConcurrency: 1,
gossipMaxAge: 1209600,
},
});
this.#nodeProcess = this.spawn("radicle-node", [
"--listen",
this.#listenSocketAddr,
];
this.#nodeProcess = this.spawn("radicle-node", args);
]);
await waitOn({
resources: [`socket:${this.#socket}`],
+36 -48
View File
@@ -23,18 +23,17 @@ test("issues page", async ({ page }) => {
});
test("issue page", async ({ page }) => {
await page.goto(`${cobUrl}/issues/d72196335761c1d5fa7883f6620e7334b34e38f9`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(`${cobUrl}/issues/278bbe0bf3af51e5de1dfe20fefbbec4e1121343`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(`${cobUrl}/issues/61d2dbe81411ee6a9cce75451bc637541ea6a7c2`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
const issues = [
["This title has markdown", "open"],
["A closed issue", "closed"],
["A solved issue", "closed"],
];
for (const [name, state] of issues) {
await page.goto(`${cobUrl}/issues?state=${state}`);
await page.getByRole("link", { name }).click();
await page.getByRole("heading", { name }).waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
}
});
test("patches page", async ({ page }) => {
@@ -57,36 +56,20 @@ test("patches page", async ({ page }) => {
});
test("patch page", async ({ page }) => {
// Draft patch
await page.goto(
`${cobUrl}/patches/dc9d006aa7131b62c14d570d79e079bb130ed2ea`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Archived patch
await page.goto(
`${cobUrl}/patches/08d97e8cb6f94448d0452884a9bf686beecc8549`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Merged patch
await page.goto(
`${cobUrl}/patches/cf0b92b99dd3e36d251f3d75e12b626c62d20e4c`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Open patch "Add subtitle to README"
await page.goto(
`${cobUrl}/patches/1cd7fe9598c0a877c32c516bddb3de70dfb53366`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Open patch "Taking another stab at the README"
await page.goto(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
const patches = [
["This patch is going to be reverted to draft", "draft"],
["This patch is going to be archived", "archived"],
["Let's add a README", "merged"],
["Add subtitle to README", "open"],
["Taking another stab at the README", "open"],
];
for (const [name, state] of patches) {
await page.goto(`${cobUrl}/patches?state=${state}`);
await page.getByRole("link", { name }).click();
await page.getByRole("heading", { name }).waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
}
// Expand commit messages to check border line height
await page.getByLabel("expand").nth(2).click();
@@ -97,11 +80,10 @@ test("patch page", async ({ page }) => {
await expect(page).toHaveScreenshot({ fullPage: true });
await page.getByLabel("expand").nth(1).click();
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?tab=changes`,
{ waitUntil: "networkidle" },
);
await page.getByRole("button", { name: "Changes" }).click();
await page
.getByText("1 file changed with 5 insertions and 1 deletion")
.waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
});
@@ -111,6 +93,12 @@ test("failed diff loading for a specific revision", async ({ page }) => {
route => route.fulfill({ status: 500 }),
);
await page.goto(`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`);
await page.goto(`${cobUrl}/patches`);
await page
.getByRole("link", { name: "Taking another stab at the README" })
.click();
await page
.getByRole("heading", { name: "Taking another stab at the README" })
.waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
});
+25 -41
View File
@@ -30,18 +30,17 @@ test("issues page", async ({ page }) => {
});
test("issue page", async ({ page }) => {
await page.goto(`${cobUrl}/issues/d72196335761c1d5fa7883f6620e7334b34e38f9`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(`${cobUrl}/issues/278bbe0bf3af51e5de1dfe20fefbbec4e1121343`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(`${cobUrl}/issues/61d2dbe81411ee6a9cce75451bc637541ea6a7c2`, {
waitUntil: "networkidle",
});
await expect(page).toHaveScreenshot({ fullPage: true });
const issues = [
["This title has markdown", "open"],
["A closed issue", "closed"],
["A solved issue", "closed"],
];
for (const [name, state] of issues) {
await page.goto(`${cobUrl}/issues?state=${state}`);
await page.getByRole("link", { name }).click();
await page.getByRole("heading", { name }).waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
}
});
test("patches page", async ({ page }) => {
@@ -64,33 +63,18 @@ test("patches page", async ({ page }) => {
});
test("patch page", async ({ page }) => {
// Draft patch
await page.goto(
`${cobUrl}/patches/dc9d006aa7131b62c14d570d79e079bb130ed2ea`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Archived patch
await page.goto(
`${cobUrl}/patches/43ae785a9ceaf289b2445fb5b8e01036d456b2be`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Merged patch
await page.goto(
`${cobUrl}/patches/6a51e1d2e350136e7bcfad8f13d16488c1f1c99a`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
// Open patch
await page.goto(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
await page.goto(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?tab=changes`,
{ waitUntil: "networkidle" },
);
await expect(page).toHaveScreenshot({ fullPage: true });
const patches = [
["This patch is going to be reverted to draft", "draft"],
["This patch is going to be archived", "archived"],
["Let's add a README", "merged"],
["Add subtitle to README", "open"],
["Taking another stab at the README", "open"],
];
for (const [name, state] of patches) {
await page.goto(`${cobUrl}/patches?state=${state}`);
await page.getByRole("link", { name }).click();
await page.getByRole("heading", { name }).waitFor();
await expect(page).toHaveScreenshot({ fullPage: true });
}
});
+1 -1
View File
@@ -64,7 +64,7 @@ test("diff selection", async ({ page }) => {
});
await page.goto(
`${cobUrl}/patches/fa393edeb28bdd189bd0c0d7a262cb30d9109595?tab=changes#README.md:H0L0H0L3`,
`${cobUrl}/patches/a27a6b77246e6ada5e81bc8764b5f5c593be80a5?tab=changes#README.md:H0L0H0L3`,
);
await expect(page).toHaveScreenshot({ fullPage: true });
});