This commit is contained in:
@ -34,7 +34,12 @@ print_test_result() {
|
||||
}
|
||||
|
||||
# Function to cleanup test artifacts
|
||||
CLEANED=0
|
||||
cleanup() {
|
||||
if [ "$CLEANED" -eq 1 ]; then
|
||||
return
|
||||
fi
|
||||
CLEANED=1
|
||||
echo -e "\n${YELLOW}Cleaning up test artifacts...${NC}"
|
||||
|
||||
# Remove local test directories
|
||||
@ -43,9 +48,10 @@ cleanup() {
|
||||
rm -rf ~/.local/bin/getpkg/"${TEST_TOOL_NAME}" 2>/dev/null || true
|
||||
|
||||
# Remove test tool from bashrc_getpkg if it exists
|
||||
if [ -f ~/.bashrc_getpkg ]; then
|
||||
sed -i "/${TEST_TOOL_NAME}/d" ~/.bashrc_getpkg 2>/dev/null || true
|
||||
fi
|
||||
# if [ -f ~/.bashrc_getpkg ]; then
|
||||
# sed -i "/${TEST_TOOL_NAME}/d" ~/.bashrc_getpkg 2>/dev/null || true
|
||||
# fi
|
||||
$GETPKG uninstall "$TEST_TOOL_NAME" 2>/dev/null || true
|
||||
|
||||
# Clean up from getpkg.xyz if we have write access
|
||||
if [ -n "${SOS_WRITE_TOKEN:-}" ]; then
|
||||
@ -334,6 +340,8 @@ else
|
||||
echo -e "\n${YELLOW}Skipping update all test (no tools installed)${NC}"
|
||||
fi
|
||||
|
||||
cleanup
|
||||
|
||||
# Print summary
|
||||
echo -e "\n${YELLOW}Test Summary:${NC}"
|
||||
echo -e "Tests passed: ${GREEN}${TESTS_PASSED}${NC}"
|
||||
@ -345,4 +353,5 @@ if [ "$TESTS_FAILED" -eq 0 ]; then
|
||||
else
|
||||
echo -e "\n${RED}Some tests failed!${NC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user