mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-07 21:00:34 +08:00
explorer: Run release tests on pre-built httpd
- Stop skipping release tests without the local httpd build: pre-built httpd 0.30.0 serves the release API - Mock a repo without a release count to test older nodes - Remove the unused releaseApiOnlyLocal
This commit is contained in:
@@ -4,13 +4,11 @@ import { describe, expect } from "vitest";
|
||||
|
||||
import { testFixture } from "@http-client/tests/support/fixtures.js";
|
||||
import { createRepo } from "@tests/support/repo.js";
|
||||
import { useLocalHttpd } from "@tests/support/support.js";
|
||||
|
||||
describe("release", () => {
|
||||
// The release read API only exists in the local httpd build, so skip these
|
||||
// against the stable pre-built binary the default suite runs. Releases are
|
||||
// seeded on an isolated peer to avoid perturbing the shared fixtures.
|
||||
testFixture.skipIf(!useLocalHttpd)(
|
||||
// Releases are seeded on an isolated peer to avoid perturbing the shared
|
||||
// fixtures.
|
||||
testFixture(
|
||||
"#getAllReleases(rid) + #getReleaseById(rid, id)",
|
||||
async ({ httpd: { api, peer } }) => {
|
||||
const { rid, repoFolder } = await createRepo(peer, {
|
||||
|
||||
@@ -6,10 +6,8 @@ import {
|
||||
registerArtifact,
|
||||
syncFrom,
|
||||
} from "@tests/support/repo.js";
|
||||
import { releaseApiOnlyLocal, useLocalHttpd } from "@tests/support/support.js";
|
||||
|
||||
test.describe(() => {
|
||||
test.skip(!useLocalHttpd, releaseApiOnlyLocal);
|
||||
// Release fixtures need several rad-artifact commands, which takes longer
|
||||
// than the default per-test budget.
|
||||
test.describe.configure({ timeout: 30_000 });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { test, cobUrl, expect } from "@tests/support/fixtures.js";
|
||||
import { test, cobRid, cobUrl, expect } from "@tests/support/fixtures.js";
|
||||
import {
|
||||
createContributor,
|
||||
createRepo,
|
||||
@@ -6,10 +6,8 @@ import {
|
||||
registerArtifact,
|
||||
syncFrom,
|
||||
} from "@tests/support/repo.js";
|
||||
import { releaseApiOnlyLocal, useLocalHttpd } from "@tests/support/support.js";
|
||||
|
||||
test.describe(() => {
|
||||
test.skip(!useLocalHttpd, releaseApiOnlyLocal);
|
||||
// Release fixtures need several rad-artifact commands, which takes longer
|
||||
// than the default per-test budget.
|
||||
test.describe.configure({ timeout: 30_000 });
|
||||
@@ -106,7 +104,13 @@ test.describe(() => {
|
||||
});
|
||||
|
||||
test("releases are unavailable on older nodes", async ({ page }) => {
|
||||
test.skip(useLocalHttpd, "older nodes are the pre-built httpd release");
|
||||
// Older nodes don't report a release count.
|
||||
await page.route(`**/api/v1/repos/${cobRid}`, async route => {
|
||||
const response = await route.fetch();
|
||||
const json = await response.json();
|
||||
delete json.payloads["xyz.radicle.project"].meta.releases;
|
||||
await route.fulfill({ response, json });
|
||||
});
|
||||
|
||||
await page.goto(cobUrl);
|
||||
await expect(page.getByRole("link", { name: /^Releases/ })).toBeHidden();
|
||||
|
||||
@@ -39,9 +39,6 @@ export const radicleArtifactRelease = (
|
||||
|
||||
export const useLocalHttpd = process.env.USE_LOCAL_HTTPD === "true";
|
||||
|
||||
export const releaseApiOnlyLocal =
|
||||
"the release read API only exists in the local httpd build";
|
||||
|
||||
// Assert that binaries are installed and are the correct version.
|
||||
export async function assertBinariesInstalled(
|
||||
binary: string,
|
||||
|
||||
Reference in New Issue
Block a user