v2 tests fix (#1956)

* v2 tests fix
* test: added tests for sqlite
This commit is contained in:
Alexandr Stelnykovych
2025-08-07 02:04:38 +03:00
committed by GitHub
parent 5609594b2a
commit 58f4058633
15 changed files with 347 additions and 447 deletions

View File

@@ -41,15 +41,24 @@ func (stub *testInstance) SPNGroup() *mgr.ExtendedGroup {
func (stub *testInstance) Stopping() bool {
return false
}
func (stub *testInstance) SetCmdLineOperation(f func() error) {}
func (stub *testInstance) DataDir() string {
return _dataDir
}
var _dataDir string
func runTest(m *testing.M) error {
conf.EnablePublicHub(true) // Make hub config available.
ds, err := config.InitializeUnitTestDataroot("test-crew")
var err error
// Create a temporary directory for the data
_dataDir, err = os.MkdirTemp("", "")
if err != nil {
return fmt.Errorf("failed to initialize dataroot: %w", err)
}
defer func() { _ = os.RemoveAll(ds) }()
defer func() { _ = os.RemoveAll(_dataDir) }()
instance := &testInstance{}
// Init