e2e: dispatch backup via source-group API
CI / Test (rest) (pull_request) Successful in 7s
CI / Test (store) (pull_request) Successful in 6s
CI / Build (windows/amd64) (pull_request) Successful in 8s
CI / Lint (pull_request) Successful in 18s
CI / Build (linux/amd64) (pull_request) Successful in 7s
CI / Build (linux/arm64) (pull_request) Successful in 8s
e2e / Playwright vs docker-compose (pull_request) Successful in 1m27s
CI / Test (server-http) (pull_request) Successful in 3m3s
CI / Test (rest) (pull_request) Successful in 7s
CI / Test (store) (pull_request) Successful in 6s
CI / Build (windows/amd64) (pull_request) Successful in 8s
CI / Lint (pull_request) Successful in 18s
CI / Build (linux/amd64) (pull_request) Successful in 7s
CI / Build (linux/arm64) (pull_request) Successful in 8s
e2e / Playwright vs docker-compose (pull_request) Successful in 1m27s
CI / Test (server-http) (pull_request) Successful in 3m3s
Per-host Run-backup is gone — the host_chrome partial still
renders the button but it's hard-disabled with a tooltip
pointing to per-source-group Run-now. The smoke test was
clicking that disabled button and waiting forever for a URL
change that would never happen.
Replace the navigation-based dispatch with two API calls:
create a source group covering the agent's /source mount,
then POST to /api/hosts/{id}/source-groups/{gid}/run. The
backup-status assertion at the end is unchanged — host record
is still the source of truth.
This commit is contained in:
@@ -107,6 +107,43 @@ export async function waitForHostStatus(
|
||||
throw new Error(`waitForHostStatus: timeout. Last seen: ${JSON.stringify(last)}`);
|
||||
}
|
||||
|
||||
export async function createSourceGroup(
|
||||
request: APIRequestContext,
|
||||
cookie: string,
|
||||
hostID: string,
|
||||
body: { name: string; includes: string[]; excludes?: string[] },
|
||||
): Promise<string> {
|
||||
const res = await request.post(`${baseURL}/api/hosts/${hostID}/source-groups`, {
|
||||
headers: { cookie, 'content-type': 'application/json' },
|
||||
data: {
|
||||
name: body.name,
|
||||
includes: body.includes,
|
||||
excludes: body.excludes ?? [],
|
||||
retention_policy: {},
|
||||
retry_max: 0,
|
||||
retry_backoff_seconds: 0,
|
||||
},
|
||||
});
|
||||
if (!res.ok()) throw new Error(`createSourceGroup: ${res.status()} ${await res.text()}`);
|
||||
const created = (await res.json()) as { id?: string; group?: { id?: string } };
|
||||
const id = created.id ?? created.group?.id;
|
||||
if (!id) throw new Error(`createSourceGroup: no id in response: ${JSON.stringify(created)}`);
|
||||
return id;
|
||||
}
|
||||
|
||||
export async function runSourceGroup(
|
||||
request: APIRequestContext,
|
||||
cookie: string,
|
||||
hostID: string,
|
||||
groupID: string,
|
||||
): Promise<void> {
|
||||
const res = await request.post(
|
||||
`${baseURL}/api/hosts/${hostID}/source-groups/${groupID}/run`,
|
||||
{ headers: { cookie } },
|
||||
);
|
||||
if (!res.ok()) throw new Error(`runSourceGroup: ${res.status()} ${await res.text()}`);
|
||||
}
|
||||
|
||||
export async function getSessionCookie(page: Page): Promise<string> {
|
||||
const cookies = await page.context().cookies();
|
||||
const c = cookies.find((c) => c.name === 'rm_session');
|
||||
|
||||
Reference in New Issue
Block a user