From 1c25ee9d710c1c011185093112e33eaba00d6368 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Fri, 1 Mar 2019 21:36:07 -0600 Subject: [PATCH] Add an extra test --- actions/runner_test.go | 3 ++- actions/testdata/buildfail-action/Dockerfile | 2 ++ actions/testdata/buildfail.workflow | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 actions/testdata/buildfail-action/Dockerfile create mode 100644 actions/testdata/buildfail.workflow diff --git a/actions/runner_test.go b/actions/runner_test.go index 92ef52c..46c969f 100644 --- a/actions/runner_test.go +++ b/actions/runner_test.go @@ -21,6 +21,7 @@ func TestRunEvent(t *testing.T) { {"basic.workflow", "push", ""}, {"pipe.workflow", "push", ""}, {"fail.workflow", "push", "exit with `FAILURE`: 1"}, + {"buildfail.workflow", "push", "COPY failed"}, {"regex.workflow", "push", "exit with `NEUTRAL`: 78"}, {"gitref.workflow", "push", ""}, {"env.workflow", "push", ""}, @@ -42,7 +43,7 @@ func TestRunEvent(t *testing.T) { if table.errorMessage == "" { assert.NilError(t, err, table.workflowPath) } else { - assert.Error(t, err, table.errorMessage) + assert.ErrorContains(t, err, table.errorMessage) } } } diff --git a/actions/testdata/buildfail-action/Dockerfile b/actions/testdata/buildfail-action/Dockerfile new file mode 100644 index 0000000..3a4b7b1 --- /dev/null +++ b/actions/testdata/buildfail-action/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine:3.8 +COPY foobar /foo/bar \ No newline at end of file diff --git a/actions/testdata/buildfail.workflow b/actions/testdata/buildfail.workflow new file mode 100644 index 0000000..51eae00 --- /dev/null +++ b/actions/testdata/buildfail.workflow @@ -0,0 +1,8 @@ +workflow "test" { + on = "push" + resolves = ["test-action"] +} + +action "test-action" { + uses = "./buildfail-action" +} \ No newline at end of file