Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 907ba0c

Browse files
committed
Removed unit tests (using example context) that are in fact duplicates of e2e tests in test/e2e
Signed-off-by: Guillaume Tardif <[email protected]>
1 parent 2a8c24e commit 907ba0c

File tree

6 files changed

+0
-138
lines changed

6 files changed

+0
-138
lines changed

cli/cmd/inspect_test.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

cli/cmd/ps_test.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

cli/cmd/testdata/inspect-out-id.golden

Lines changed: 0 additions & 14 deletions
This file was deleted.

cli/cmd/testdata/ps-out-quiet.golden

Lines changed: 0 additions & 2 deletions
This file was deleted.

cli/cmd/testdata/ps-out.golden

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/framework/unit.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ import (
2020
"context"
2121
"io/ioutil"
2222
"os"
23-
"testing"
24-
25-
"gotest.tools/v3/assert"
26-
"gotest.tools/v3/assert/cmp"
27-
28-
apicontext "github.com/docker/compose-cli/api/context"
29-
"github.com/docker/compose-cli/api/context/store"
3023
)
3124

3225
// TestCLI is a helper struct for CLI tests.
@@ -36,33 +29,6 @@ type TestCLI struct {
3629
reader *os.File
3730
}
3831

39-
// NewTestCLI returns a CLI testing helper.
40-
func NewTestCLI(t *testing.T) *TestCLI {
41-
dir, err := ioutil.TempDir("", "store")
42-
assert.Check(t, cmp.Nil(err))
43-
44-
originalStdout := os.Stdout
45-
46-
t.Cleanup(func() {
47-
os.Stdout = originalStdout
48-
_ = os.RemoveAll(dir)
49-
})
50-
51-
s, err := store.New(dir)
52-
assert.Check(t, cmp.Nil(err))
53-
err = s.Create("example", "example", "", store.ContextMetadata{})
54-
assert.Check(t, cmp.Nil(err))
55-
56-
ctx := context.Background()
57-
ctx = store.WithContextStore(ctx, s)
58-
ctx = apicontext.WithCurrentContext(ctx, "example")
59-
60-
r, w, err := os.Pipe()
61-
os.Stdout = w
62-
assert.Check(t, cmp.Nil(err))
63-
return &TestCLI{ctx, w, r}
64-
}
65-
6632
// Context returns a configured context
6733
func (c *TestCLI) Context() context.Context {
6834
return c.ctx

0 commit comments

Comments
 (0)