Skip to content

Commit df8e60f

Browse files
committed
fix ansible wheelhouse
1 parent d0e05cb commit df8e60f

2 files changed

Lines changed: 58 additions & 2 deletions

File tree

tests/integration-workflow.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,18 @@ describe("integration workflows", () => {
5656
expect(keygenStep?.run).toContain("HCLOUD_SSH_PUBLIC_KEY_FILE=");
5757
}
5858
});
59+
60+
test("integration source bundle carries the vendored Ansible runtime wheelhouse", () => {
61+
const contextSource = readFileSync(join(repoRoot, "tests/integration/context.ts"), "utf8");
62+
63+
expect(contextSource).toContain("TERRARIUM_ANSIBLE_PIP_PACKAGES");
64+
expect(contextSource).toContain("pip");
65+
expect(contextSource).toContain("download");
66+
expect(contextSource).toContain("--only-binary=:all:");
67+
expect(contextSource).toContain("manylinux2014_x86_64");
68+
expect(contextSource).toContain("manylinux2014_aarch64");
69+
expect(contextSource).toContain("ansible-wheelhouse");
70+
expect(contextSource).toContain("--exclude=ansible-wheelhouse");
71+
expect(contextSource).toContain('"ansible-wheelhouse"');
72+
});
5973
});

tests/integration/context.ts

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
1+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
22
import { join } from "node:path";
33
import { run } from "./lib/process";
44
import { IntegrationLogger } from "./lib/logger";
55
import { loadIntegrationConfig } from "./config";
6+
import { TERRARIUM_ANSIBLE_PIP_PACKAGES } from "../../scripts/ctl/ansible-runtime";
67
import type {
78
DomainBundle,
89
ExternalOidcFixture,
@@ -37,6 +38,16 @@ function describeCleanupStep(step: CleanupStep): string {
3738
return `ZITADEL project ${step.projectId}`;
3839
}
3940

41+
function ansibleWheelhousePlatform(binaryTarget: string): string {
42+
if (binaryTarget === "x64") {
43+
return "manylinux2014_x86_64";
44+
}
45+
if (binaryTarget === "arm64") {
46+
return "manylinux2014_aarch64";
47+
}
48+
throw new Error(`unsupported integration binary target for Ansible wheelhouse: ${binaryTarget}`);
49+
}
50+
4051
/** Global per-run context shared by all integration scenarios. */
4152
export class IntegrationContext {
4253
readonly config: IntegrationConfig;
@@ -90,6 +101,31 @@ export class IntegrationContext {
90101
{ cwd: this.config.repoRoot }
91102
);
92103

104+
const wheelhousePath = join(this.linuxBundleDir, "ansible-wheelhouse");
105+
rmSync(wheelhousePath, { recursive: true, force: true });
106+
mkdirSync(wheelhousePath, { recursive: true });
107+
await run(
108+
[
109+
"python3",
110+
"-m",
111+
"pip",
112+
"download",
113+
"--dest",
114+
wheelhousePath,
115+
"--only-binary=:all:",
116+
"--implementation",
117+
"cp",
118+
"--python-version",
119+
"312",
120+
"--abi",
121+
"cp312",
122+
"--platform",
123+
ansibleWheelhousePlatform(this.config.hcloudBinaryTarget),
124+
...TERRARIUM_ANSIBLE_PIP_PACKAGES
125+
],
126+
{ cwd: this.config.repoRoot }
127+
);
128+
93129
await run(
94130
[
95131
"tar",
@@ -98,8 +134,14 @@ export class IntegrationContext {
98134
"--exclude=.git",
99135
"--exclude=node_modules",
100136
"--exclude=dist",
137+
"--exclude=ansible-wheelhouse",
101138
"--exclude=tests/integration/output",
102-
"."
139+
"-C",
140+
this.config.repoRoot,
141+
".",
142+
"-C",
143+
this.linuxBundleDir,
144+
"ansible-wheelhouse"
103145
],
104146
{ cwd: this.config.repoRoot }
105147
);

0 commit comments

Comments
 (0)