Skip to content

Commit

Permalink
refactor: clean up vendor directory after test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Jul 14, 2023
1 parent 32d0f60 commit 7fc89a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/commands/test_tile_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ import (
)

var _ = Describe("test", func() {
AfterSuite(func() {
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
vendorDir := filepath.Join(filepath.Dir(filepath.Dir(wd)), "vendor")
if info, err := os.Stat(vendorDir); err == nil && info.IsDir() { // no error
_ = os.RemoveAll(vendorDir)
}
})
Context("all tests succeed", func() {
It("succeeds", func() {
var testOutput bytes.Buffer
Expand Down
10 changes: 10 additions & 0 deletions internal/commands/test_tile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ var _ = Describe("kiln test docker", func() {
helloTileDirectorySegments = []string{"testdata", "test_tile", "hello-tile"}
Expect(goVendor(filepath.Join(helloTileDirectorySegments...))).NotTo(HaveOccurred())
})
AfterSuite(func() {
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
vendorDir := filepath.Join(filepath.Dir(filepath.Dir(wd)), "vendor")
if info, err := os.Stat(vendorDir); err == nil && info.IsDir() { // no error
_ = os.RemoveAll(vendorDir)
}
})

Context("locally missing docker image is built", func() {
var (
Expand Down

0 comments on commit 7fc89a6

Please sign in to comment.