Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corverroos committed May 31, 2022
1 parent ff1a732 commit b8b73ff
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions testutil/compose/compose/smoke_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"context"
"flag"
"os"
"os/exec"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -28,6 +27,7 @@ import (
)

//go:generate go test . -run=TestSmoke -integration -v

var integration = flag.Bool("integration", false, "Enable docker based integration test")

func TestSmoke(t *testing.T) {
Expand Down Expand Up @@ -116,8 +116,6 @@ func TestSmoke(t *testing.T) {
dir, err := os.MkdirTemp("", "")
require.NoError(t, err)

exet(t, dir, "ls", "-la")
exet(t, dir, "pwd")
conf := compose.NewDefaultConfig()
if test.ConfigFunc != nil {
test.ConfigFunc(&conf)
Expand All @@ -129,9 +127,6 @@ func TestSmoke(t *testing.T) {
if test.TmplFunc != nil {
test.TmplFunc(data)
}

exet(t, dir, "ls", "-la")
exet(t, dir, "ls", "-la", "node0")
})
require.NoError(t, cmd.Flags().Set("compose-dir", dir))
require.NoError(t, cmd.Flags().Set("alert-timeout", "30s"))
Expand All @@ -143,17 +138,3 @@ func TestSmoke(t *testing.T) {
})
}
}

// TestFlagFalse ensures the integration flag default value is false.
func TestFlagFalse(t *testing.T) {
require.False(t, *integration)
}

func exet(t *testing.T, dir string, cmd string, args ...string) {
t.Helper()
c := exec.Command(cmd, args...)
c.Dir = dir
out, err := c.CombinedOutput()
require.NoError(t, err)
t.Logf("%s: %s %s: %s", dir, cmd, args, out)
}

0 comments on commit b8b73ff

Please sign in to comment.