Skip to content

Commit

Permalink
Set gomega Eventually timeout to reduce timing issues in tests
Browse files Browse the repository at this point in the history
- fix setup in summarize unit tests by adding stacks

Signed-off-by: Ryan Moran <[email protected]>
  • Loading branch information
ForestEckhardt authored and Ryan Moran committed May 7, 2020
1 parent c376492 commit 1790e3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cargo/jam/internal/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions cargo/jam/internal/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cargo/jam/summarize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 1790e3b

Please sign in to comment.