[CI] Make Python model compatibility test runnable locally (#5941)
This commit is contained in:
parent
487ab0ce73
commit
12110c900e
@ -87,7 +87,6 @@ def run_scikit_model_check(name, path):
|
|||||||
assert False
|
assert False
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.ci
|
|
||||||
def test_model_compatibility():
|
def test_model_compatibility():
|
||||||
'''Test model compatibility, can only be run on CI as others don't
|
'''Test model compatibility, can only be run on CI as others don't
|
||||||
have the credentials.
|
have the credentials.
|
||||||
@ -102,13 +101,9 @@ def test_model_compatibility():
|
|||||||
pytest.skip(
|
pytest.skip(
|
||||||
'Skiping compatibility tests as boto3 is not installed.')
|
'Skiping compatibility tests as boto3 is not installed.')
|
||||||
|
|
||||||
try:
|
|
||||||
s3_bucket = boto3.resource('s3').Bucket('xgboost-ci-jenkins-artifacts')
|
s3_bucket = boto3.resource('s3').Bucket('xgboost-ci-jenkins-artifacts')
|
||||||
zip_path = 'xgboost_model_compatibility_test.zip'
|
zip_path = 'xgboost_model_compatibility_test.zip'
|
||||||
s3_bucket.download_file(zip_path, zip_path)
|
s3_bucket.download_file(zip_path, zip_path)
|
||||||
except botocore.exceptions.NoCredentialsError:
|
|
||||||
pytest.skip(
|
|
||||||
'Skiping compatibility tests as running on non-CI environment.')
|
|
||||||
|
|
||||||
with zipfile.ZipFile(zip_path, 'r') as z:
|
with zipfile.ZipFile(zip_path, 'r') as z:
|
||||||
z.extractall(path)
|
z.extractall(path)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user