Skip to content

Commit 797c2f4

Browse files
yangawsPiali Das
authored and
Piali Das
committed
Allow argument for test framework version and mark regional tests (aws#382)
* Allow argument for test framework version and mark regional tests * correct typo
1 parent 5a89c91 commit 797c2f4

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

tests/conftest.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def pytest_addoption(parser):
3333
parser.addoption('--sagemaker-client-config', action='store', default=None)
3434
parser.addoption('--sagemaker-runtime-config', action='store', default=None)
3535
parser.addoption('--boto-config', action='store', default=None)
36+
parser.addoption('--tf-full-version', action='store', default=TF_VERSION)
37+
parser.addoption('--mxnet-full-version', action='store', default=MXNET_VERSION)
38+
parser.addoption('--chainer-full-version', action='store', default=CHAINER_VERSION)
39+
parser.addoption('--pytorch-full-version', action='store', default=PYTORCH_VERSION)
3640

3741

3842
@pytest.fixture(scope='session')
@@ -96,21 +100,21 @@ def chainer_version(request):
96100
return request.param
97101

98102

99-
@pytest.fixture(scope='module', params=[TF_VERSION])
103+
@pytest.fixture(scope='module')
100104
def tf_full_version(request):
101-
return request.param
105+
return request.config.getoption('--tf-full-version')
102106

103107

104-
@pytest.fixture(scope='module', params=[MXNET_VERSION])
108+
@pytest.fixture(scope='module')
105109
def mxnet_full_version(request):
106-
return request.param
110+
return request.config.getoption('--mxnet-full-version')
107111

108112

109-
@pytest.fixture(scope='module', params=[PYTORCH_VERSION])
113+
@pytest.fixture(scope='module')
110114
def pytorch_full_version(request):
111-
return request.param
115+
return request.config.getoption('--pytorch-full-version')
112116

113117

114-
@pytest.fixture(scope='module', params=[CHAINER_VERSION])
118+
@pytest.fixture(scope='module')
115119
def chainer_full_version(request):
116-
return request.param
120+
return request.config.getoption('--chainer-full-version')

tests/integ/test_chainer_train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def test_training_with_additional_hyperparameters(sagemaker_session, chainer_ful
6464

6565

6666
@pytest.mark.continuous_testing
67+
@pytest.mark.regional_testing
6768
def test_attach_deploy(chainer_training_job, sagemaker_session):
6869
endpoint_name = 'test-chainer-attach-deploy-{}'.format(sagemaker_timestamp())
6970

tests/integ/test_mxnet_train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def mxnet_training_job(sagemaker_session, mxnet_full_version):
4545

4646

4747
@pytest.mark.continuous_testing
48+
@pytest.mark.regional_testing
4849
def test_attach_deploy(mxnet_training_job, sagemaker_session):
4950
endpoint_name = 'test-mxnet-attach-deploy-{}'.format(sagemaker_timestamp())
5051

tests/integ/test_pytorch_train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def fixture_training_job(sagemaker_session, pytorch_full_version):
3636

3737

3838
@pytest.mark.continuous_testing
39+
@pytest.mark.regional_testing
3940
def test_sync_fit_deploy(pytorch_training_job, sagemaker_session):
4041
# TODO: add tests against local mode when it's ready to be used
4142
endpoint_name = 'test-pytorch-sync-fit-attach-deploy{}'.format(sagemaker_timestamp())

tests/integ/test_tf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828

2929
@pytest.mark.continuous_testing
30+
@pytest.mark.regional_testing
3031
@pytest.mark.skipif(PYTHON_VERSION != 'py2', reason="TensorFlow image supports only python 2.")
3132
def test_tf(sagemaker_session, tf_full_version):
3233
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):

0 commit comments

Comments
 (0)