diff --git a/.github/workflows/pr-test.yaml b/.github/workflows/pr-test.yaml index 048da12..114d987 100644 --- a/.github/workflows/pr-test.yaml +++ b/.github/workflows/pr-test.yaml @@ -26,10 +26,17 @@ jobs: run: | ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@100.118.7.128 'bash -s' <<'EOF' #!/bin/bash - cd /home/brodey/scuda-latest + cd /home/brodey/scuda-latest ls + s server & + server_pid=$! + sleep 5 + + export SCUDA_SERVER=0.0.0.0 + s test && echo "Tests passed successfully!" || (echo "Tests failed. Exiting..."; exit 1) + EOF - name: Disconnect Tailscale diff --git a/local.sh b/local.sh index c474975..50802a7 100755 --- a/local.sh +++ b/local.sh @@ -73,6 +73,7 @@ test_cuda_available() { ansi_format "pass" "$pass_message" else ansi_format "fail" "CUDA is not available. Expected True but got [$output]." + return 1 fi } @@ -90,6 +91,7 @@ print('Tensor successfully moved to CUDA') ansi_format "pass" "$pass_message" else ansi_format "fail" "Tensor failed. Got [$output]." + return 1 fi } @@ -114,6 +116,7 @@ print('Tensor successfully moved back to CPU:') ansi_format "pass" "$pass_message" else ansi_format "fail" "Tensor failed. Got [$output]." + return 1 fi } @@ -124,6 +127,7 @@ test_vector_add() { ansi_format "pass" "$pass_message" else ansi_format "fail" "vector_add failed. Got [$output]." + return 1 fi } @@ -160,7 +164,10 @@ test() { func_name=$(eval "echo \${${test}[function]}") pass_message=$(eval "echo \${${test}[pass]}") - eval "$func_name \"$pass_message\"" + if ! eval "$func_name \"$pass_message\""; then + echo -e "\033[31mTest failed. Exiting...\033[0m" + exit 1 + fi done }