From 57650201d4d0a436379c562313186982cc2ca25c Mon Sep 17 00:00:00 2001 From: Jesus Date: Wed, 5 Mar 2025 15:52:14 +0100 Subject: [PATCH 1/2] fix bug testadj --- backend/cmd/main.go | 10 ---------- backend/internal/adj/adj.go | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) 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..36abe785b 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 + 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 From 531cb7a1613667a777bb43e800daa836239d552f Mon Sep 17 00:00:00 2001 From: Jesus Date: Wed, 5 Mar 2025 16:03:07 +0100 Subject: [PATCH 2/2] fix adj bug --- backend/internal/adj/adj.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/adj/adj.go b/backend/internal/adj/adj.go index 36abe785b..d3969980c 100644 --- a/backend/internal/adj/adj.go +++ b/backend/internal/adj/adj.go @@ -73,7 +73,7 @@ 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 + //Execute the script testadj.py (fix bug) test := exec.Command("python3", "testadj.py") out, err := test.CombinedOutput() if err != nil || len(out) != 0 {