Time the CPU tests on Jenkins. (#6257)

* Time the CPU tests on Jenkins.
* Reduce thread contention.
* Add doc.
* Skip heavy tests on ARM.
This commit is contained in:
Jiaming Yuan
2020-10-21 08:19:07 +08:00
committed by GitHub
parent d1254808d5
commit 81c37c28d5
9 changed files with 29 additions and 18 deletions

View File

@@ -39,6 +39,7 @@ def test_feature_weights_demo():
@pytest.mark.skipif(**tm.no_sklearn())
@pytest.mark.skipif(**tm.is_arm())
def test_sklearn_demo():
script = os.path.join(PYTHON_DEMO_DIR, 'sklearn_examples.py')
cmd = ['python', script]
@@ -48,6 +49,7 @@ def test_sklearn_demo():
@pytest.mark.skipif(**tm.no_sklearn())
@pytest.mark.skipif(**tm.is_arm())
def test_sklearn_parallel_demo():
script = os.path.join(PYTHON_DEMO_DIR, 'sklearn_parallel.py')
cmd = ['python', script]

View File

@@ -83,6 +83,7 @@ class TestEarlyStopping(unittest.TestCase):
@pytest.mark.skipif(**tm.no_sklearn())
@pytest.mark.skipif(**tm.no_pandas())
@pytest.mark.skipif(**tm.is_arm())
def test_cv_early_stopping_with_multiple_eval_sets_and_metrics(self):
from sklearn.datasets import load_breast_cancer

View File

@@ -611,10 +611,6 @@ class TestWithDask:
tree_method):
params['tree_method'] = tree_method
params = dataset.set_params(params)
# multi class doesn't handle empty dataset well (empty
# means at least 1 worker has data).
if params['objective'] == "multi:softmax":
return
# It doesn't make sense to distribute a completely
# empty dataset.
if dataset.X.shape[0] == 0:
@@ -640,18 +636,20 @@ class TestWithDask:
# Make sure that it's decreasing
assert history[-1] < history[0]
@pytest.mark.skipif(**tm.is_arm())
@given(params=hist_parameter_strategy,
num_rounds=strategies.integers(20, 30),
dataset=tm.dataset_strategy)
@settings(deadline=None)
def test_hist(self, params, num_rounds, dataset, client):
def test_hist(self, params, dataset, client):
num_rounds = 30
self.run_updater_test(client, params, num_rounds, dataset, 'hist')
@pytest.mark.skipif(**tm.is_arm())
@given(params=exact_parameter_strategy,
num_rounds=strategies.integers(20, 30),
dataset=tm.dataset_strategy)
@settings(deadline=None)
def test_approx(self, client, params, num_rounds, dataset):
def test_approx(self, client, params, dataset):
num_rounds = 30
self.run_updater_test(client, params, num_rounds, dataset, 'approx')
def run_quantile(self, name):

View File

@@ -1,5 +1,6 @@
# coding: utf-8
import os
import platform
from xgboost.compat import SKLEARN_INSTALLED, PANDAS_INSTALLED
from xgboost.compat import DASK_INSTALLED
import pytest
@@ -22,6 +23,10 @@ except ImportError:
memory = Memory('./cachedir', verbose=0)
def is_arm():
return {'condition': platform.machine().lower().find('arm') != 1,
'reason': 'Skipping expensive tests on ARM.'}
def no_sklearn():
return {'condition': not SKLEARN_INSTALLED,
'reason': 'Scikit-Learn is not installed'}