-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added default-image option to be used with --shell-executor-no-image=…
…false
- Loading branch information
Showing
5 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
test-job: | ||
stage: test | ||
script: | ||
- echo "Heya from default-image" |
45 changes: 45 additions & 0 deletions
45
tests/test-cases/shell-executor-no-image/integration.shell-executor-no-image.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {WriteStreamsMock} from "../../../src/write-streams.js"; | ||
import {handler} from "../../../src/handler.js"; | ||
|
||
test("shell-executor-no-image false default-image alpine", async () => { | ||
const writeStreams = new WriteStreamsMock(); | ||
await handler({ | ||
pullPolicy: "if-not-present", | ||
cwd: "tests/test-cases/shell-executor-no-image/", | ||
shellExecutorNoImage: false, | ||
defaultImage: "alpine:latest", | ||
job: ["test-job"], | ||
noColor: true, | ||
}, writeStreams); | ||
|
||
expect(writeStreams.stdoutLines.join("\n")).toMatch(/test-job starting alpine:latest \(test\)/); | ||
}); | ||
|
||
test("shell-executor-no-image false default-image null", async () => { | ||
const writeStreams = new WriteStreamsMock(); | ||
await handler({ | ||
pullPolicy: "if-not-present", | ||
cwd: "tests/test-cases/shell-executor-no-image/", | ||
shellExecutorNoImage: false, | ||
defaultImage: null, | ||
job: ["test-job"], | ||
noColor: true, | ||
}, writeStreams); | ||
|
||
expect(writeStreams.stdoutLines.join("\n")).toMatch(/test-job starting docker.io\/ruby:3.1 \(test\)/); | ||
}); | ||
|
||
test("shell-executor-no-image true default-image doesnt-matter", async () => { | ||
const writeStreams = new WriteStreamsMock(); | ||
await handler({ | ||
pullPolicy: "if-not-present", | ||
cwd: "tests/test-cases/shell-executor-no-image/", | ||
shellExecutorNoImage: true, | ||
defaultImage: "doesnt-matter", | ||
job: ["test-job"], | ||
noColor: true, | ||
}, writeStreams); | ||
|
||
expect(writeStreams.stdoutLines.join("\n")).toMatch(/test-job starting shell \(test\)/); | ||
expect(writeStreams.stderrLines.join("\n")).toMatch(/WARN\s\s--default-image does not work with --shell-executor-no-image=true/); | ||
}); |