tftsr-devops_investigation/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts
Shaun Arman 2ce38b9477 fix(ci): resolve test.yml failures — Cargo.lock, updated test assertions
Cargo.lock:
- Commit the pre-existing version bump (0.1.0 → 0.2.50) so cargo
  --locked does not fail in CI; Cargo.toml already at 0.2.50

releaseWorkflowCrossPlatformArtifacts.test.ts:
- Update test that previously checked for ubuntu:22.04 / ports mirror
  inline in auto-tag.yml; that setup moved to the pre-baked
  trcaa-linux-arm64 image so the test now verifies the image reference
  and cross-compile env vars instead

ciDockerBuilders.test.ts:
- Update test that checked for docker:24-cli; changed to alpine:latest
  + docker-cli to avoid act_runner v0.3.1 duplicate socket mount bug;
  negative assertion on docker:24-cli retained
2026-04-12 20:16:32 -05:00

57 lines
2.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { readFileSync } from "node:fs";
import path from "node:path";
const autoTagWorkflowPath = path.resolve(
process.cwd(),
".gitea/workflows/auto-tag.yml",
);
describe("auto-tag release cross-platform artifact handling", () => {
it("overrides OpenSSL vendoring for windows-gnu cross builds", () => {
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
expect(workflow).toContain("OPENSSL_NO_VENDOR: \"0\"");
expect(workflow).toContain("OPENSSL_STATIC: \"1\"");
});
it("fails linux uploads when no artifacts are found", () => {
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
expect(workflow).toContain("ERROR: No Linux amd64 artifacts were found to upload.");
expect(workflow).toContain("ERROR: No Linux arm64 artifacts were found to upload.");
expect(workflow).toContain("CI=true npx tauri build");
expect(workflow).toContain("find src-tauri/target/aarch64-unknown-linux-gnu/release/bundle -type f");
expect(workflow).toContain("CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc");
expect(workflow).toContain("PKG_CONFIG_ALLOW_CROSS: \"1\"");
expect(workflow).toContain("aarch64-unknown-linux-gnu");
});
it("fails windows uploads when no artifacts are found", () => {
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
expect(workflow).toContain(
"ERROR: No Windows amd64 artifacts were found to upload.",
);
});
it("replaces existing release assets before uploading reruns", () => {
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
expect(workflow).toContain("Deleting existing asset id=$id name=$NAME before upload...");
expect(workflow).toContain("-X DELETE \"$API/releases/$RELEASE_ID/assets/$id\"");
expect(workflow).toContain("UPLOAD_NAME=\"linux-amd64-$NAME\"");
expect(workflow).toContain("UPLOAD_NAME=\"linux-arm64-$NAME\"");
});
it("uses pre-baked Ubuntu 22.04 cross-compiler image for arm64", () => {
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
// Multiarch ubuntu:22.04 + ports mirror setup moved to pre-baked image;
// verify workflow references the correct image and cross-compile env vars.
expect(workflow).toContain("trcaa-linux-arm64:rust1.88-node22");
expect(workflow).toContain("CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc");
expect(workflow).toContain("aarch64-unknown-linux-gnu");
});
});