From 1790e3b279bbfb75d2bc38ed491bf57b5ccf9d61 Mon Sep 17 00:00:00 2001 From: Forest Eckhardt Date: Thu, 7 May 2020 10:48:46 -0400 Subject: [PATCH] Set gomega Eventually timeout to reduce timing issues in tests - fix setup in summarize unit tests by adding stacks Signed-off-by: Ryan Moran --- cargo/jam/internal/formatter.go | 4 ++-- cargo/jam/internal/init_test.go | 4 ++++ cargo/jam/summarize_test.go | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cargo/jam/internal/formatter.go b/cargo/jam/internal/formatter.go index f9b928bd..7ec03a4d 100644 --- a/cargo/jam/internal/formatter.go +++ b/cargo/jam/internal/formatter.go @@ -84,9 +84,9 @@ func (f Formatter) Markdown(dependencies []cargo.ConfigMetadataDependency, defau fmt.Fprintln(f.writer) } - sort.Strings(stacks) - if len(stacks) > 0 { + sort.Strings(stacks) + fmt.Fprintf(f.writer, "Supported stacks:\n| name |\n|-|\n") for _, s := range stacks { fmt.Fprintf(f.writer, "| %s |\n", s) diff --git a/cargo/jam/internal/init_test.go b/cargo/jam/internal/init_test.go index a55953a4..327cf62c 100644 --- a/cargo/jam/internal/init_test.go +++ b/cargo/jam/internal/init_test.go @@ -2,12 +2,16 @@ package internal_test import ( "testing" + "time" + "github.com/onsi/gomega" "github.com/sclevine/spec" "github.com/sclevine/spec/report" ) func TestUnitCargo(t *testing.T) { + gomega.SetDefaultEventuallyTimeout(10 * time.Second) + suite := spec.New("cargo/jam/internal", spec.Report(report.Terminal{})) suite("BuildpackInspector", testBuildpackInspector) suite("Formatter", testFormatter) diff --git a/cargo/jam/summarize_test.go b/cargo/jam/summarize_test.go index 14d74ddc..db36c68b 100644 --- a/cargo/jam/summarize_test.go +++ b/cargo/jam/summarize_test.go @@ -49,6 +49,12 @@ other-dependency = "2.3.x" id = "other-dependency" stacks = ["other-stack"] version = "2.3.4" + +[[stacks]] + id = "some-stack" + +[[stacks]] + id = "other-stack" `) err = tw.WriteHeader(&tar.Header{