Skip to content

Commit 5935957

Browse files
committed
fix: modified test file according to CI configurations
1 parent 8567fa8 commit 5935957

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎tests/test_repo.sh‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
# Determine the script's directory and devstack root
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
DEVSTACK_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
6+
37
TEST_WORKSPACE="/tmp/devstack_test_$$"
48
mkdir -p "$TEST_WORKSPACE"
59

@@ -57,7 +61,7 @@ TOTAL_TESTS=$((TOTAL_TESTS + 1))
5761
cd "$TEST_WORKSPACE"
5862
create_test_repo "frontend-app-gradebook" "https://github.com/edx/frontend-app-gradebook.git"
5963
show_remotes "frontend-app-gradebook" "BEFORE"
60-
cd /workspaces/devstack
64+
cd "$DEVSTACK_ROOT"
6165
echo " Output:"
6266
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
6367
cd "$TEST_WORKSPACE"
@@ -75,7 +79,7 @@ echo "TEST 2: EDX Origin Repository (edx-platform)"
7579
TOTAL_TESTS=$((TOTAL_TESTS + 1))
7680
create_test_repo "edx-platform" "https://github.com/edx/edx-platform.git"
7781
show_remotes "edx-platform" "BEFORE"
78-
cd /workspaces/devstack
82+
cd "$DEVSTACK_ROOT"
7983
echo " Output:"
8084
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
8185
cd "$TEST_WORKSPACE"
@@ -93,7 +97,7 @@ echo "TEST 3: OpenEDX Origin Repository (course-discovery)"
9397
TOTAL_TESTS=$((TOTAL_TESTS + 1))
9498
create_test_repo "course-discovery" "https://github.com/openedx/course-discovery.git"
9599
show_remotes "course-discovery" "BEFORE"
96-
cd /workspaces/devstack
100+
cd "$DEVSTACK_ROOT"
97101
echo " Output:"
98102
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
99103
cd "$TEST_WORKSPACE"
@@ -112,7 +116,7 @@ echo "TEST 4: Personal Fork Error"
112116
TOTAL_TESTS=$((TOTAL_TESTS + 1))
113117
create_test_repo "credentials" "https://github.com/personaluser/credentials.git"
114118
show_remotes "credentials" "BEFORE"
115-
cd /workspaces/devstack
119+
cd "$DEVSTACK_ROOT"
116120
echo " Output:"
117121
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
118122
cd "$TEST_WORKSPACE"
@@ -130,7 +134,7 @@ echo "TEST 5: Non-Forked Repository"
130134
TOTAL_TESTS=$((TOTAL_TESTS + 1))
131135
create_test_repo "unknown-repo" "https://github.com/edx/unknown-repo.git"
132136
show_remotes "unknown-repo" "BEFORE"
133-
cd /workspaces/devstack
137+
cd "$DEVSTACK_ROOT"
134138
echo " Output:"
135139
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
136140
cd "$TEST_WORKSPACE"
@@ -148,12 +152,12 @@ echo "TEST 6: Idempotent Operations"
148152
TOTAL_TESTS=$((TOTAL_TESTS + 1))
149153
create_test_repo "frontend-app-gradebook" "https://github.com/edx/frontend-app-gradebook.git"
150154
show_remotes "frontend-app-gradebook" "BEFORE (fresh repo)"
151-
cd /workspaces/devstack
155+
cd "$DEVSTACK_ROOT"
152156
echo " First run output:"
153157
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
154158
cd "$TEST_WORKSPACE"
155159
show_remotes "frontend-app-gradebook" "AFTER FIRST RUN"
156-
cd /workspaces/devstack
160+
cd "$DEVSTACK_ROOT"
157161
echo " Second run output (should be idempotent):"
158162
DEVSTACK_WORKSPACE="$TEST_WORKSPACE" make dev.setup-remotes
159163
cd "$TEST_WORKSPACE"
@@ -169,7 +173,7 @@ cd ..
169173
echo
170174
echo "TEST 7: Make Integration"
171175
TOTAL_TESTS=$((TOTAL_TESTS + 1))
172-
cd /workspaces/devstack
176+
cd "$DEVSTACK_ROOT"
173177
if make -n dev.setup-remotes >/dev/null 2>&1 && make help | grep -q "dev.setup-remotes"; then
174178
print_pass "Make command integration"
175179
else

0 commit comments

Comments
 (0)