Skip to content

Commit 6702240

Browse files
committed
feat: allow to pass undocumented tmt_context inputs
Fixes #325
1 parent be2daf3 commit 6702240

File tree

9 files changed

+1287
-6624
lines changed

9 files changed

+1287
-6624
lines changed

dist/index.js

Lines changed: 1256 additions & 6599 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/schema/input.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@octokit/types": "16.0.0",
3737
"date-fns": "4.1.0",
3838
"issue-metadata": "0.2.4",
39-
"testing-farm": "1.10.2",
39+
"testing-farm": "1.11.0",
4040
"zod": "4.1.12"
4141
},
4242
"devDependencies": {

src/schema/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const tmtArtifactsSchema = z
4848

4949
// https://api.testing-farm.io/redoc#operation/request_a_new_test_v0_1_requests_post
5050
// https://tmt.readthedocs.io/en/stable/spec/context.html#dimension
51-
export const tmtContextSchema = z.object({
51+
export const tmtContextSchema = z.looseObject({
5252
distro: z.string().min(1).optional(),
5353
variant: z.string().min(1).optional(),
5454
arch: z.string().min(1).optional(),

tests/unit/input.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ describe('tmt variables/secrets/context input', () => {
4040
});
4141

4242
test('tmt-context input', () => {
43-
let input = 'distro=fedora;arch=x86_64;trigger=push';
43+
// test undocumented inputs
44+
let input =
45+
'COMPOSE_CONTROLLER=RHEL-9-Nightly;COMPOSE_MANAGED_NODE=RHEL-9.6.0-Nightly;initiator=testing-farm';
46+
47+
expect(tmtContextSchema.parse(tmtContextInputSchema.parse(input)))
48+
.toMatchInlineSnapshot(`
49+
{
50+
"COMPOSE_CONTROLLER": "RHEL-9-Nightly",
51+
"COMPOSE_MANAGED_NODE": "RHEL-9.6.0-Nightly",
52+
"initiator": "testing-farm",
53+
}
54+
`);
55+
56+
input = 'distro=fedora;arch=x86_64;trigger=push';
4457

4558
expect(tmtContextSchema.parse(tmtContextInputSchema.parse(input)))
4659
.toMatchInlineSnapshot(`

yarn.lock

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,14 +1137,14 @@ __metadata:
11371137
languageName: node
11381138
linkType: hard
11391139

1140-
"axios@npm:1.11.0":
1141-
version: 1.11.0
1142-
resolution: "axios@npm:1.11.0"
1140+
"axios@npm:1.13.2":
1141+
version: 1.13.2
1142+
resolution: "axios@npm:1.13.2"
11431143
dependencies:
11441144
follow-redirects: "npm:^1.15.6"
11451145
form-data: "npm:^4.0.4"
11461146
proxy-from-env: "npm:^1.1.0"
1147-
checksum: 10/232df4af7a4e4e07baa84621b9cc4b0c518a757b4eacc7f635c0eb3642cb98dff347326739f24b891b3b4481b7b838c79a3a0c4819c9fbc1fc40232431b9c5dc
1147+
checksum: 10/ae4e06dcd18289f2fd18179256d550d27f9a53ecb2f9c59f2ccc4efd1d7151839ba8c3e0fb533dac793e4a59a576ca8689a19244dce5c396680837674a47a867
11481148
languageName: node
11491149
linkType: hard
11501150

@@ -2574,21 +2574,21 @@ __metadata:
25742574
date-fns: "npm:4.1.0"
25752575
issue-metadata: "npm:0.2.4"
25762576
prettier: "npm:3.6.2"
2577-
testing-farm: "npm:1.10.2"
2577+
testing-farm: "npm:1.11.0"
25782578
ts-node: "npm:10.9.2"
25792579
typescript: "npm:5.9.3"
25802580
vitest: "npm:3.2.4"
25812581
zod: "npm:4.1.12"
25822582
languageName: unknown
25832583
linkType: soft
25842584

2585-
"testing-farm@npm:1.10.2":
2586-
version: 1.10.2
2587-
resolution: "testing-farm@npm:1.10.2"
2585+
"testing-farm@npm:1.11.0":
2586+
version: 1.11.0
2587+
resolution: "testing-farm@npm:1.11.0"
25882588
dependencies:
2589-
axios: "npm:1.11.0"
2590-
zod: "npm:4.1.1"
2591-
checksum: 10/8cce016b662324072b8088d332e22bd46df675f9d26629c4d9cef193e54ce972c733a07bde3c1da952a7dafc5cef233ba2e9e56a62ad3e2af70ee4413ca2f96d
2589+
axios: "npm:1.13.2"
2590+
zod: "npm:4.1.12"
2591+
checksum: 10/2f91a5e3428ff71400aa009deff405479fc1b1cc8dd42fa5be1f8d7176e03c226f01457521efd183132367cf2f7004e4b069ceef661833c47df12ab5c2ba94e8
25922592
languageName: node
25932593
linkType: hard
25942594

@@ -2977,13 +2977,6 @@ __metadata:
29772977
languageName: node
29782978
linkType: hard
29792979

2980-
"zod@npm:4.1.1":
2981-
version: 4.1.1
2982-
resolution: "zod@npm:4.1.1"
2983-
checksum: 10/63e17d2f8d4e7a49331a62c2ad5b71705330139ddd677f2a055073b6a521a312e5dd2edc3e00953c90575075af098493c5c7b85429de0a952b8d6ab8c7e1b7e3
2984-
languageName: node
2985-
linkType: hard
2986-
29872980
"zod@npm:4.1.12":
29882981
version: 4.1.12
29892982
resolution: "zod@npm:4.1.12"

0 commit comments

Comments
 (0)