refactor: trim v2 release hardening

This commit is contained in:
ajnart committed 2026-07-30 16:24:11 +02:00
1 parent 3cf1dc8341
commit 657704340c
79 files changed
+405 -3378

No files matched your search

+2 -3
View File
@@ -28,12 +28,11 @@ export class OnboardingActions {
}
public async startOnboardingAsync(type: "scratch" | "before 1.0") {
const name = type === "scratch" ? "Start from scratch" : "Import from Homarr before 1.0";
await this.page.getByRole("button", { name, exact: true }).click();
await this.page.locator("button", { hasText: type }).click();
}
public async processUserStepAsync(input: { username: string; password: string; confirmPassword: string }) {
await this.page.getByLabel("Username").waitFor({ state: "visible" });
await this.page.waitForSelector("text=administrator user");
await this.page.getByLabel("Username").fill(input.username);
await this.page.getByLabel("Password", { exact: true }).fill(input.password);
+11 -14
View File
@@ -10,19 +10,6 @@ export interface MockApiServer {
close: () => Promise<void>;
}
export async function exposeHostPortToContainersAsync(port: number): Promise<string> {
await TestContainers.exposeHostPorts(port);
const client = await getContainerRuntimeClient();
const forwarder = (await client.container.list()).find(
(container) => container.State === "running" && container.Labels[TESTCONTAINERS_SSHD_LABEL] === "true",
);
const forwarderAddress = forwarder
? Object.values(forwarder.NetworkSettings.Networks).find((network) => network.IPAddress)?.IPAddress
: undefined;
if (!forwarderAddress) throw new Error("Failed to locate the Testcontainers host-port forwarder");
return `http://${forwarderAddress}:${port}`;
}
export async function startMockApiServerAsync(responseBody: unknown): Promise<MockApiServer> {
const body = JSON.stringify(responseBody);
const server: Server = await new Promise((resolve) => {
@@ -39,8 +26,18 @@ export async function startMockApiServerAsync(responseBody: unknown): Promise<Mo
}
try {
await TestContainers.exposeHostPorts(address.port);
const client = await getContainerRuntimeClient();
const forwarder = (await client.container.list()).find(
(container) => container.State === "running" && container.Labels[TESTCONTAINERS_SSHD_LABEL] === "true",
);
const forwarderAddress = forwarder
? Object.values(forwarder.NetworkSettings.Networks).find((network) => network.IPAddress)?.IPAddress
: undefined;
if (!forwarderAddress) throw new Error("Failed to locate the Testcontainers host-port forwarder");
return {
url: await exposeHostPortToContainersAsync(address.port),
url: `http://${forwarderAddress}:${address.port}`,
close: () =>
new Promise((resolve, reject) => {
server.close((error) => (error ? reject(error) : resolve()));