Skip to content

Commit 4482a2c

Browse files
committed
req changes
1 parent 8de78af commit 4482a2c

3 files changed

Lines changed: 9 additions & 31 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -101,32 +101,11 @@ jobs:
101101
echo "BEFORE=$git_status" >> $GITHUB_ENV
102102
echo "Repository status before tests: $git_status"
103103
104-
# - name: Configure Host Network
105-
# if: matrix.os == 'ubuntu-latest'
106-
# run: |
107-
# # Map 'nginx' to localhost so the Host machine can resolve the URLs in the database
108-
# echo "127.0.0.1 nginx" | sudo tee -a /etc/hosts
109-
110104
- name: Clone Services & Apply Universal Patch
111105
if: matrix.os == 'ubuntu-latest'
112106
run: |
113107
git clone --depth 1 https://github.com/openml/services.git
114108
cd services
115-
git config user.email "ci@openml.org"
116-
git config user.name "CI"
117-
git fetch origin pull/13/head:pr-13 && git merge pr-13 --no-edit
118-
git fetch origin pull/15/head:pr-15 && git merge pr-15 --no-edit
119-
120-
# # === PATCH 1: Use 'nginx' hostname ===
121-
# # This works inside Docker (DNS) and on Host (via /etc/hosts hack above)
122-
# sed -i 's/localhost:8000/nginx:8000/g' config/database/update.sh
123-
124-
# # === PATCH 2: Fix Path Mismatch ===
125-
# # Ensure we use /data/ which Nginx recognizes
126-
# sed -i 's|/minio/|/data/|g' config/database/update.sh
127-
128-
# echo "=== Patched Update Script ==="
129-
# cat config/database/update.sh | grep "nginx"
130109
131110
- name: Show installed dependencies
132111
run: python -m pip list
@@ -141,9 +120,9 @@ jobs:
141120
fi
142121
143122
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
144-
marks="sklearn and not production"
123+
marks="sklearn and not production_server"
145124
else
146-
marks="not production"
125+
marks="not production_server"
147126
fi
148127
149128
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"
@@ -152,15 +131,16 @@ jobs:
152131
if: matrix.os == 'ubuntu-latest'
153132
env:
154133
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
134+
OPENML_USE_LOCAL_SERVICES: "true"
155135
run: |
156136
if [ "${{ matrix.code-cov }}" = "true" ]; then
157137
codecov="--cov=openml --long --cov-report=xml"
158138
fi
159139
160140
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
161-
marks="sklearn and production"
141+
marks="sklearn and production_server"
162142
else
163-
marks="production"
143+
marks="production_server"
164144
fi
165145
166146
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"

openml/config.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010
import platform
1111
import shutil
12-
import sys
1312
import warnings
1413
from collections.abc import Iterator
1514
from contextlib import contextmanager
@@ -29,10 +28,7 @@
2928
OPENML_TEST_SERVER_ADMIN_KEY_ENV_VAR = "OPENML_TEST_SERVER_ADMIN_KEY"
3029
_TEST_SERVER_NORMAL_USER_KEY = "normaluser"
3130

32-
if sys.platform.startswith("win"):
33-
TEST_SERVER_URL = "http://localhost"
34-
else:
35-
TEST_SERVER_URL = "http://localhost:8000"
31+
TEST_SERVER_URL = "https://test.openml.org"
3632

3733

3834
class _Config(TypedDict):

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ def as_robot() -> Iterator[None]:
272272

273273
@pytest.fixture(autouse=True)
274274
def with_server(request):
275+
if os.getenv("OPENML_USE_LOCAL_SERVICES") == "true":
276+
openml.config.TEST_SERVER_URL = "http://localhost:8000"
275277
if "production_server" in request.keywords:
276278
openml.config.server = "https://www.openml.org/api/v1/xml"
277279
openml.config.apikey = None
@@ -295,8 +297,8 @@ def with_test_cache(test_files_directory, request):
295297
openml.config.set_root_cache_directory(_root_cache_directory)
296298
if tmp_cache.exists():
297299
shutil.rmtree(tmp_cache)
300+
298301

299-
300302
@pytest.fixture
301303
def static_cache_dir():
302304
return Path(__file__).parent / "files"

0 commit comments

Comments
 (0)