Skip to content

Commit

Permalink
🌱 Add option to preserve the VM used for testing (kairos-io#686)
Browse files Browse the repository at this point in the history
Fix kairos-io#685


Signed-off-by: Oz Tiram <oz@spectrocloud.com>
  • Loading branch information
oz123 authored Jan 19, 2023
1 parent eb64057 commit e378818
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var sshPort string
var machineID string = os.Getenv("MACHINE_ID")

var _ = AfterSuite(func() {
if os.Getenv("CREATE_VM") == "true" {
if os.Getenv("CREATE_VM") == "true" && os.Getenv("KEEP_VM") != "true" {
if Machine != nil {
Machine.Stop()
Machine.Clean()
Expand All @@ -45,6 +45,9 @@ var _ = AfterSuite(func() {
if !CurrentSpecReport().Failure.IsZero() {
gatherLogs()
}
if os.Getenv("CREATE_VM") == "true" && os.Getenv("KEEP_VM") == "true" {
fmt.Println("WARNING: Not cleaning", Machine.Config().StateDir)
}
})

func user() string {
Expand Down

0 comments on commit e378818

Please sign in to comment.