Skip to content

Commit c7c816a

Browse files
committed
test: fix name output
Signed-off-by: CrazyMax <[email protected]>
1 parent e5d20b9 commit c7c816a

22 files changed

Lines changed: 60 additions & 60 deletions

__tests__/buildkit/buildkit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('satisfies', () => {
5454
test.each([
5555
['builder2', '>=0.10.0', true],
5656
['builder2', '>0.11.0', false]
57-
])('given %p', async (builderName, range, expected) => {
57+
])('given %o', async (builderName, range, expected) => {
5858
const buildkit = new BuildKit();
5959
expect(await buildkit.versionSatisfies(builderName, range)).toBe(expected);
6060
});

__tests__/buildkit/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('resolve', () => {
5353
`,
5454
null
5555
]
56-
])('given %p config', async (val: string, file: boolean, exValue: string, error: Error | null) => {
56+
])('given %o config', async (val: string, file: boolean, exValue: string, error: Error | null) => {
5757
try {
5858
const buildkit = new BuildKit();
5959
let config: string;

__tests__/buildkit/git.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('parseURL', () => {
181181
} as GitURL,
182182
false
183183
],
184-
])('given %p', async (ref: string, expected: GitURL, expectedErr: boolean) => {
184+
])('given %o', async (ref: string, expected: GitURL, expectedErr: boolean) => {
185185
try {
186186
const got = Git.parseURL(ref);
187187
expect(got.scheme).toEqual(expected.scheme);
@@ -329,7 +329,7 @@ describe('parseRef', () => {
329329
'.git',
330330
undefined
331331
],
332-
])('given %p', async (ref: string, expected: GitRef | undefined) => {
332+
])('given %o', async (ref: string, expected: GitRef | undefined) => {
333333
try {
334334
const got = Git.parseRef(ref);
335335
expect(got).toEqual(expected);

__tests__/buildx/bake.test.itg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ maybe('getDefinition', () => {
4141
// path.join(fixturesDir, 'bake-test-docker-action-remote-private.json'),
4242
// true,
4343
// ]
44-
])('given %p', async (source: string, targets: string[], out: string, auth) => {
44+
])('given %o', async (source: string, targets: string[], out: string, auth) => {
4545
const gitAuthToken = process.env.GITHUB_TOKEN || '';
4646
if (auth && !gitAuthToken) {
4747
console.log(`Git auth token not available, skipping test`);

__tests__/buildx/bake.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('getDefinition', () => {
102102
undefined,
103103
path.join(fixturesDir, 'bake-03-default.json')
104104
],
105-
])('given %p', async (files: string[], targets: string[], overrides: string[], execOptions: ExecOptions | undefined, out: string) => {
105+
])('given %o', async (files: string[], targets: string[], overrides: string[], execOptions: ExecOptions | undefined, out: string) => {
106106
const bake = new Bake();
107107
const expectedDef = <BakeDefinition>JSON.parse(fs.readFileSync(out, {encoding: 'utf-8'}).trim())
108108
expect(await bake.getDefinition({
@@ -185,7 +185,7 @@ describe('hasLocalExporter', () => {
185185
} as unknown as BakeDefinition,
186186
true
187187
]
188-
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
188+
])('given %o returns %o', async (def: BakeDefinition, expected: boolean) => {
189189
expect(Bake.hasLocalExporter(def)).toEqual(expected);
190190
});
191191
});
@@ -285,7 +285,7 @@ describe('hasTarExporter', () => {
285285
} as unknown as BakeDefinition,
286286
false
287287
],
288-
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
288+
])('given %o returns %o', async (def: BakeDefinition, expected: boolean) => {
289289
expect(Bake.hasTarExporter(def)).toEqual(expected);
290290
});
291291
});
@@ -440,7 +440,7 @@ describe('hasDockerExporter', () => {
440440
true,
441441
true
442442
],
443-
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean | undefined) => {
443+
])('given %o and load: %o returns %o', async (def: BakeDefinition, expected: boolean, load: boolean | undefined) => {
444444
expect(Bake.hasDockerExporter(def, load)).toEqual(expected);
445445
});
446446
});
@@ -481,7 +481,7 @@ describe('hasGitAuthTokenSecret', () => {
481481
} as unknown as BakeDefinition,
482482
true
483483
],
484-
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
484+
])('given %o returns %o', async (def: BakeDefinition, expected: boolean) => {
485485
expect(Bake.hasGitAuthTokenSecret(def)).toEqual(expected);
486486
});
487487
});
@@ -536,7 +536,7 @@ describe('hasProvenanceAttestation', () => {
536536
} as unknown as BakeDefinition,
537537
true
538538
]
539-
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
539+
])('given %o returns %o', async (def: BakeDefinition, expected: boolean) => {
540540
expect(Bake.hasProvenanceAttestation(def)).toEqual(expected);
541541
});
542542
});
@@ -591,7 +591,7 @@ describe('hasSBOMAttestation', () => {
591591
} as unknown as BakeDefinition,
592592
true
593593
]
594-
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
594+
])('given %o returns %o', async (def: BakeDefinition, expected: boolean) => {
595595
expect(Bake.hasSBOMAttestation(def)).toEqual(expected);
596596
});
597597
});

__tests__/buildx/build.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('getProvenanceInput', () => {
136136
'',
137137
''
138138
],
139-
])('given input %p', async (input: string, expected: string) => {
139+
])('given input %o', async (input: string, expected: string) => {
140140
setInput('provenance', input);
141141
expect(Build.getProvenanceInput('provenance')).toEqual(expected);
142142
});
@@ -165,7 +165,7 @@ describe('resolveProvenanceAttrs', () => {
165165
'',
166166
'builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
167167
],
168-
])('given %p', async (input: string, expected: string) => {
168+
])('given %o', async (input: string, expected: string) => {
169169
expect(Build.resolveProvenanceAttrs(input)).toEqual(expected);
170170
});
171171
});
@@ -180,7 +180,7 @@ describe('resolveSecret', () => {
180180
['=bbbbbbb', false, '', '', new Error('=bbbbbbb is not a valid secret')],
181181
[`foo=${path.join(fixturesDir, 'secret.txt')}`, true, 'foo', 'bar', null],
182182
[`notfound=secret`, true, '', '', new Error('secret file secret not found')]
183-
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error | null) => {
183+
])('given %o key and %o secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error | null) => {
184184
try {
185185
let secret: string;
186186
if (file) {
@@ -201,7 +201,7 @@ describe('resolveSecret', () => {
201201
['FOO=', 'FOO', '', new Error('FOO= is not a valid secret')],
202202
['=bar', '', '', new Error('=bar is not a valid secret')],
203203
['FOO=bar=baz', 'FOO', 'bar=baz', null]
204-
])('given %p key and %p env', async (kvp: string, exKey: string, exValue: string, error: Error | null) => {
204+
])('given %o key and %o env', async (kvp: string, exKey: string, exValue: string, error: Error | null) => {
205205
try {
206206
const secret = Build.resolveSecretEnv(kvp);
207207
expect(secret).toEqual(`id=${exKey},env=${exValue}`);
@@ -255,7 +255,7 @@ describe('resolveCacheToAttrs', () => {
255255
'abcd1234',
256256
'type=gha,repository=foo/bar,mode=max,ghtoken=abcd1234',
257257
],
258-
])('given %p', async (input: string, githubToken: string | undefined, expected: string) => {
258+
])('given %o', async (input: string, githubToken: string | undefined, expected: string) => {
259259
expect(Build.resolveCacheToAttrs(input, githubToken)).toEqual(expected);
260260
});
261261
});
@@ -271,7 +271,7 @@ describe('hasLocalExporter', () => {
271271
[['"type=tar","dest=/tmp/image.tar"'], false],
272272
[['" type= local" , dest=./release-out'], true],
273273
[['.'], true]
274-
])('given %p returns %p', async (exporters: Array<string>, expected: boolean) => {
274+
])('given %o returns %o', async (exporters: Array<string>, expected: boolean) => {
275275
expect(Build.hasLocalExporter(exporters)).toEqual(expected);
276276
});
277277
});
@@ -287,7 +287,7 @@ describe('hasTarExporter', () => {
287287
[['"type=tar","dest=/tmp/image.tar"'], true],
288288
[['" type= local" , dest=./release-out'], false],
289289
[['.'], false]
290-
])('given %p returns %p', async (exporters: Array<string>, expected: boolean) => {
290+
])('given %o returns %o', async (exporters: Array<string>, expected: boolean) => {
291291
expect(Build.hasTarExporter(exporters)).toEqual(expected);
292292
});
293293
});
@@ -305,7 +305,7 @@ describe('hasDockerExporter', () => {
305305
[['type=docker'], true, false],
306306
[['type=docker'], true, true],
307307
[['.'], true, true],
308-
])('given %p returns %p', async (exporters: Array<string>, expected: boolean, load: boolean | undefined) => {
308+
])('given %o returns %o', async (exporters: Array<string>, expected: boolean, load: boolean | undefined) => {
309309
expect(Build.hasDockerExporter(exporters, load)).toEqual(expected);
310310
});
311311
});
@@ -316,7 +316,7 @@ describe('hasAttestationType', () => {
316316
['type=provenance,mode=min', 'provenance', true],
317317
['type=sbom,true', 'sbom', true],
318318
['type=foo,bar', 'provenance', false],
319-
])('given %p for %p returns %p', async (attrs: string, name: string, expected: boolean) => {
319+
])('given %o for %o returns %o', async (attrs: string, name: string, expected: boolean) => {
320320
expect(Build.hasAttestationType(name, attrs)).toEqual(expected);
321321
});
322322
});
@@ -340,7 +340,7 @@ describe('resolveAttestationAttrs', () => {
340340
'',
341341
''
342342
],
343-
])('given %p', async (input: string, expected: string) => {
343+
])('given %o', async (input: string, expected: string) => {
344344
expect(Build.resolveAttestationAttrs(input)).toEqual(expected);
345345
});
346346
});
@@ -351,7 +351,7 @@ describe('hasGitAuthTokenSecret', () => {
351351
[['A_SECRET=abcdef0123456789'], undefined, false],
352352
[['GIT_AUTH_TOKEN=abcdefghijklmno=0123456789'], undefined, true],
353353
[['GIT_AUTH_TOKEN.github.com=abcdefghijklmno=0123456789'], 'github.com', true],
354-
])('given %p secret', async (kvp: Array<string>, domain: string | undefined, expected: boolean) => {
354+
])('given %o secret', async (kvp: Array<string>, domain: string | undefined, expected: boolean) => {
355355
expect(Build.hasGitAuthTokenSecret(kvp, domain)).toBe(expected);
356356
});
357357
});

__tests__/buildx/builder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ baz = qux
548548
]
549549
}
550550
],
551-
])('given %p', async (inspectFile, expected) => {
551+
])('given %o', async (inspectFile, expected) => {
552552
expect(await Builder.parseInspect(fs.readFileSync(path.join(fixturesDir, inspectFile)).toString())).toEqual(expected);
553553
});
554554
});

__tests__/buildx/buildx.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('parseVersion', () => {
145145
['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
146146
['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2'],
147147
['github.com/docker/buildx f117971 f11797113e5a9b86bd976329c5dbb8a8bfdfadfa', 'f117971']
148-
])('given %p', async (stdout, expected) => {
148+
])('given %o', async (stdout, expected) => {
149149
expect(Buildx.parseVersion(stdout)).toEqual(expected);
150150
});
151151
});
@@ -155,7 +155,7 @@ describe('versionSatisfies', () => {
155155
['0.4.1', '>=0.3.2', true],
156156
['bda4882a65349ca359216b135896bddc1d92461c', '>0.1.0', false],
157157
['f117971', '>0.6.0', true]
158-
])('given %p', async (version, range, expected) => {
158+
])('given %o', async (version, range, expected) => {
159159
const buildx = new Buildx();
160160
expect(await buildx.versionSatisfies(range, version)).toBe(expected);
161161
});
@@ -236,7 +236,7 @@ describe('resolveCertsDriverOpts', () => {
236236
],
237237
[]
238238
],
239-
])('%p. given %p endpoint, %p driver', async (id: number, endpoint: string, driver: string, cert: Cert, expectedFiles: Array<string>, expectedOpts: Array<string>) => {
239+
])('%o. given %o endpoint, %o driver', async (id: number, endpoint: string, driver: string, cert: Cert, expectedFiles: Array<string>, expectedOpts: Array<string>) => {
240240
fs.mkdirSync(Buildx.certsDir, {recursive: true});
241241
expect(Buildx.resolveCertsDriverOpts(driver, endpoint, cert)).toEqual(expectedOpts);
242242
for (const k in expectedFiles) {
@@ -298,7 +298,7 @@ describe('localState', () => {
298298
DockerfilePath: '-'
299299
} as LocalState,
300300
]
301-
])('given %p', async (ref: string, expected: LocalState) => {
301+
])('given %o', async (ref: string, expected: LocalState) => {
302302
const localState = Buildx.localState(ref, path.join(fixturesDir, 'buildx-refs'));
303303
expect(localState).toEqual(expected);
304304
});

__tests__/buildx/install.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('download', () => {
3737
['v0.10.5', true],
3838
['latest', true]
3939
])(
40-
'acquires %p of buildx (standalone: %p)', async (version, standalone) => {
40+
'acquires %o of buildx (standalone: %o)', async (version, standalone) => {
4141
const install = new Install({standalone: standalone});
4242
const toolPath = await install.download({version});
4343
expect(fs.existsSync(toolPath)).toBe(true);
@@ -56,7 +56,7 @@ describe('download', () => {
5656
['v0.9.0'],
5757
['v0.10.5'],
5858
])(
59-
'acquires %p of buildx with cache', async (version) => {
59+
'acquires %o of buildx with cache', async (version) => {
6060
const install = new Install({standalone: false});
6161
const toolPath = await install.download({version});
6262
expect(fs.existsSync(toolPath)).toBe(true);
@@ -67,7 +67,7 @@ describe('download', () => {
6767
['v0.11.2'],
6868
['v0.12.0'],
6969
])(
70-
'acquires %p of buildx without cache', async (version) => {
70+
'acquires %o of buildx without cache', async (version) => {
7171
const install = new Install({standalone: false});
7272
const toolPath = await install.download({version: version, ghaNoCache: true});
7373
expect(fs.existsSync(toolPath)).toBe(true);

__tests__/compose/compose.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('parseVersion', () => {
101101
// prettier-ignore
102102
test.each([
103103
['Docker Compose version v2.31.0', '2.31.0'],
104-
])('given %p', async (stdout, expected) => {
104+
])('given %o', async (stdout, expected) => {
105105
expect(Compose.parseVersion(stdout)).toEqual(expected);
106106
});
107107
});

0 commit comments

Comments
 (0)