Skip to content

Commit

Permalink
Don't rerun short tests when running long tests (pulumi#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Feb 7, 2019
1 parent b30065e commit c9eeda3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestExamples(t *testing.T) {
Overrides: overrides,
}

examples := []integration.ProgramTestOptions{
shortTests := []integration.ProgramTestOptions{
base.With(integration.ProgramTestOptions{
Dir: path.Join(cwd, "..", "..", "aws-js-s3-folder"),
Config: map[string]string{
Expand Down Expand Up @@ -230,7 +230,7 @@ func TestExamples(t *testing.T) {
// }),
}

longExamples := []integration.ProgramTestOptions{
longTests := []integration.ProgramTestOptions{
base.With(integration.ProgramTestOptions{
Dir: path.Join(cwd, "..", "..", "azure-ts-aks-helm"),
Config: map[string]string{
Expand Down Expand Up @@ -258,15 +258,17 @@ func TestExamples(t *testing.T) {
// }),
}

// Only include the long examples on non-Short test runs
if !testing.Short() {
fmt.Println("Running full test suite including longer tests. To run only shorter tests run with the -short option.")
examples = append(examples, longExamples...)
// Run the short or long tests depending on the config. Note that we only run long tests on
// travis after already running short tests. So no need to actually run both at the same time
// ever.
var tests []integration.ProgramTestOptions
if testing.Short() {
tests = shortTests
} else {
fmt.Println("Running short test suite. To run full test suite run without -short option")
tests = longTests
}

for _, ex := range examples {
for _, ex := range tests {
example := ex
t.Run(example.Dir, func(t *testing.T) {
integration.ProgramTest(t, &example)
Expand Down

0 comments on commit c9eeda3

Please sign in to comment.