Add an extra test
This commit is contained in:
parent
5330599c93
commit
1c25ee9d71
3 changed files with 12 additions and 1 deletions
actions
|
@ -21,6 +21,7 @@ func TestRunEvent(t *testing.T) {
|
||||||
{"basic.workflow", "push", ""},
|
{"basic.workflow", "push", ""},
|
||||||
{"pipe.workflow", "push", ""},
|
{"pipe.workflow", "push", ""},
|
||||||
{"fail.workflow", "push", "exit with `FAILURE`: 1"},
|
{"fail.workflow", "push", "exit with `FAILURE`: 1"},
|
||||||
|
{"buildfail.workflow", "push", "COPY failed"},
|
||||||
{"regex.workflow", "push", "exit with `NEUTRAL`: 78"},
|
{"regex.workflow", "push", "exit with `NEUTRAL`: 78"},
|
||||||
{"gitref.workflow", "push", ""},
|
{"gitref.workflow", "push", ""},
|
||||||
{"env.workflow", "push", ""},
|
{"env.workflow", "push", ""},
|
||||||
|
@ -42,7 +43,7 @@ func TestRunEvent(t *testing.T) {
|
||||||
if table.errorMessage == "" {
|
if table.errorMessage == "" {
|
||||||
assert.NilError(t, err, table.workflowPath)
|
assert.NilError(t, err, table.workflowPath)
|
||||||
} else {
|
} else {
|
||||||
assert.Error(t, err, table.errorMessage)
|
assert.ErrorContains(t, err, table.errorMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
actions/testdata/buildfail-action/Dockerfile
vendored
Normal file
2
actions/testdata/buildfail-action/Dockerfile
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
FROM alpine:3.8
|
||||||
|
COPY foobar /foo/bar
|
8
actions/testdata/buildfail.workflow
vendored
Normal file
8
actions/testdata/buildfail.workflow
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
workflow "test" {
|
||||||
|
on = "push"
|
||||||
|
resolves = ["test-action"]
|
||||||
|
}
|
||||||
|
|
||||||
|
action "test-action" {
|
||||||
|
uses = "./buildfail-action"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue