Extract importer package and restructure tests

This commit is contained in:
2023-04-28 08:49:58 +02:00
parent c090b18628
commit ebba4371eb
19 changed files with 605 additions and 554 deletions

View File

@@ -29,6 +29,7 @@ import (
"github.com/ClusterCockpit/cc-backend/internal/config"
"github.com/ClusterCockpit/cc-backend/internal/graph"
"github.com/ClusterCockpit/cc-backend/internal/graph/generated"
"github.com/ClusterCockpit/cc-backend/internal/importer"
"github.com/ClusterCockpit/cc-backend/internal/metricdata"
"github.com/ClusterCockpit/cc-backend/internal/repository"
"github.com/ClusterCockpit/cc-backend/internal/routerConfig"
@@ -199,13 +200,13 @@ func main() {
}
if flagReinitDB {
if err := repository.InitDB(); err != nil {
if err := importer.InitDB(); err != nil {
log.Fatalf("failed to re-initialize repository DB: %s", err.Error())
}
}
if flagImportJob != "" {
if err := repository.HandleImportFlag(flagImportJob); err != nil {
if err := importer.HandleImportFlag(flagImportJob); err != nil {
log.Fatalf("job import failed: %s", err.Error())
}
}