aides-repo-api/tests/integration/utils.go
Maxim Slipenko e4f9743dea
Some checks failed
Format and Lint / format-check (push) Failing after 2s
Format and Lint / test (push) Successful in 52s
chore: change code.alt-gnome to code.aides.space
2025-01-07 17:54:16 +03:00

28 lines
603 B
Go

package integration
import (
"testing"
"github.com/stretchr/testify/assert"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"code.aides.space/aides-infra/aides-repo-api/internal/config"
"code.aides.space/aides-infra/aides-repo-api/internal/models"
)
func prepareDb(t *testing.T) *gorm.DB {
db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
assert.NoError(t, err)
err = db.AutoMigrate(&models.Task{}, &models.GitRepoAltRepoTask{}, &models.RPMFile{})
assert.NoError(t, err)
return db
}
func prepareConfig() *config.Config {
return &config.Config{
UploadDir: "./test_uploads",
}
}