Skip to content

Commit

Permalink
ci: fix the path
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPietrusky committed Nov 18, 2024
1 parent 0393d84 commit 473f4f3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_restore_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
# Set up error handling
set -e

# Store the path to the script we want to test
SCRIPT_TO_TEST="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/src/restore_snapshot.sh"

# Ensure the script exists and is executable
if [ ! -f "$SCRIPT_TO_TEST" ]; then
echo "Error: Script not found at $SCRIPT_TO_TEST"
exit 1
fi
chmod +x "$SCRIPT_TO_TEST"

# Create test directory
TEST_DIR=$(mktemp -d)
cd "$TEST_DIR"
Expand Down Expand Up @@ -36,7 +46,8 @@ export PATH="$TEST_DIR:$PATH"

# Run the actual restore_snapshot script
echo "Testing snapshot restoration..."
../src/restore_snapshot.sh
echo "Script location: $SCRIPT_TO_TEST"
"$SCRIPT_TO_TEST"

# Verify the script executed successfully
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit 473f4f3

Please sign in to comment.