Skip to content

Commit 52bcc2d

Browse files
committed
[PLUTO-1412] test init
1 parent c983220 commit 52bcc2d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

integration-tests/run.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#!/bin/bash
22
set -e
33

4+
# Get the absolute path of the script's directory
5+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
46
CLI_PATH="$(pwd)/cli-v2"
57

8+
echo "Script directory: $SCRIPT_DIR"
9+
echo "Current working directory: $(pwd)"
10+
611
# Check if API token is provided for token-based test
712
if [ -z "$CODACY_API_TOKEN" ]; then
813
echo "Warning: CODACY_API_TOKEN environment variable is not set. Token-based test will be skipped."
@@ -56,7 +61,17 @@ run_init_test() {
5661
local use_token="$3"
5762

5863
echo "Running test: $test_name"
64+
echo "Test directory: $test_dir"
65+
66+
# Check if test directory exists
67+
if [ ! -d "$test_dir" ]; then
68+
echo "❌ Test directory does not exist: $test_dir"
69+
ls -la "$(dirname "$test_dir")"
70+
exit 1
71+
fi
72+
5973
cd "$test_dir" || exit 1
74+
echo "Changed to directory: $(pwd)"
6075

6176
# Clean up any existing .codacy directory
6277
rm -rf .codacy
@@ -84,10 +99,10 @@ echo "Starting integration tests..."
8499
echo "----------------------------------------"
85100

86101
# Test 1: Init without token
87-
run_init_test "integration-tests/init-without-token" "init-without-token" "false"
102+
run_init_test "$SCRIPT_DIR/init-without-token" "init-without-token" "false"
88103

89104
# Test 2: Init with token
90-
run_init_test "integration-tests/init-with-token" "init-with-token" "true"
105+
run_init_test "$SCRIPT_DIR/init-with-token" "init-with-token" "true"
91106

92107
echo "All tests completed successfully! 🎉"
93108

0 commit comments

Comments
 (0)