Skip to content

Commit 22d8de0

Browse files
authored
Fix version of lightgbm to be <4.0.0 (#457)
1 parent 2bf8ce7 commit 22d8de0

File tree

5 files changed

+60
-25
lines changed

5 files changed

+60
-25
lines changed

.github/workflows/run-unittests-py38-cov-report.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
test-path: ["tests/unitary/with_extras tests/unitary/default_setup", "tests/unitary/with_extras/model"]
35+
name: ["unitary", "slow_tests"]
3636
include:
37-
- test-path: "tests/unitary/with_extras tests/unitary/default_setup"
38-
ignore-path: "--ignore tests/unitary/with_extras/model --ignore tests/unitary/with_extras/feature_store"
39-
name: "unitary"
40-
- test-path: "tests/unitary/with_extras/model"
41-
name: "model"
37+
- name: "unitary"
38+
test-path: "tests/unitary"
39+
# `model` tests running in "slow_tests",
40+
# `feature_store` tests has its own test suite
41+
ignore-path: |
42+
--ignore tests/unitary/with_extras/model \
43+
--ignore tests/unitary/with_extras/feature_store \
44+
--ignore tests/unitary/with_extras/hpo
45+
- name: "slow_tests"
46+
test-path: "tests/unitary/with_extras/model"
4247

4348
steps:
4449
- uses: actions/checkout@v3
@@ -68,7 +73,7 @@ jobs:
6873
pip install -e ".[forecast]"
6974
7075
- name: "Run unitary tests folder with maximum ADS dependencies"
71-
timeout-minutes: 60
76+
timeout-minutes: 40
7277
shell: bash
7378
env:
7479
CONDA_PREFIX: /usr/share/miniconda
@@ -82,9 +87,17 @@ jobs:
8287
ln -s ../ads ads
8388
ln -s ../.coveragerc .coveragerc
8489
90+
# Run hpo tests, which hangs if run together with all unitary tests
91+
if [[ ${{ matrix.name }} == "unitary" ]]; then
92+
python -m pytest -v -p no:warnings -n auto --dist loadfile \
93+
--cov-append --cov=ads --cov-report=xml --cov-report=html \
94+
tests/unitary/with_extras/hpo
95+
fi
96+
8597
# Run tests
8698
python -m pytest -v -p no:warnings --durations=5 \
87-
-n auto --dist loadfile --cov=ads --cov-report=xml --cov-report=html \
99+
-n auto --dist loadfile \
100+
--cov-append --cov=ads --cov-report=xml --cov-report=html \
88101
${{ matrix.test-path }} ${{ matrix.ignore-path }}
89102
90103
- name: "Save coverage files"
@@ -123,11 +136,11 @@ jobs:
123136
# Prepare file paths to .coverage files
124137
# Filenames taken from job.test last step with name - "Save coverage files"
125138
FILE_UNITARY="cov-reports-unitary/.coverage"; [[ ! -f $FILE_UNITARY ]] && FILE_UNITARY=""
126-
FILE_MODEL="cov-reports-model/.coverage"; [[ ! -f $FILE_MODEL ]] && FILE_MODEL=""
139+
FILE_SLOW="cov-reports-slow_tests/.coverage"; [[ ! -f $FILE_SLOW ]] && FILE_SLOW=""
127140
128141
# Combine coverage files
129142
pip install coverage
130-
coverage combine $FILE_UNITARY $FILE_MODEL
143+
coverage combine $FILE_UNITARY $FILE_SLOW
131144
132145
# Make html report
133146
coverage html
@@ -151,7 +164,7 @@ jobs:
151164
# Prepare file paths to coverage xml files
152165
# Filenames taken from job.test last step with name - "Save coverage files"
153166
FILE1="cov-reports-unitary/coverage.xml"; [[ ! -f $FILE1 ]] && FILE1=""
154-
FILE2="cov-reports-model/coverage.xml"; [[ ! -f $FILE2 ]] && FILE2=""
167+
FILE2="cov-reports-slow_tests/coverage.xml"; [[ ! -f $FILE2 ]] && FILE2=""
155168
echo "FILE1=$FILE1" >> $GITHUB_ENV
156169
echo "FILE2=$FILE2" >> $GITHUB_ENV
157170

.github/workflows/run-unittests-py39-py310.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,21 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
python-version: ["3.9", "3.10"]
36-
test-path: ["tests/unitary/with_extras tests/unitary/default_setup", "tests/unitary/with_extras/model"]
36+
name: ["unitary", "slow_tests"]
3737
include:
38-
- test-path: "tests/unitary/with_extras tests/unitary/default_setup"
39-
ignore-path: "--ignore tests/unitary/with_extras/model --ignore tests/unitary/with_extras/feature_store --ignore tests/unitary/with_extras/operator/forecast"
40-
name: "unitary"
41-
- test-path: "tests/unitary/with_extras/model"
42-
name: "model"
38+
- name: "unitary"
39+
test-path: "tests/unitary"
40+
# `model` tests running in "slow_tests",
41+
# `feature_store` tests has its own test suite
42+
# `forecast` tests not supported in python 3.9,3.10 (automlx dependency). Tests are running in python3.8 test env, see run-unittests-py38-cov-report.yml
43+
# 'hpo' tests hangs if run together with all unitary tests. Tests running in separate command before running all unitary
44+
ignore-path: |
45+
--ignore tests/unitary/with_extras/model \
46+
--ignore tests/unitary/with_extras/feature_store \
47+
--ignore tests/unitary/with_extras/operator/forecast \
48+
--ignore tests/unitary/with_extras/hpo
49+
- name: "slow_tests"
50+
test-path: "tests/unitary/with_extras/model"
4351

4452
steps:
4553
- uses: actions/checkout@v3
@@ -62,8 +70,19 @@ jobs:
6270
name: "Test env setup"
6371
timeout-minutes: 20
6472

73+
- name: "Run hpo tests"
74+
timeout-minutes: 10
75+
shell: bash
76+
if: ${{ matrix.name }} == "unitary"
77+
run: |
78+
set -x # print commands that are executed
79+
80+
# Run hpo tests, which hangs if run together with all unitary tests
81+
python -m pytest -v -p no:warnings -n auto --dist loadfile \
82+
tests/unitary/with_extras/hpo
83+
6584
- name: "Run unitary tests folder with maximum ADS dependencies"
66-
timeout-minutes: 60
85+
timeout-minutes: 30
6786
shell: bash
6887
env:
6988
CONDA_PREFIX: /usr/share/miniconda

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bds = [
8282
"sqlalchemy",
8383
]
8484
boosted = [
85-
"lightgbm",
85+
"lightgbm<4.0.0", # relax when the official releases of skl2onnx (v1.16.0) and onnxmltools (1.11.3), https://github.com/sdpython/mlprodict/issues/488
8686
"xgboost",
8787
]
8888
data = [
@@ -106,10 +106,10 @@ notebook = [
106106
"ipywidgets~=7.6.3",
107107
]
108108
onnx = [
109-
"lightgbm",
109+
"lightgbm<4.0.0", # relax when the official releases of skl2onnx (v1.16.0) and onnxmltools (1.11.3), https://github.com/sdpython/mlprodict/issues/488
110110
"onnx>=1.12.0",
111111
"onnxmltools>=1.10.0",
112-
"onnxruntime>=1.10.0,<1.16", # v1.16 introduced issues https://github.com/microsoft/onnxruntime/issues/17631, revealedd by unit tests
112+
"onnxruntime>=1.10.0,<1.16", # v1.16 introduced issues https://github.com/microsoft/onnxruntime/issues/17631, revealed by unit tests
113113
"oracle_ads[viz]",
114114
"protobuf<=3.20",
115115
"skl2onnx>=1.10.4",

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ faker
55
mock
66
pip
77
pytest
8-
pytest-codecov
8+
pytest-cov
99
pytest-xdist

tests/unitary/default_setup/telemetry/test_agent.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import pytest
1111

12-
# from pytest import MonkeyPatch
13-
1412
import ads
1513
from ads.telemetry.telemetry import (
1614
EXTRA_USER_AGENT_INFO,
@@ -37,8 +35,9 @@ def teardown_method(self):
3735
@patch("oci.config.validate_config")
3836
@patch("oci.signer.Signer")
3937
def test_user_agent_api_keys_using_test_profile(
40-
self, mock_signer, mock_validate_config
38+
self, mock_signer, mock_validate_config, monkeypatch
4139
):
40+
monkeypatch.delenv(EXTRA_USER_AGENT_INFO, raising=False)
4241
with patch("oci.config.from_file", return_value=self.test_config):
4342
auth_info = ads.auth.api_keys("test_path", "TEST_PROFILE")
4443
assert (
@@ -49,6 +48,7 @@ def test_user_agent_api_keys_using_test_profile(
4948
@patch("oci.auth.signers.get_resource_principals_signer")
5049
def test_user_agent_rp(self, mock_signer, monkeypatch):
5150
monkeypatch.delenv("OCI_RESOURCE_PRINCIPAL_VERSION", raising=False)
51+
monkeypatch.delenv(EXTRA_USER_AGENT_INFO, raising=False)
5252
importlib.reload(ads.config)
5353
importlib.reload(ads.telemetry)
5454
auth_info = ads.auth.resource_principal()
@@ -64,6 +64,7 @@ def test_user_agent_default_signer(
6464
):
6565
# monkeypatch = MonkeyPatch()
6666
monkeypatch.delenv("OCI_RESOURCE_PRINCIPAL_VERSION", raising=False)
67+
monkeypatch.delenv(EXTRA_USER_AGENT_INFO, raising=False)
6768
importlib.reload(ads.config)
6869
with patch("oci.config.from_file", return_value=self.test_config):
6970
auth_info = ads.auth.default_signer()
@@ -121,6 +122,7 @@ def test_user_agent_default_signer_known_resources(
121122
# monkeypatch = MonkeyPatch()
122123
monkeypatch.setenv("OCI_RESOURCE_PRINCIPAL_VERSION", "1.1")
123124
monkeypatch.setenv(INPUT_DATA["RESOURCE_KEY"], "1234")
125+
monkeypatch.delenv(EXTRA_USER_AGENT_INFO, raising=False)
124126
if INPUT_DATA[EXTRA_USER_AGENT_INFO] is not None:
125127
monkeypatch.setenv(EXTRA_USER_AGENT_INFO, INPUT_DATA[EXTRA_USER_AGENT_INFO])
126128

@@ -148,6 +150,7 @@ def test_user_agent_default_signer_ociservice(
148150
monkeypatch,
149151
):
150152
monkeypatch.setenv("OCI_RESOURCE_PRINCIPAL_VERSION", "1.1")
153+
monkeypatch.delenv(EXTRA_USER_AGENT_INFO, raising=False)
151154

152155
importlib.reload(ads.config)
153156
importlib.reload(ads.telemetry)

0 commit comments

Comments
 (0)