Skip to content

Commit

Permalink
Make sure that TestConfigOverrideDetection cleans up after itself, for
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 27, 2018
1 parent cd9e4bb commit ee2d24e
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/ddevapp/config_test.go
Expand Up @@ -553,10 +553,10 @@ func TestConfigOverrideDetection(t *testing.T) {

testcommon.ClearDockerEnv()

testDir := testcommon.CreateTmpDir("TestConfigOverrideDetection")
testDir := testcommon.CreateTmpDir("TestConfigConfigOverrideDetection")

targetDdev := filepath.Join(testDir, ".ddev")
err := fileutil.CopyDir("testdata/.ddev", targetDdev)
err := fileutil.CopyDir("testdata/TestConfigOverrideDetection/.ddev", targetDdev)
assert.NoError(err)

// testcommon.Chdir()() and CleanupDir() checks their own errors (and exit)
Expand All @@ -569,6 +569,9 @@ func TestConfigOverrideDetection(t *testing.T) {
err = app.ReadConfig()
assert.NoError(err)

//nolint: errcheck
defer app.Down(true, false)

restoreOutput := util.CaptureUserOut()
startErr := app.Start()
out := restoreOutput()
Expand All @@ -591,6 +594,4 @@ func TestConfigOverrideDetection(t *testing.T) {
assert.NotContains(out, "nginx-site.conf")
}
assert.Contains(out, "Custom configuration takes effect")

_ = app.Down(true, false)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ee2d24e

Please sign in to comment.