1212def is_local_server_running ():
1313 """Check if local TerminusDB server is running at http://127.0.0.1:6363"""
1414 try :
15- response = requests .get ("http://127.0.0.1:6363" , timeout = 2 )
16- # Server responds with 200 (success) or 404 (not found but server is up)
17- # 401 (unauthorized) also indicates server is running but needs auth
18- return response .status_code in [200 , 404 ]
15+ response = requests .get ("http://127.0.0.1:6363/api/ok" , timeout = 2 )
16+ return response .status_code == 200
1917 except (requests .exceptions .ConnectionError , requests .exceptions .Timeout ):
2018 return False
2119
2220
2321def is_docker_server_running ():
24- """Check if Docker TerminusDB server is already running at http://127.0.0.1:6366 """
22+ """Check if Docker TerminusDB server is already running at http://127.0.0.1:6363 """
2523 try :
26- response = requests .get ("http://127.0.0.1:6366" , timeout = 2 )
27- # Server responds with 404 for root path, which means it's running
28- return response .status_code in [200 , 404 ]
24+ response = requests .get ("http://127.0.0.1:6363/api/ok" , timeout = 2 )
25+ return response .status_code == 200
2926 except (requests .exceptions .ConnectionError , requests .exceptions .Timeout ):
3027 return False
3128
@@ -143,33 +140,19 @@ def docker_url_jwt(pytestconfig):
143140def docker_url (pytestconfig ):
144141 """
145142 Provides a TerminusDB server URL for integration tests.
146- Prefers local test server if running, otherwise starts Docker container.
147-
148- NOTE: This fixture returns just the URL. Tests expect AUTOLOGIN mode (no authentication).
149- If using local server with authentication, use TERMINUSDB_AUTOLOGIN=true when starting it.
143+ Uses port 6363 with admin:root authentication by default.
144+ Prefers an already-running server, otherwise starts a Docker container.
150145 """
151- # Check if local test server is already running (port 6363)
146+ # Check if a server is already running (port 6363)
152147 if is_local_server_running ():
153148 print (
154- "\n ✓ Using existing local TerminusDB test server at http://127.0.0.1:6363"
155- )
156- print (
157- "⚠️ WARNING: Local server should be started with TERMINUSDB_AUTOLOGIN=true"
158- )
159- print (
160- " Or use: TERMINUSDB_SERVER_AUTOLOGIN=true ./tests/terminusdb-test-server.sh restart"
149+ "\n ✓ Using existing TerminusDB server at http://127.0.0.1:6363"
161150 )
162151 yield "http://127.0.0.1:6363"
163152 return # Don't clean up - server was already running
164153
165- # Check if Docker container is already running (port 6366)
166- if is_docker_server_running ():
167- print ("\n ✓ Using existing Docker TerminusDB server at http://127.0.0.1:6366" )
168- yield "http://127.0.0.1:6366"
169- return # Don't clean up - server was already running
170-
171154 # No server found, start Docker container
172- print ("\n ⚠ No server found, starting Docker container with AUTOLOGIN ..." )
155+ print ("\n ⚠ No server found, starting Docker container..." )
173156 pytestconfig .getoption ("docker_compose" )
174157 output = subprocess .run (
175158 [
@@ -185,7 +168,7 @@ def docker_url(pytestconfig):
185168 if output .returncode != 0 :
186169 raise RuntimeError (output .stderr )
187170
188- test_url = "http://127.0.0.1:6366 "
171+ test_url = "http://127.0.0.1:6363 "
189172 is_server_started = False
190173
191174 seconds_waited = 0
0 commit comments