Skip to content

Commit 5ccab0e

Browse files
committed
test: cover a component ref that is not valid semver
1 parent ed6cf9b commit 5ccab0e

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
# https://gitlab.com/ANGkeith/gitlab-ci-local-test tags a commit as `1`, which
3+
# matches the semver range pattern but is not a valid semver version.
4+
include:
5+
- component: gitlab.com/angkeith/gitlab-ci-local-test/my-components@1

tests/test-cases/include-component/integration.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,28 @@ component-job:
197197

198198
expect(writeStreams.stdoutLines[0]).toEqual(expected);
199199
});
200+
201+
test.concurrent("include-component component (non semver tag)", async () => {
202+
initSpawnSpy([WhenStatics.mockGitRemoteHttp]);
203+
204+
const writeStreams = new WriteStreamsMock();
205+
await handler({
206+
cwd: "tests/test-cases/include-component/component-non-semver-tag",
207+
preview: true,
208+
stateDir: ".gitlab-ci-local-include-component-non-semver-tag",
209+
}, writeStreams);
210+
211+
const expected = `---
212+
stages:
213+
- .pre
214+
- build
215+
- test
216+
- deploy
217+
- .post
218+
component-job:
219+
script:
220+
- echo job 1
221+
stage: test`;
222+
223+
expect(writeStreams.stdoutLines[0]).toEqual(expected);
224+
});

0 commit comments

Comments
 (0)