Skip to content

Commit

Permalink
chore: assert on test output
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeynewman committed Nov 11, 2024
1 parent 8bd49fb commit ee7f8f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ jobs:
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa [email protected] '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
Expand Down
9 changes: 8 additions & 1 deletion local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand All @@ -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
}

Expand All @@ -124,6 +127,7 @@ test_vector_add() {
ansi_format "pass" "$pass_message"
else
ansi_format "fail" "vector_add failed. Got [$output]."
return 1
fi
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit ee7f8f7

Please sign in to comment.