From 84c949da1322d5847713057b201b39da42b317bf Mon Sep 17 00:00:00 2001 From: Thomas Mitchell Date: Fri, 7 Jul 2017 10:10:13 -0400 Subject: [PATCH] added test to verify issue 169 is also fixed --- assets/cartesian-product/can-be-grabbed.yml | 17 ++++++++++++++ cmd/spruce/main_test.go | 26 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 assets/cartesian-product/can-be-grabbed.yml diff --git a/assets/cartesian-product/can-be-grabbed.yml b/assets/cartesian-product/can-be-grabbed.yml new file mode 100644 index 00000000..2f2f3d77 --- /dev/null +++ b/assets/cartesian-product/can-be-grabbed.yml @@ -0,0 +1,17 @@ +meta: + fast-tests: + - isolation + slow-tests: + - integration + master-fast-tests: + (( cartesian-product "master-" meta.fast-tests "-tests" )) + master-slow-tests: + - (( concat "master-" meta.slow-tests.0 "-tests" )) + +groups: +- name: master + jobs: (( grab + meta.master-fast-tests + meta.master-slow-tests + "master-dependencies-test" + "master-docker-build" )) diff --git a/cmd/spruce/main_test.go b/cmd/spruce/main_test.go index f67da4f4..c7705ae3 100644 --- a/cmd/spruce/main_test.go +++ b/cmd/spruce/main_test.go @@ -1606,6 +1606,32 @@ ips_with_port: - 2.2.3.4:80 join_ips_with_port: 1.2.3.4:80,2.2.3.4:80 +`) + }) + + Convey("Issue #169 - Cartesian Product should produce a []interface{}", func() { + os.Args = []string{"spruce", "merge", "../../assets/cartesian-product/can-be-grabbed.yml"} + stdout = "" + stderr = "" + main() + So(stderr, ShouldEqual, "") + So(stdout, ShouldEqual, `groups: +- jobs: + - master-isolation-tests + - master-integration-tests + - master-dependencies-test + - master-docker-build + name: master +meta: + fast-tests: + - isolation + master-fast-tests: + - master-isolation-tests + master-slow-tests: + - master-integration-tests + slow-tests: + - integration + `) }) })