Skip to content

Commit b58ea3b

Browse files
test(testutil): remove test using reaper (#692)
Remove redundant test case TestFakeCommandWithReaper. --- It appears there is some history with properly awaiting faked commands with the old shellcheck logic and using the reaper (see #247 and #281) but it appears this code has been removed. Looking at the rationale for removing shellcheck in #381, and not wanting FakeCommand to be reaper aware, this test likely should have been removed at that time. Additionally, this code does not appear to test anything unique compared to the exec.Command.Run() style test as written. Theoretically this test isn't hurting anything but the meta context here is that we would like to copy the testutil package over to [x-go](https://github.com/canonical/x-go/) and not have extra dependencies unless we really need it.
1 parent f490e65 commit b58ea3b

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

internals/testutil/exec_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import (
1818
"os/exec"
1919

2020
"gopkg.in/check.v1"
21-
22-
"github.com/canonical/pebble/internals/reaper"
2321
)
2422

2523
type fakeCommandSuite struct{}
@@ -45,23 +43,6 @@ func (s *fakeCommandSuite) TestFakeCommand(c *check.C) {
4543
})
4644
}
4745

48-
func (s *fakeCommandSuite) TestFakeCommandWithReaper(c *check.C) {
49-
err := reaper.Start()
50-
c.Assert(err, check.IsNil)
51-
defer func() {
52-
err := reaper.Stop()
53-
c.Assert(err, check.IsNil)
54-
}()
55-
56-
fake := FakeCommand(c, "cmd", "true")
57-
defer fake.Restore()
58-
59-
cmd := exec.Command("cmd", "")
60-
out, err := reaper.CommandCombinedOutput(cmd)
61-
c.Assert(err, check.IsNil)
62-
c.Assert(string(out), check.Equals, "")
63-
}
64-
6546
func (s *fakeCommandSuite) TestFakeCommandAlso(c *check.C) {
6647
fake := FakeCommand(c, "fst", "")
6748
also := fake.Also("snd", "")

0 commit comments

Comments
 (0)