[CI] Refactor tests to reduce CI time. (#8312)
This commit is contained in:
@@ -8,6 +8,7 @@ import pytest
|
||||
|
||||
import testing as tm
|
||||
|
||||
pytestmark = pytest.mark.timeout(10)
|
||||
|
||||
class TestOMP:
|
||||
def test_omp(self):
|
||||
@@ -49,14 +50,15 @@ class TestOMP:
|
||||
print('test approx ...')
|
||||
param['tree_method'] = 'approx'
|
||||
|
||||
n_trials = 10
|
||||
param['nthread'] = 1
|
||||
auc_1, pred_1 = consist_test('approx_thread_1', 100)
|
||||
auc_1, pred_1 = consist_test('approx_thread_1', n_trials)
|
||||
|
||||
param['nthread'] = 2
|
||||
auc_2, pred_2 = consist_test('approx_thread_2', 100)
|
||||
auc_2, pred_2 = consist_test('approx_thread_2', n_trials)
|
||||
|
||||
param['nthread'] = 3
|
||||
auc_3, pred_3 = consist_test('approx_thread_3', 100)
|
||||
auc_3, pred_3 = consist_test('approx_thread_3', n_trials)
|
||||
|
||||
assert auc_1 == auc_2 == auc_3
|
||||
assert np.array_equal(auc_1, auc_2)
|
||||
@@ -66,13 +68,13 @@ class TestOMP:
|
||||
param['tree_method'] = 'hist'
|
||||
|
||||
param['nthread'] = 1
|
||||
auc_1, pred_1 = consist_test('hist_thread_1', 100)
|
||||
auc_1, pred_1 = consist_test('hist_thread_1', n_trials)
|
||||
|
||||
param['nthread'] = 2
|
||||
auc_2, pred_2 = consist_test('hist_thread_2', 100)
|
||||
auc_2, pred_2 = consist_test('hist_thread_2', n_trials)
|
||||
|
||||
param['nthread'] = 3
|
||||
auc_3, pred_3 = consist_test('hist_thread_3', 100)
|
||||
auc_3, pred_3 = consist_test('hist_thread_3', n_trials)
|
||||
|
||||
assert auc_1 == auc_2 == auc_3
|
||||
assert np.array_equal(auc_1, auc_2)
|
||||
|
||||
Reference in New Issue
Block a user