chore: update fork project and release URLs
This commit is contained in:
@@ -26,7 +26,7 @@ async function fixture(name: string, appimageOnly = false, fixtureVersion = vers
|
||||
|
||||
test("Linux release inventory and Gitea feed match the current release scope", () => {
|
||||
assert.deepEqual(names, ["LearnHarness-0.4.0-x86_64.AppImage", "LearnHarness-0.4.0-amd64.deb", "latest-linux.yml", "SHA256SUMS"]);
|
||||
assert.equal(UPDATE_URL, "https://git.sorokin-oleg-edu.xyz/replicated/learnharness/releases/download/latest");
|
||||
assert.equal(UPDATE_URL, "https://git.sorokin-oleg-edu.xyz/sorokin.oleg.edu/learnharness/releases/download/latest");
|
||||
assert.throws(() => expectedLinuxAssets("0.4.0-preview"));
|
||||
});
|
||||
test("local verification checks actual installer bytes, updater hashes, sizes and checksum manifest", async () => {
|
||||
@@ -61,7 +61,7 @@ test("empty files and arbitrary downloads cannot pass as installers", async () =
|
||||
test("remote verification downloads and hashes every draft attachment, and refuses published or incomplete releases", async () => {
|
||||
const directory = await fixture("remote");
|
||||
const inventory = await verifyLocal(directory, version);
|
||||
const assets = inventory.map((asset) => ({ ...asset, browser_download_url: `https://git.sorokin-oleg-edu.xyz/replicated/learnharness/releases/download/v0.4.0/${asset.name}` }));
|
||||
const assets = inventory.map((asset) => ({ ...asset, browser_download_url: `https://git.sorokin-oleg-edu.xyz/sorokin.oleg.edu/learnharness/releases/download/v0.4.0/${asset.name}` }));
|
||||
const release = { draft: true, prerelease: false, assets };
|
||||
const request = async (input: URL | RequestInfo) => {
|
||||
const url = input instanceof URL ? input : new URL(String(input));
|
||||
@@ -184,10 +184,10 @@ function mockedReleaseCommand(directory: string, command: string, options: strin
|
||||
const { version } = JSON.parse(await fs.readFile(${JSON.stringify(path.resolve(import.meta.dirname, "../package.json"))}, "utf8"));
|
||||
const tag = "v" + version;
|
||||
const server = "https://git.sorokin-oleg-edu.xyz";
|
||||
const api = "/api/v1/repos/replicated/learnharness";
|
||||
const api = "/api/v1/repos/sorokin.oleg.edu/learnharness";
|
||||
const calls = { api: [], uploads: [], downloads: [], edits: [] };
|
||||
const files = (await fs.readdir(directory)).filter(name => name.endsWith(".AppImage") || name.endsWith(".deb") || ["latest-linux.yml", "SHA256SUMS"].includes(name));
|
||||
const assets = await Promise.all(files.map(async name => ({ name, size: (await fs.stat(path.join(directory, name))).size, browser_download_url: server + "/replicated/learnharness/releases/download/" + tag + "/" + name })));
|
||||
const assets = await Promise.all(files.map(async name => ({ name, size: (await fs.stat(path.join(directory, name))).size, browser_download_url: server + "/sorokin.oleg.edu/learnharness/releases/download/" + tag + "/" + name })));
|
||||
const release = { id: 1, tag_name: tag, draft: scenario !== "published", prerelease: scenario === "prerelease", assets: scenario === "new" ? [] : [...assets], html_url: server + "/draft" };
|
||||
if (scenario === "missing-asset") release.assets.pop();
|
||||
if (scenario === "duplicate-asset") release.assets.push(assets[0]);
|
||||
@@ -228,7 +228,7 @@ function mockedReleaseCommand(directory: string, command: string, options: strin
|
||||
return json(asset);
|
||||
}
|
||||
if (method === "GET" && url.pathname === api + "/releases/1") return json(release);
|
||||
} else if (method === "GET" && url.pathname.startsWith("/replicated/learnharness/releases/download/" + tag + "/")) {
|
||||
} else if (method === "GET" && url.pathname.startsWith("/sorokin.oleg.edu/learnharness/releases/download/" + tag + "/")) {
|
||||
const name = decodeURIComponent(path.basename(url.pathname));
|
||||
assert(files.includes(name), "download outside expected fixture");
|
||||
calls.downloads.push(name);
|
||||
|
||||
Reference in New Issue
Block a user