Skip to content

Commit 75821d6

Browse files
committed
Prepare dedicated pytest for skopt
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 2557841 commit 75821d6

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

.github/workflows/test-python.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,23 @@ jobs:
2525

2626
- name: Run Python test
2727
run: make pytest
28+
29+
# The skopt service doesn't work appropriately with Python 3.11.
30+
# So, we need to run the test with Python 3.9.
31+
# TODO (tenzen-y): Once we stop to support skopt, we can remove this test.
32+
# REF: https://github.com/kubeflow/katib/issues/2280
33+
test-skopt:
34+
name: Test Skopt
35+
runs-on: ubuntu-22.04
36+
37+
steps:
38+
- name: Check out code
39+
uses: actions/checkout@v3
40+
41+
- name: Setup Python
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: 3.9
45+
46+
- name: Run Python test
47+
run: make pytest-skopt

Makefile

+11-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ update-boilerplate:
157157
prepare-pytest:
158158
pip install --prefer-binary -r test/unit/v1beta1/requirements.txt
159159
pip install --prefer-binary -r cmd/suggestion/hyperopt/v1beta1/requirements.txt
160-
pip install --prefer-binary -r cmd/suggestion/skopt/v1beta1/requirements.txt
161160
pip install --prefer-binary -r cmd/suggestion/optuna/v1beta1/requirements.txt
162161
pip install --prefer-binary -r cmd/suggestion/hyperband/v1beta1/requirements.txt
163162
pip install --prefer-binary -r cmd/suggestion/nas/enas/v1beta1/requirements.txt
@@ -176,6 +175,16 @@ ifeq ("$(wildcard $(TEST_TENSORFLOW_EVENT_FILE_PATH))", "")
176175
endif
177176

178177
pytest: prepare-pytest prepare-pytest-testdata
179-
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/suggestion
178+
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/suggestion --ignore=./test/unit/v1beta1/suggestion/test_skopt_service.py
180179
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/earlystopping
181180
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/metricscollector
181+
182+
# The skopt service doesn't work appropriately with Python 3.11.
183+
# So, we need to run the test with Python 3.9.
184+
# TODO (tenzen-y): Once we stop to support skopt, we can remove this test.
185+
# REF: https://github.com/kubeflow/katib/issues/2280
186+
pytest-skopt:
187+
pip install six
188+
pip install --prefer-binary -r test/unit/v1beta1/requirements.txt
189+
pip install --prefer-binary -r cmd/suggestion/skopt/v1beta1/requirements.txt
190+
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/suggestion/test_skopt_service.py

cmd/suggestion/skopt/v1beta1/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.11-slim
1+
FROM python:3.10-slim
22

33
ARG TARGETARCH
44
ENV TARGET_DIR /opt/katib

0 commit comments

Comments
 (0)