Skip to content

Commit 45ae386

Browse files
committed
disable Manual/Tutorial tests on Windows Python2.7
1 parent 9f60d8f commit 45ae386

File tree

37 files changed

+182
-0
lines changed

37 files changed

+182
-0
lines changed

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_create_user_minibatch_sources_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810

911
abs_path = os.path.dirname(os.path.abspath(__file__))
1012

@@ -14,6 +16,8 @@
1416

1517

1618
def test_manual_learners_cntk_noErrors(nb):
19+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
20+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1721
errors = [output for cell in nb.cells if 'outputs' in cell
1822
for output in cell['outputs'] if output.output_type == "error"]
1923
assert errors == []

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_debug_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

@@ -16,6 +18,8 @@
1618
#Note: Given this is a manual for debugging, we check only for functional correctness of API.
1719

1820
def test_debugging_cntk_noErrors(nb):
21+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
22+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1923
errors = [output for cell in nb.cells if 'outputs' in cell
2024
for output in cell['outputs'] if output.output_type == "error"]
2125
assert errors == []

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_feed_data_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

@@ -15,6 +17,8 @@
1517
#Note: Given this is a manual for data reading, we check only for functional correctness of API.
1618

1719
def test_manual_how_to_feed_data_noErrors(nb):
20+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
21+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1822
errors = [output for cell in nb.cells if 'outputs' in cell
1923
for output in cell['outputs'] if output.output_type == "error"]
2024
assert errors == []

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_train_using_declarative_and_imperative_API_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import re
99
import sys
10+
import pytest
1011

1112
abs_path = os.path.dirname(os.path.abspath(__file__))
1213
sys.path.append(os.path.join(abs_path, "..", "Tutorials"))
@@ -16,12 +17,16 @@
1617
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Manual", "Manual_How_to_train_using_declarative_and_imperative_API.ipynb")
1718

1819
def test_cntk_how_to_train_no_errors(nb):
20+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
21+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1922
errors = [output for cell in nb.cells if 'outputs' in cell
2023
for output in cell['outputs'] if output.output_type == "error"]
2124
assert errors == []
2225

2326
expectedOutput = r'Minibatch\[ 191- 200\]: loss = '
2427
def test_cntk_how_to_train_eval_correct(nb):
28+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
29+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2530
testCells = [cell for cell in nb.cells
2631
if cell.cell_type == 'code']
2732
assert len(testCells) == 5

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_use_learners_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810

911
abs_path = os.path.dirname(os.path.abspath(__file__))
1012

@@ -14,6 +16,8 @@
1416

1517

1618
def test_manual_learners_cntk_noErrors(nb):
19+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
20+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1721
errors = [output for cell in nb.cells if 'outputs' in cell
1822
for output in cell['outputs'] if output.output_type == "error"]
1923
assert errors == []

Tests/EndToEndTests/CNTKv2Python/Manual/Manual_How_to_write_a_custom_deserializer_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import re
99
import sys
10+
import pytest
1011

1112
abs_path = os.path.dirname(os.path.abspath(__file__))
1213
sys.path.append(os.path.join(abs_path, "..", "Tutorials"))
@@ -16,12 +17,16 @@
1617
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Manual", "Manual_How_to_write_a_custom_deserializer.ipynb")
1718

1819
def test_cntk_how_to_train_no_errors(nb):
20+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
21+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1922
errors = [output for cell in nb.cells if 'outputs' in cell
2023
for output in cell['outputs'] if output.output_type == "error"]
2124
assert errors == []
2225

2326
expectedOutput = 'Total number of samples 200000'
2427
def test_csv_correct(nb):
28+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
29+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2530
testCells = [cell for cell in nb.cells
2631
if cell.cell_type == 'code']
2732
assert len(testCells) == 6

Tests/EndToEndTests/CNTKv2Python/Manual/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def nb(tmpdir_factory, request, device_id):
4747
import subprocess
4848
from cntk.ops.tests.ops_test_utils import cntk_device
4949
from cntk.cntk_py import DeviceKind_GPU
50+
51+
# tests with Python 2.7 on Windows are not stable in the CI environment
52+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
53+
return;
54+
5055
inPath = getattr(request.module, "notebook")
5156

5257
deviceIdsToRun = [-1, 0]

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_101_LogisticRegression_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911

1012
abs_path = os.path.dirname(os.path.abspath(__file__))
1113
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_101_LogisticRegression.ipynb")
1214

1315
def test_cntk_101_logisticregression_noErrors(nb):
16+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
17+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1418
errors = [output for cell in nb.cells if 'outputs' in cell
1519
for output in cell['outputs'] if output.output_type == "error"]
1620
assert errors == []
1721

1822
expectedEvalError = '0.12'
1923

2024
def test_cntk_101_logisticregression_evalCorrect(nb):
25+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
26+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2127
testCell = [cell for cell in nb.cells
2228
if cell.cell_type == 'code' and re.search(r'trainer\.test_minibatch', cell.source)]
2329
assert len(testCell) == 1

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_102_FeedForward_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911

1012
abs_path = os.path.dirname(os.path.abspath(__file__))
1113
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_102_FeedForward.ipynb")
1214

1315
def test_cntk_102_feedforward_noErrors(nb):
16+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
17+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1418
errors = [output for cell in nb.cells if 'outputs' in cell
1519
for output in cell['outputs'] if output.output_type == "error"]
1620
assert errors == []
1721

1822
expectedEvalError = '0.12'
1923

2024
def test_cntk_102_feedforward_evalCorrect(nb):
25+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
26+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2127
testCell = [cell for cell in nb.cells
2228
if cell.cell_type == 'code' and re.search(r'trainer\.test_minibatch', cell.source)]
2329
assert len(testCell) == 1

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_103A_MNIST_DataLoader_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import re
99
import numpy as np
10+
import sys
1011
import pytest
1112

1213
abs_path = os.path.dirname(os.path.abspath(__file__))
@@ -28,6 +29,8 @@ def clean_data(device_id):
2829
@pytest.mark.skipif(not reWeekly.search(os.environ.get('TEST_TAG')),
2930
reason="only runs as part of the weekly tests")
3031
def test_cntk_103a_mnist_dataloader_noErrors(clean_data, nb):
32+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
33+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
3134
errors = [output for cell in nb.cells if 'outputs' in cell
3235
for output in cell['outputs'] if output.output_type == "error"]
3336
assert errors == []

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_103B_MNIST_LogisticRegression_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

1113
abs_path = os.path.dirname(os.path.abspath(__file__))
1214
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_103B_MNIST_LogisticRegression.ipynb")
1315

1416
def test_cntk_103b_mnist_logisticregression_noErrors(nb):
17+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
18+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1519
errors = [output for cell in nb.cells if 'outputs' in cell
1620
for output in cell['outputs'] if output.output_type == "error"]
1721
assert errors == []
1822

1923
expectedEvalErrorByDeviceId = { -1: 7.4, 0: 7.4 }
2024

2125
def test_cntk_103b_mnist_logisticregression_evalCorrect(nb, device_id):
26+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
27+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2228
testCell = [cell for cell in nb.cells
2329
if cell.cell_type == 'code' and re.search(r'trainer\.test_minibatch', cell.source)]
2430
assert len(testCell) == 1

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_103C_MNIST_MultiLayerPerceptron_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

1113
abs_path = os.path.dirname(os.path.abspath(__file__))
1214
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_103C_MNIST_MultiLayerPerceptron.ipynb")
1315

1416
def test_cntk_103c_mnist_multilayerperceptron_noErrors(nb):
17+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
18+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1519
errors = [output for cell in nb.cells if 'outputs' in cell
1620
for output in cell['outputs'] if output.output_type == "error"]
1721
assert errors == []
1822

1923
expectedEvalErrorByDeviceId = { -1: 1.72, 0: 1.81 }
2024

2125
def test_cntk_103c_mnist_multilayerperceptron_evalCorrect(nb, device_id):
26+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
27+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2228
testCell = [cell for cell in nb.cells
2329
if cell.cell_type == 'code' and re.search(r'trainer\.test_minibatch', cell.source)]
2430
assert len(testCell) == 1

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_103D_MNIST_ConvolutionalNeuralNetwork_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

1113
abs_path = os.path.dirname(os.path.abspath(__file__))
1214
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_103D_MNIST_ConvolutionalNeuralNetwork.ipynb")
1315

1416
def test_cntk_103d_mnist_convolutionalneuralnetwork_noErrors(nb):
17+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
18+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1519
errors = [output for cell in nb.cells if 'outputs' in cell
1620
for output in cell['outputs'] if output.output_type == "error"]
1721
assert errors == []
@@ -20,6 +24,8 @@ def test_cntk_103d_mnist_convolutionalneuralnetwork_noErrors(nb):
2024
expectedEvalErrorByDeviceId = { -1: [1.35, 1.05] , 0: [1.35, 1.05] }
2125

2226
def test_cntk_103d_mnist_convolutionalneuralnetwork_trainerror(nb, device_id):
27+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
28+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2329
metrics = []
2430
for cell in nb.cells:
2531
try:

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911

1012
abs_path = os.path.dirname(os.path.abspath(__file__))
1113
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_104_Finance_Timeseries_Basic_with_Pandas_Numpy.ipynb")
1214

1315
def test_cntk_104_finance_timeseries_basic_with_pandas_numpy_noErrors(nb):
16+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
17+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1418
errors = [output for cell in nb.cells if 'outputs' in cell
1519
for output in cell['outputs'] if output.output_type == "error"]
1620
print(errors)
@@ -20,6 +24,8 @@ def test_cntk_104_finance_timeseries_basic_with_pandas_numpy_noErrors(nb):
2024
expectedEvalErrorLower = 0.40
2125

2226
def test_cntk_104_finance_timeseries_basic_with_pandas_numpy_trainerror(nb):
27+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
28+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2329
testCell = [cell for cell in nb.cells
2430
if cell.cell_type == 'code' and re.search('# Repeatable factor ', cell.source)]
2531
assert (float((testCell[0].outputs[0])['text']) < expectedEvalErrorUpper) or (float((testCell[0].outputs[0])['text']) > expectedEvalErrorLower)

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_105_Basic_Autoencoder_for_Dimensionality_Reduction_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012

@@ -15,6 +17,8 @@
1517
TOLERANCE_ABSOLUTE = 1E-1
1618

1719
def test_cntk_105_basic_autoencoder_for_dimensionality_reduction_noErrors(nb):
20+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
21+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1822
errors = [output for cell in nb.cells if 'outputs' in cell
1923
for output in cell['outputs'] if output.output_type == "error"]
2024
print(errors)
@@ -23,6 +27,8 @@ def test_cntk_105_basic_autoencoder_for_dimensionality_reduction_noErrors(nb):
2327
expectedError = 3.05
2428

2529
def test_cntk_105_basic_autoencoder_for_dimensionality_reduction_simple_trainerror(nb):
30+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
31+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2632
testCell = [cell for cell in nb.cells
2733
if cell.cell_type == 'code' and re.search('# Simple autoencoder test error', cell.source)]
2834
assert np.isclose(float((testCell[0].outputs[0])['text']), expectedError, atol = TOLERANCE_ABSOLUTE)

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_106A_LSTM_Timeseries_with_Simulated_Data_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# ==============================================================================
66

77
import os
8+
import sys
9+
import pytest
810
import re
911
import numpy as np
1012
from . import _all_close_or_less
@@ -13,13 +15,17 @@
1315
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_106A_LSTM_Timeseries_with_Simulated_Data.ipynb")
1416

1517
def test_cntk_106A_lstm_timeseries_with_simulated_data_noErrors(nb):
18+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
19+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
1620
errors = [output for cell in nb.cells if 'outputs' in cell
1721
for output in cell['outputs'] if output.output_type == "error"]
1822
assert errors == []
1923

2024
expectedEvalErrorByDeviceId = { -1: 0.000049, 0: 0.000049 }
2125

2226
def test_cntk_106A_lstm_timeseries_with_simulated_data_evalCorrect(nb, device_id):
27+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
28+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2329
testCell = [cell for cell in nb.cells
2430
if cell.cell_type == 'code' and re.search('# Print validate and test error', cell.source)]
2531
assert len(testCell) == 1

Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_106B_LSTM_Timeseries_with_IOT_Data_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import re
99
import numpy as np
1010
import sys
11+
import pytest
1112

1213
abs_path = os.path.dirname(os.path.abspath(__file__))
1314

@@ -19,13 +20,17 @@
1920
notebook_timeoutSeconds = 1800
2021

2122
def test_cntk_106B_lstm_timeseries_with_iot_data_noErrors(nb):
23+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
24+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2225
errors = [output for cell in nb.cells if 'outputs' in cell
2326
for output in cell['outputs'] if output.output_type == "error"]
2427
assert errors == []
2528

2629
expectedEvalErrorByDeviceId = { -1: 0.000076, 0: 0.000076 }
2730

2831
def test_cntk_106B_lstm_timeseries_with_iot_data_evalCorrect(nb, device_id):
32+
if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2:
33+
pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ')
2934
testCell = [cell for cell in nb.cells
3035
if cell.cell_type == 'code' and re.search('# Print the test error', cell.source)]
3136
assert len(testCell) == 1

0 commit comments

Comments
 (0)