Skip to content

Commit

Permalink
test: add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ANGkeith committed Nov 7, 2024
1 parent 4a9db60 commit f2a5575
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test-cases/include-project-file/.gitlab-ci-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
include:
# https://gitlab.com/ANGkeith/gitlab-ci-local-test
- project: angkeith/gitlab-ci-local-test
ref: issue/#1011
file:
- .gitlab-ci.yml
19 changes: 19 additions & 0 deletions tests/test-cases/include-project-file/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,22 @@ test("include:project should target default branch when ref is missing", async (
const filteredStdout = writeStreams.stdoutLines.filter(f => f.startsWith("job >")).join("\n");
expect(filteredStdout).toEqual(expected);
});

test("include:project should respect rules specified in included project", async () => {
const writeStreams = new WriteStreamsMock();

await handler({
file: ".gitlab-ci-3.yml",
cwd: "tests/test-cases/include-project-file",
noColor: true,
list: true,
}, writeStreams);


const expected = [
"name description stage when allow_failure needs",
"should execute since rule eval to true test on_success false ",
];

expect(writeStreams.stdoutLines.join("\n")).toEqual(expected.join("\n"));
});

0 comments on commit f2a5575

Please sign in to comment.