Skip to content

Commit 31a8c68

Browse files
author
Thierry RAMORASOAVINA
committed
Rename the skip_long_test flag to skip_expensive_test to filter both long-lasting and resources consuming tests
1 parent 172624d commit 31a8c68

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ on:
1515
khiops-desktop-revision:
1616
default: 10.2.4
1717
description: Khiops Windows Desktop Application Version
18-
run-long-tests:
18+
run-expensive-tests:
1919
type: boolean
2020
required: false
2121
default: false
22-
description: Execute long tests
22+
description: Execute expensive tests
2323
pull_request:
2424
paths:
2525
- khiops/**.py
@@ -110,8 +110,8 @@ jobs:
110110
rm -rf khiops.egg-info
111111
done
112112
- name: Prepare Unit Tests Environment
113-
if: github.ref != 'dev' && github.ref != 'main' && ! inputs.run-long-tests
114-
run: echo "UNITTEST_ONLY_SHORT_TESTS=true" >> "$GITHUB_ENV"
113+
if: github.ref != 'dev' && github.ref != 'main' && ! inputs.run-expensive-tests
114+
run: echo "SKIP_EXPENSIVE_TESTS=true" >> "$GITHUB_ENV"
115115
- name: Prepare Integration Tests on remote files
116116
env:
117117
AWS_ENDPOINT_URL: http://localhost:4569

tests/test_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ def get_with_subkey(dictionary, subkey):
272272
return values
273273

274274
@staticmethod
275-
def skip_long_test(test_case):
276-
if "UNITTEST_ONLY_SHORT_TESTS" in os.environ:
277-
if os.environ["UNITTEST_ONLY_SHORT_TESTS"].lower() == "true":
278-
test_case.skipTest("Skipping long test")
275+
def skip_expensive_test(test_case):
276+
if "SKIP_EXPENSIVE_TESTS" in os.environ:
277+
if os.environ["SKIP_EXPENSIVE_TESTS"].lower() == "true":
278+
test_case.skipTest("Skipping expensive test")
279279

280280
@staticmethod
281281
def create_parameter_trace():

tests/test_khiops_integrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class KhiopsMultitableFitTests(unittest.TestCase):
223223
"""Test if Khiops estimator can be fitted on multi-table data"""
224224

225225
def setUp(self):
226-
KhiopsTestHelper.skip_long_test(self)
226+
KhiopsTestHelper.skip_expensive_test(self)
227227

228228
def test_estimator_multiple_create_and_fit_does_not_raise_exception(self):
229229
"""Test if estimator can be fitted from paths several times"""

tests/test_parallel_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class KhiopsParallelRunningTests(TestCase, KhiopsTestHelper):
2828
_n_cpus = -1
2929

3030
def setUp(self):
31-
KhiopsTestHelper.skip_long_test(self)
31+
KhiopsTestHelper.skip_expensive_test(self)
3232

3333
def _parallelise(self, callback, arg_sequence, n_cpus):
3434
"""Parallelisation driver"""

tests/test_remote_access.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def is_in_a_conda_env():
140140
) == os.path.dirname(khiops_path)
141141

142142
def setUp(self):
143+
# Skip if only short and cheap tests are run
144+
KhiopsTestHelper.skip_expensive_test(self)
143145

144146
self.skip_if_no_config()
145147
if self.is_in_a_conda_env() and self.should_skip_in_a_conda_env():
@@ -221,8 +223,6 @@ def test_khiops_classifier_with_remote_access(self):
221223

222224
def test_khiops_coclustering_with_remote_access(self):
223225
"""Test the training of a khiops_coclustering with remote resources"""
224-
# Skip if only short tests are run
225-
KhiopsTestHelper.skip_long_test(self)
226226

227227
# Setup paths
228228
# note : the current implementation forces the khiops.log file

tests/test_samples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class KhiopsSamplesTests(unittest.TestCase):
1616
"""Test if all samples run without problems"""
1717

1818
def setUp(self):
19-
KhiopsTestHelper.skip_long_test(self)
19+
KhiopsTestHelper.skip_expensive_test(self)
2020

2121
def test_samples(self):
2222
"""Test if all samples run without problems"""

tests/test_sklearn_output_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class KhiopsSklearnOutputTypes(unittest.TestCase):
4949
"""Tests for checking the output types of predictors"""
5050

5151
def setUp(self):
52-
KhiopsTestHelper.skip_long_test(self)
52+
KhiopsTestHelper.skip_expensive_test(self)
5353

5454
def _replace(self, array, replacement_dict):
5555
return np.array([replacement_dict[value] for value in array])

0 commit comments

Comments
 (0)