From 2d23e4c6f00b867e33abb8af8cb5ac7444dcdd0c Mon Sep 17 00:00:00 2001 From: Cruz Monrreal II Date: Wed, 16 Jan 2019 17:19:33 -0600 Subject: [PATCH 1/5] Added specific versions of Travis-only modules Use requirements.txt to install specific versions of Travis CI python modules. --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9a7df73f7e..8722dc13ba7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,7 +85,6 @@ matrix: - doxygen doxyfile_options 2>&1 # Once Mbed OS has been fixed, enable the full test by replacing the top line with this: # - ( ! doxygen doxyfile_options 2>&1 | grep . ) - # Assert that all binary libraries are named correctly # The strange command below asserts that there are exactly 0 libraries # that do not start with lib @@ -106,10 +105,20 @@ matrix: install: # Install dependencies - sudo apt-get install gcc-arm-embedded + # Add additional dependencies specific for testing + - |- + tr -d ' ' >> requirements.txt <<< " + mock==2.0.0 + pytest==3.3.0 + pylint>=1.9,<2 + hypothesis>=3,<4 + coverage>=4.5,<5 + coveralls>=1.5,<2 + " + # ... and install. - pip install -r requirements.txt - - pip install pytest pylint hypothesis==3.88.3 mock coverage coveralls - # Print versions we use + # Print versions we use - arm-none-eabi-gcc --version - python --version - pip list --verbose From e5fecaf8994fc4d33d5d735dda1eeddd4667b87e Mon Sep 17 00:00:00 2001 From: Cruz Monrreal II Date: Wed, 16 Jan 2019 17:20:45 -0600 Subject: [PATCH 2/5] Shuffled around version checks to be more useful in case of failure --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8722dc13ba7..9cef638f75f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,7 +105,9 @@ matrix: install: # Install dependencies - sudo apt-get install gcc-arm-embedded + - arm-none-eabi-gcc --version # Add additional dependencies specific for testing + - python --version - |- tr -d ' ' >> requirements.txt <<< " mock==2.0.0 @@ -117,10 +119,6 @@ matrix: " # ... and install. - pip install -r requirements.txt - - # Print versions we use - - arm-none-eabi-gcc --version - - python --version - pip list --verbose script: # Run local testing on tools From 390b5815167666d981ee2b43834dec09a9f1a298 Mon Sep 17 00:00:00 2001 From: Cruz Monrreal II Date: Wed, 16 Jan 2019 17:22:28 -0600 Subject: [PATCH 3/5] Added warning suppression to python api_tests. Apparently local laptop isn't fast enough for test generation, but CI is --- tools/test/toolchains/api_test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/test/toolchains/api_test.py b/tools/test/toolchains/api_test.py index b1a19c3300e..f48ea1dc0d0 100644 --- a/tools/test/toolchains/api_test.py +++ b/tools/test/toolchains/api_test.py @@ -4,7 +4,7 @@ from string import printable from copy import deepcopy from mock import MagicMock, patch -from hypothesis import given, settings +from hypothesis import given, settings, HealthCheck from hypothesis.strategies import text, lists, fixed_dictionaries, booleans ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", @@ -112,6 +112,7 @@ def test_gcc_version_check(_run_cmd): 'asm': lists(text()), 'ld': lists(text())}), lists(text(min_size=1, alphabet=ALPHABET), min_size=1)) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_toolchain_profile_c(profile, source_file): """Test that the appropriate profile parameters are passed to the C compiler""" @@ -144,6 +145,7 @@ def test_toolchain_profile_c(profile, source_file): 'asm': lists(text()), 'ld': lists(text())}), lists(text(min_size=1, alphabet=ALPHABET), min_size=1)) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_toolchain_profile_cpp(profile, source_file): """Test that the appropriate profile parameters are passed to the C++ compiler""" @@ -175,6 +177,7 @@ def test_toolchain_profile_cpp(profile, source_file): 'asm': lists(text()), 'ld': lists(text())}), lists(text(min_size=1, alphabet=ALPHABET), min_size=1)) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_toolchain_profile_asm(profile, source_file): """Test that the appropriate profile parameters are passed to the Assembler""" @@ -213,6 +216,7 @@ def test_toolchain_profile_asm(profile, source_file): 'asm': lists(text()), 'ld': lists(text(min_size=1))}), lists(text(min_size=1, alphabet=ALPHABET), min_size=1)) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_toolchain_profile_ld(profile, source_file): """Test that the appropriate profile parameters are passed to the Linker""" From e0572e76ce07dd8fcfd8c4a3f46cbfa36ef19397 Mon Sep 17 00:00:00 2001 From: Cruz Monrreal II Date: Wed, 16 Jan 2019 17:24:00 -0600 Subject: [PATCH 4/5] Updated requirements.txt to be more module-version resilliant. Moved modules tied to specific versions higher, and modules with no restrictions lower. --- requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index e7f6071e59c..7f1ddadfdf7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,17 @@ colorama==0.3.9 -pyserial>=3,<=3.4 +urllib3[secure]==1.23 prettytable==0.7.2 -Jinja2>=2.7.3,<=2.10 -intelhex>=1.3,<=2.2.1 junit-xml==1.8 pyyaml==4.2b1 -urllib3[secure]==1.23 +jsonschema==2.6.0 +future==0.16.0 +six==1.11.0 +mbed-cloud-sdk==2.0.1 requests>=2.20,<2.21 +idna>=2,<2.8 +pyserial>=3,<=3.4 +Jinja2>=2.7.3,<=2.10 +intelhex>=1.3,<=2.2.1 intervaltree>=2,<3 mbed-ls>=1.5.1,<1.7 mbed-host-tests>=1.1.2,<=1.5 @@ -14,10 +19,5 @@ mbed-greentea>=0.2.24,<=1.5 beautifulsoup4>=4,<=4.6.3 fuzzywuzzy>=0.11,<=0.17 pyelftools>=0.24,<=0.25 -jsonschema==2.6.0 -future==0.16.0 -six==1.11.0 git+https://github.com/armmbed/manifest-tool.git@v1.4.6 -mbed-cloud-sdk==2.0.1 -pyocd>=0.14,<0.15 icetea>=1.0.2,<1.1 From fde0321802f76b45723af802b24995a87448d43d Mon Sep 17 00:00:00 2001 From: Cruz Monrreal II Date: Thu, 17 Jan 2019 12:41:26 -0600 Subject: [PATCH 5/5] Added pyocd requirement. Dependency tree: icetea > mbed_flasher > pyocd --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 7f1ddadfdf7..9f54fa6c48e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,5 @@ beautifulsoup4>=4,<=4.6.3 fuzzywuzzy>=0.11,<=0.17 pyelftools>=0.24,<=0.25 git+https://github.com/armmbed/manifest-tool.git@v1.4.6 +pyocd>=0.14,<0.15 icetea>=1.0.2,<1.1