diff --git a/backend/cmd/main.go b/backend/cmd/main.go index d5e4785fa..7894b09b2 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -12,7 +12,6 @@ import ( "net/http" _ "net/http/pprof" "os" - "os/exec" "os/signal" "path" "runtime" @@ -107,15 +106,6 @@ func main() { trace.Fatal().Err(err).Msg("setting up ADJ") } - if config.Adj.Test { - test := exec.Command("python3", "testadj.py") - out, err := test.CombinedOutput() - if err != nil || len(out) != 0 { - fmt.Printf("\nPython test failed:\nError: %v\nOutput: %s\n", err, string(out)) - os.Exit(1) - } - } - podData, err := pod_data.NewPodData(adj.Boards, adj.Info.Units) if err != nil { fmt.Println(err) diff --git a/backend/internal/adj/adj.go b/backend/internal/adj/adj.go index ddc627926..d3969980c 100644 --- a/backend/internal/adj/adj.go +++ b/backend/internal/adj/adj.go @@ -2,7 +2,9 @@ package adj import ( "encoding/json" + "log" "os" + "os/exec" "github.com/HyperloopUPV-H8/h9-backend/internal/utils" ) @@ -71,6 +73,13 @@ func downloadADJ(AdjBranch string) (json.RawMessage, json.RawMessage, error) { updateRepo(AdjBranch) // The BoardIds are applied in the NewADJ function by the getBoardIds function + //Execute the script testadj.py (fix bug) + test := exec.Command("python3", "testadj.py") + out, err := test.CombinedOutput() + if err != nil || len(out) != 0 { + log.Fatalf("python test failed:\nError: %v\nOutput: %s\n", err, string(out)) + } + info, err := os.ReadFile(RepoPath + "general_info.json") if err != nil { return nil, nil, err