Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions recovery_scope_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"fmt"
"os"
"testing"

"github.com/codefly-dev/core/runners/dockerrun"
)

// Source validation launches this suite below the Go runner. Fixture
// containers belong to this test process, not its inherited CLI scope.
func TestMain(m *testing.M) {
code := func() int {
dir, err := os.MkdirTemp("", "service-mssql-test-scope-*")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
}
defer os.RemoveAll(dir)
scope, err := dockerrun.NewContainerRecoveryScope(dir, dir, "service-mssql-tests")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
}
if err := dockerrun.SetContainerRecoveryScope(scope); err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
}
return m.Run()
}()
os.Exit(code)
}
Loading