Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #73 from suzuki-shunsuke/test/add-test
Browse files Browse the repository at this point in the history
test: add examples of configuration
  • Loading branch information
suzuki-shunsuke authored Oct 14, 2020
2 parents 4d24b6f + 071a4ce commit c059e0b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
7 changes: 7 additions & 0 deletions examples/fail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
phases:
- name: main
tasks:
- name: fail
command:
command: "false"
26 changes: 16 additions & 10 deletions examples/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,31 @@ func TestBuildflow(t *testing.T) {
{
title: "hello world",
file: "hello_world.yaml",
exp: icmd.Expected{
ExitCode: 0,
Err: "",
},
},
{
title: "run tasks in parallel",
file: "parallel.yaml",
exp: icmd.Expected{
ExitCode: 0,
Err: "",
},
},
{
title: "the task bar depends on the task foo",
file: "task_dependency.yaml",
},
{
title: "task.when is true",
file: "task_when_true.yaml",
},
{
title: "buildflow run fails as expected",
file: "fail.yaml",
exp: icmd.Expected{
ExitCode: 1,
},
},
{
title: "if there are unknown fields in configuration file, buildflow run fails",
file: "unknown_field.yaml",
exp: icmd.Expected{
ExitCode: 0,
Err: "",
ExitCode: 1,
},
},
}
Expand Down
8 changes: 8 additions & 0 deletions examples/task_when_true.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
phases:
- name: main
tasks:
- name: "when true"
command:
command: ":"
when: true
7 changes: 7 additions & 0 deletions examples/unknown_field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
phases:
- name: main
tsks: # typo
- name: hello
command:
command: echo hello

0 comments on commit c059e0b

Please sign in to comment.