From 3e609f447a4bdbd749cee8b47851dc5c947b4758 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Tue, 8 Jan 2019 08:05:13 -0500 Subject: [PATCH 01/48] Create .appveyor.yml --- .appveyor.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..1f2de2d2 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,31 @@ +environment: + matrix: + + # For Python versions available on Appveyor, see + # http://www.appveyor.com/docs/installed-software#python + # Python 3.0-3.3 have reached EOL + + - PYTHON: "C:\\Python27" + - PYTHON: "C:\\Python34" + - PYTHON: "C:\\Python35" + - PYTHON: "C:\\Python36" + - PYTHON: "C:\\Python37" + - PYTHON: "C:\\Python27-x64" + - PYTHON: "C:\\Python34-x64" + - PYTHON: "C:\\Python35-x64" + - PYTHON: "C:\\Python36-x64" + - PYTHON: "C:\\Python37-x64" + +install: + # Prepend Python installation and scripts (e.g. pytest) to PATH + - set PATH=%PYTHON_INSTALL%;%PYTHON_INSTALL%\\Scripts;%PATH% + - "python -m pip install .[testing,doc]" + +build: off + +test_script: + # run tests + - "pytest" + + # uplad coverage reports + - "codecov" From fc584a472d844e845793e7726876f886997b719c Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Tue, 8 Jan 2019 08:22:12 -0500 Subject: [PATCH 02/48] Update .appveyor.yml --- .appveyor.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 1f2de2d2..0696eb46 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,12 +6,10 @@ environment: # Python 3.0-3.3 have reached EOL - PYTHON: "C:\\Python27" - - PYTHON: "C:\\Python34" - PYTHON: "C:\\Python35" - PYTHON: "C:\\Python36" - PYTHON: "C:\\Python37" - PYTHON: "C:\\Python27-x64" - - PYTHON: "C:\\Python34-x64" - PYTHON: "C:\\Python35-x64" - PYTHON: "C:\\Python36-x64" - PYTHON: "C:\\Python37-x64" @@ -26,6 +24,3 @@ build: off test_script: # run tests - "pytest" - - # uplad coverage reports - - "codecov" From 03cde426e0015042eb4d4fdd6b632cc0646d284f Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 13:34:15 +0000 Subject: [PATCH 03/48] Set up CI with Azure Pipelines --- azure-pipelines.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..753fb47e --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,44 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +jobs: + +- job: 'Test' + pool: + vmImage: 'Ubuntu-16.04' + strategy: + matrix: + Python27: + python.version: '2.7' + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install -r requirements.txt + displayName: 'Install dependencies' + + - script: | + pip install pytest + pytest tests --doctest-modules --junitxml=junit/test-results.xml + displayName: 'pytest' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() From 6b155dfd3958674184ec98ce47553097ca92bd6a Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 13:41:59 +0000 Subject: [PATCH 04/48] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 753fb47e..bd1f3ac7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ jobs: - job: 'Test' pool: - vmImage: 'Ubuntu-16.04' + vmImage: 'vs2017-win2016' strategy: matrix: Python27: From d5d1a76153014a5f2ed97787f84a7a98356774c6 Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 13:44:07 +0000 Subject: [PATCH 05/48] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bd1f3ac7..19e0eaac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,12 +29,11 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install -r requirements.txt + - script: python -m pip install --upgrade pip && pip install .[testing,doc] displayName: 'Install dependencies' - script: | - pip install pytest - pytest tests --doctest-modules --junitxml=junit/test-results.xml + pytest tests displayName: 'pytest' - task: PublishTestResults@2 From 27a6a4b54097bfceb9f3221729d20945772bf975 Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 13:51:15 +0000 Subject: [PATCH 06/48] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 19e0eaac..6a9becf1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,8 +13,6 @@ jobs: vmImage: 'vs2017-win2016' strategy: matrix: - Python27: - python.version: '2.7' Python35: python.version: '3.5' Python36: From 42c9d78457d45b89ed8b3d0549fde5bbf64959a1 Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 14:07:04 +0000 Subject: [PATCH 07/48] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6a9becf1..6ab3002a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,7 +32,7 @@ jobs: - script: | pytest tests - displayName: 'pytest' + displayName: 'pytest -k "not test_warning_ignored"' - task: PublishTestResults@2 inputs: From e659cbdd3d20812b0f9a0e8e4ee631a689b31960 Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Tue, 8 Jan 2019 14:34:43 +0000 Subject: [PATCH 08/48] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6ab3002a..6a9becf1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,7 +32,7 @@ jobs: - script: | pytest tests - displayName: 'pytest -k "not test_warning_ignored"' + displayName: 'pytest' - task: PublishTestResults@2 inputs: From d5216a26e5478ae0f24371c4896427d8f5804142 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:28:34 -0500 Subject: [PATCH 09/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6a9becf1..ee420d39 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,7 +31,7 @@ jobs: displayName: 'Install dependencies' - script: | - pytest tests + py.test --cov=slash --cov-report=html tests displayName: 'pytest' - task: PublishTestResults@2 From 3329fbbe33aba2419c46ff60706909d6b0d4055f Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:35:09 -0500 Subject: [PATCH 10/48] Update azure-pipelines.yml --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ee420d39..3b4d6641 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,6 +26,9 @@ jobs: inputs: versionSpec: '$(python.version)' architecture: 'x64' + + - script: python -m virtualenv .env + displayName: Create virtual environment - script: python -m pip install --upgrade pip && pip install .[testing,doc] displayName: 'Install dependencies' From f6010bcc5d885e264ea8cad2307c1445fedd2b28 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:38:05 -0500 Subject: [PATCH 11/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3b4d6641..c5cf23aa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,7 +27,7 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m virtualenv .env + - script: python -m pip install --upgrade virtualenv && python -m virtualenv .env displayName: Create virtual environment - script: python -m pip install --upgrade pip && pip install .[testing,doc] From ddfc3b4566203479b6b99eef7cc2230ace1412cc Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:43:33 -0500 Subject: [PATCH 12/48] Update azure-pipelines.yml --- azure-pipelines.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c5cf23aa..43b1484f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,13 +27,19 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade virtualenv && python -m virtualenv .env + - script: python -m pip install --upgrade pip + displayName: 'update pip' + + - script: pip install --upgrade virtualenv && python -m virtualenv .env displayName: Create virtual environment - - script: python -m pip install --upgrade pip && pip install .[testing,doc] + - script: | + .env/Scripts/activate.bat + pip install .[testing,doc] displayName: 'Install dependencies' - script: | + .env/Scripts/activate.bat py.test --cov=slash --cov-report=html tests displayName: 'pytest' From 29ee850e08fbd73334ff049152a48d0d65697491 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:46:14 -0500 Subject: [PATCH 13/48] Update azure-pipelines.yml --- azure-pipelines.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 43b1484f..c3b6c8c6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,14 +33,10 @@ jobs: - script: pip install --upgrade virtualenv && python -m virtualenv .env displayName: Create virtual environment - - script: | - .env/Scripts/activate.bat - pip install .[testing,doc] + - script: .env/Scripts/activate.bat && pip install .[testing,doc] displayName: 'Install dependencies' - - script: | - .env/Scripts/activate.bat - py.test --cov=slash --cov-report=html tests + - script: .env/Scripts/activate.bat && py.test --cov=slash --cov-report=html tests displayName: 'pytest' - task: PublishTestResults@2 From 2319060c0086dce50c9d405805c8859a5cdf295c Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 07:51:27 -0500 Subject: [PATCH 14/48] Update azure-pipelines.yml --- azure-pipelines.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3b6c8c6..113aa7ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,14 +26,11 @@ jobs: inputs: versionSpec: '$(python.version)' architecture: 'x64' - - - script: python -m pip install --upgrade pip - displayName: 'update pip' - - script: pip install --upgrade virtualenv && python -m virtualenv .env + - script: python -m venv .env displayName: Create virtual environment - - script: .env/Scripts/activate.bat && pip install .[testing,doc] + - script: .env/Scripts/activate.bat && python -m pip install --upgrade pip && pip install .[testing,doc] displayName: 'Install dependencies' - script: .env/Scripts/activate.bat && py.test --cov=slash --cov-report=html tests From 67711d420acd659b5559fdc7b48867805a623f71 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 08:07:17 -0500 Subject: [PATCH 15/48] Update azure-pipelines.yml --- azure-pipelines.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 113aa7ba..4186b8d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,14 +26,12 @@ jobs: inputs: versionSpec: '$(python.version)' architecture: 'x64' - - - script: python -m venv .env - displayName: Create virtual environment + - - script: .env/Scripts/activate.bat && python -m pip install --upgrade pip && pip install .[testing,doc] + - script: python -m pip install --upgrade pip && pip install .[testing,doc] displayName: 'Install dependencies' - - script: .env/Scripts/activate.bat && py.test --cov=slash --cov-report=html tests + - script: py.test --cov=slash --cov-report=html tests displayName: 'pytest' - task: PublishTestResults@2 From d8a53e4a36bffafeaae159c672707480c71e6b9f Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 08:36:47 -0500 Subject: [PATCH 16/48] Update local_config.py --- slash/core/local_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/slash/core/local_config.py b/slash/core/local_config.py index e76dae82..7a38b05c 100644 --- a/slash/core/local_config.py +++ b/slash/core/local_config.py @@ -50,8 +50,7 @@ def _traverse_upwards(self, path): while True: yield path - if os.path.normcase(path) == os.path.normcase(os.path.abspath(os.path.sep)): - break new_path = os.path.dirname(path) - assert new_path != path + if new_path == path: + break path = new_path From 0aef962f64cc30f7c690fdfd2b031f29d0916154 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 08:38:03 -0500 Subject: [PATCH 17/48] Update azure-pipelines.yml --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4186b8d2..14545074 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,10 +28,12 @@ jobs: architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install .[testing,doc] + - script: | + python -m pip install --upgrade pip && pip install .[testing,doc] displayName: 'Install dependencies' - - script: py.test --cov=slash --cov-report=html tests + - script: | + py.test --cov=slash --cov-report=html tests displayName: 'pytest' - task: PublishTestResults@2 From dfb0abfbbe46bc6aa73b5c8c2b84483b00e00757 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 09:08:45 -0500 Subject: [PATCH 18/48] Update local_config.py --- slash/core/local_config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/slash/core/local_config.py b/slash/core/local_config.py index 7a38b05c..38a1fb16 100644 --- a/slash/core/local_config.py +++ b/slash/core/local_config.py @@ -50,7 +50,12 @@ def _traverse_upwards(self, path): while True: yield path - new_path = os.path.dirname(path) - if new_path == path: + print(os.path.normcase(path)) + print(os.path.normcase(os.path.abspath(os.path.sep))) + print(os.path.sep) + if os.path.normcase(path) == os.path.normcase(os.path.abspath(os.path.sep)): + print("Breaking") break + new_path = os.path.dirname(path) + assert new_path != path path = new_path From 15786b5943927771cf9b4f49eb80e87b9b93993b Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 09:25:49 -0500 Subject: [PATCH 19/48] Update local_config.py --- slash/core/local_config.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/slash/core/local_config.py b/slash/core/local_config.py index 38a1fb16..91f6807f 100644 --- a/slash/core/local_config.py +++ b/slash/core/local_config.py @@ -48,13 +48,11 @@ def _traverse_upwards(self, path): if os.path.isfile(path): path = os.path.dirname(path) + upward_limit = os.path.splitdrive(os.path.normcase(os.path.abspath(os.path.sep)))[1] + while True: yield path - print(os.path.normcase(path)) - print(os.path.normcase(os.path.abspath(os.path.sep))) - print(os.path.sep) - if os.path.normcase(path) == os.path.normcase(os.path.abspath(os.path.sep)): - print("Breaking") + if os.path.splitdrive(os.path.normcase(path))[1] == upward_limit: break new_path = os.path.dirname(path) assert new_path != path From 65a905191d296ad8e85e45869ea028c373ac186c Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 11:11:21 -0500 Subject: [PATCH 20/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 14545074..5da3677b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,7 +33,7 @@ jobs: displayName: 'Install dependencies' - script: | - py.test --cov=slash --cov-report=html tests + py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' - task: PublishTestResults@2 From a230cbc5d83099d3889180a227ff5c3be66b8951 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 11:38:11 -0500 Subject: [PATCH 21/48] skipping some test on windows --- tests/test_logging.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index 26e2c819..740d0c8a 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -1,6 +1,7 @@ # pylint: disable=unused-argument,redefined-outer-name import functools import os +omport sys import logbook import brotli @@ -45,7 +46,7 @@ def test_with_log_error(): assert [res.message for res in result.get_errors()] == expected_error_messages assert [rec.message for rec in test_handler.records] == [message, non_capture_message] - +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") def test_last_session_symlinks(files_dir, links_dir, session): test_log_file = files_dir.join( @@ -72,6 +73,7 @@ def _decompress(input_file_name, use_gzip=True): with open(input_file_name, 'rb') as in_f: return brotli.decompress(in_f.read()).decode() +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") @pytest.mark.parametrize('compression_enabled', [True, False]) @pytest.mark.parametrize('compression_method', ['gzip', 'brotli']) @pytest.mark.parametrize('use_rotating_raw_file', [True, False]) @@ -105,6 +107,7 @@ def test_logs_compression(files_dir, suite, config_override, compression_enabled else: assert session_log_path.endswith(".log") +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") def test_compressing_to_unified_file(files_dir, suite, config_override): config_override("log.compression.enabled", True) config_override("log.subpath", slash.config.root.log.session_subpath) @@ -154,7 +157,7 @@ def test_log_symlinks_without_root_path(suite, config_override, symlink_name): config_override('log.{}'.format(symlink_name), 'some/subdir') assert suite.run().ok() - +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") def test_last_test_not_overriden_by_stop_on_error(links_dir, suite): failed_test = suite[4] failed_test.when_run.fail() @@ -192,7 +195,7 @@ def test_result_log_links(files_dir, session): assert result.get_log_path() is not None assert result.get_log_path().startswith(str(files_dir)) - +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") def test_last_failed(suite, links_dir): suite[-5].when_run.fail() last_failed = suite[-2] @@ -216,6 +219,7 @@ def test_errors_log_for_test(suite, suite_test, errors_log_path, logs_dir): lines = f.read().splitlines() assert error_line in lines +@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") @pytest.mark.parametrize('should_keep_failed_tests', [True, False]) def test_logs_deletion(suite, suite_test, errors_log_path, logs_dir, config_override, should_keep_failed_tests): config_override('log.cleanup.enabled', True) From 5d1b16745548bb4510ffb61b0722ad3d866be217 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 11:43:12 -0500 Subject: [PATCH 22/48] Update test_logging.py --- tests/test_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index 740d0c8a..5f4eacbc 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -1,7 +1,7 @@ # pylint: disable=unused-argument,redefined-outer-name import functools import os -omport sys +import sys import logbook import brotli From 2273377985e149176004489c9d8d7ca46a9bd6eb Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 13:58:19 -0500 Subject: [PATCH 23/48] Update conftest.py --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7a9647d3..a058c25d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -282,8 +282,8 @@ def restore_plugins_on_cleanup(request): @pytest.fixture -def logs_dir(config_override, tmpdir, relative_symlinks): - returned = tmpdir.join('logs') +def logs_dir(config_override, tmp_path, relative_symlinks): + returned = tmp_path.join('logs') config_override("log.root", str(returned.join("files"))) config_override("log.last_session_symlink", str("../links/last-session" if relative_symlinks else returned.join("links", "last-session"))) From f835f407a140b2ade3caad9a7425d05d08f27c72 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 14:16:47 -0500 Subject: [PATCH 24/48] Update conftest.py --- tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a058c25d..7a9647d3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -282,8 +282,8 @@ def restore_plugins_on_cleanup(request): @pytest.fixture -def logs_dir(config_override, tmp_path, relative_symlinks): - returned = tmp_path.join('logs') +def logs_dir(config_override, tmpdir, relative_symlinks): + returned = tmpdir.join('logs') config_override("log.root", str(returned.join("files"))) config_override("log.last_session_symlink", str("../links/last-session" if relative_symlinks else returned.join("links", "last-session"))) From c1598245c59b2fd5c5f53f102802f676124eff12 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 14:20:03 -0500 Subject: [PATCH 25/48] Update test_parallel.py --- tests/test_parallel.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 8ce3b286..3edba16d 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -1,6 +1,7 @@ import slash import os import signal +import sys from .utils.suite_writer import Suite from slash.resuming import get_tests_from_previous_session from slash.exceptions import InteractiveParallelNotAllowed, ParallelTimeout @@ -12,6 +13,9 @@ import tempfile import pytest +if sys.platform.startswith("win"): + pytest.skip("does not run on windows", allow_module_level=True) + @pytest.fixture(scope='module', autouse=True) def no_parallel_user_config(request): tmpdir = tempfile.mkdtemp() From 6b8127cca0f570ce01d08c92ed5c52bcadc548db Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 14:53:01 -0500 Subject: [PATCH 26/48] Delete .appveyor.yml --- .appveyor.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 0696eb46..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ -environment: - matrix: - - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # Python 3.0-3.3 have reached EOL - - - PYTHON: "C:\\Python27" - - PYTHON: "C:\\Python35" - - PYTHON: "C:\\Python36" - - PYTHON: "C:\\Python37" - - PYTHON: "C:\\Python27-x64" - - PYTHON: "C:\\Python35-x64" - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python37-x64" - -install: - # Prepend Python installation and scripts (e.g. pytest) to PATH - - set PATH=%PYTHON_INSTALL%;%PYTHON_INSTALL%\\Scripts;%PATH% - - "python -m pip install .[testing,doc]" - -build: off - -test_script: - # run tests - - "pytest" From 0e47650603e7c245c7b49ae36222db639bcb8428 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 14:53:54 -0500 Subject: [PATCH 27/48] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5da3677b..83caaf74 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,10 +13,6 @@ jobs: vmImage: 'vs2017-win2016' strategy: matrix: - Python35: - python.version: '3.5' - Python36: - python.version: '3.6' Python37: python.version: '3.7' maxParallel: 4 From 8aad16175dc6ef14d67997b391cccfb15f7141c9 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Wed, 9 Jan 2019 14:54:16 -0500 Subject: [PATCH 28/48] Update test_parallel.py --- tests/test_parallel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 3edba16d..bf418979 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -2,6 +2,7 @@ import os import signal import sys + from .utils.suite_writer import Suite from slash.resuming import get_tests_from_previous_session from slash.exceptions import InteractiveParallelNotAllowed, ParallelTimeout From 2ce0fe6abef7fc33180f4bd55148eb910b0ff167 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 07:38:54 -0500 Subject: [PATCH 29/48] Update __init__.py --- tests/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index fb78b9dc..8b3ac42a 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -43,7 +43,7 @@ def override_config(self, path, value): def get_new_path(self): returned = tempfile.mkdtemp() - self.addCleanup(shutil.rmtree, returned) + self.addCleanup(shutil.rmtree, returned, ignore_errors=True) return returned _forge = None From 6ab298cc4fc5b23ddafd2cdf5db911cbf06556ea Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 11:09:47 -0500 Subject: [PATCH 30/48] Update azure-pipelines.yml --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ac75bfe8..8999c53f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,6 +34,7 @@ jobs: - script: | py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' + workingDirectory: 'd:\' - task: PublishTestResults@2 inputs: From 2db3f6170128673fba2626fd8e6f4a8818347814 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 11:22:06 -0500 Subject: [PATCH 31/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8999c53f..3153bd82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: - script: | py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' - workingDirectory: 'd:\' + env: TMPDIR: 'd:\temp\' - task: PublishTestResults@2 inputs: From f9a162ff7ae46418a2357498a6c84d6f86d3ce89 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 11:23:54 -0500 Subject: [PATCH 32/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3153bd82..97512331 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: - script: | py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' - env: TMPDIR: 'd:\temp\' + env: {TMPDIR: 'd:\temp\'} - task: PublishTestResults@2 inputs: From 07589811715276e6151ff0cf019aaebacb9e12ce Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 11:43:26 -0500 Subject: [PATCH 33/48] Update azure-pipelines.yml --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 97512331..abfe3dc6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,9 +32,9 @@ jobs: displayName: 'Install dependencies' - script: | - py.test --cov=slash --cov-report=html --sw tests + mkdir d:\temp && py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' - env: {TMPDIR: 'd:\temp\'} + env: {TMPDIR: d:\temp\} - task: PublishTestResults@2 inputs: From 0c14685bd4b88f9be938b0343626f4161a769ca3 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 11:44:36 -0500 Subject: [PATCH 34/48] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abfe3dc6..ac54558b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: - script: | mkdir d:\temp && py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' - env: {TMPDIR: d:\temp\} + env: {TMPDIR: 'd:\temp\'} - task: PublishTestResults@2 inputs: From 12e9ce43afa3fad1a3ff880dd72f72a3ef9f729f Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 12:02:13 -0500 Subject: [PATCH 35/48] Update test_suite_files.py --- tests/test_suite_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_suite_files.py b/tests/test_suite_files.py index bf39af89..fa2758d2 100644 --- a/tests/test_suite_files.py +++ b/tests/test_suite_files.py @@ -24,7 +24,7 @@ def test_iter_suite_paths_files_relpath(filename, paths): f.write(relpath) f.write('\n') - assert [p for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.abspath(p) for p in paths] + assert [os.path.normcase(p) for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.normcase(os.path.abspath(p)) for p in paths] def test_suite_files(suite, suite_test, suite_file): # pylint: disable=unused-argument From cce4fb72e3f3e32d7ca7c92defae9d15ab3c6947 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 12:04:38 -0500 Subject: [PATCH 36/48] Update test_suite_files.py --- tests/test_suite_files.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_suite_files.py b/tests/test_suite_files.py index bf39af89..98787354 100644 --- a/tests/test_suite_files.py +++ b/tests/test_suite_files.py @@ -24,8 +24,7 @@ def test_iter_suite_paths_files_relpath(filename, paths): f.write(relpath) f.write('\n') - assert [p for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.abspath(p) for p in paths] - + assert [os.path.normcase(p) for p, _ in suite_files.iter_suite_file_paths([filename])] == [os.path.normcase(os.path.abspath(p)) for p in paths] def test_suite_files(suite, suite_test, suite_file): # pylint: disable=unused-argument suite.run(args=[]) From 917a087618c9941f5a34a34d3e32c04304411c81 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 12:27:47 -0500 Subject: [PATCH 37/48] Update test_test_loading.py --- tests/test_test_loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_test_loading.py b/tests/test_test_loading.py index 1c6d6b5a..34bd638c 100644 --- a/tests/test_test_loading.py +++ b/tests/test_test_loading.py @@ -54,7 +54,7 @@ def test_dir(tmpdir, names, indices): @pytest.fixture def names(): - return ['a/test_a_b.py', 'a/test_b_a.py', 'b/test_a_a.py', 'b/test_a_b.py'] + return [os.path.normpath(p) for p in ['a/test_a_b.py', 'a/test_b_a.py', 'b/test_a_a.py', 'b/test_a_b.py']] def _sorted_by_indices(items, indices): returned = [None for _ in items] From ae8ab0136c3196ab15126e0ef11c5d85769dfc1a Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 12:48:46 -0500 Subject: [PATCH 38/48] Update test_warnings.py --- tests/test_warnings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_warnings.py b/tests/test_warnings.py index dd3ff4ec..f0f80cdc 100644 --- a/tests/test_warnings.py +++ b/tests/test_warnings.py @@ -1,4 +1,5 @@ # pylint: disable=unused-variable,redefined-outer-name +import os import collections import warnings from contextlib import contextmanager @@ -44,7 +45,7 @@ def warning_added(warning): assert isinstance(w.filename, str) assert w.lineno assert w.filename - assert w.filename.rsplit('/', 1)[-1] == suite_test.file.get_relative_path() + assert w.filename.rsplit(os.path.sep, 1)[-1] == suite_test.file.get_relative_path() warning_type = w.details['type'] assert isinstance(warning_type, str) assert warning_type == 'LogbookWarning' From 52275f90298181c047ff7de439073c7e2dc03f86 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 13:10:43 -0500 Subject: [PATCH 39/48] Delete .appveyor.yml --- .appveyor.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 0696eb46..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ -environment: - matrix: - - # For Python versions available on Appveyor, see - # http://www.appveyor.com/docs/installed-software#python - # Python 3.0-3.3 have reached EOL - - - PYTHON: "C:\\Python27" - - PYTHON: "C:\\Python35" - - PYTHON: "C:\\Python36" - - PYTHON: "C:\\Python37" - - PYTHON: "C:\\Python27-x64" - - PYTHON: "C:\\Python35-x64" - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python37-x64" - -install: - # Prepend Python installation and scripts (e.g. pytest) to PATH - - set PATH=%PYTHON_INSTALL%;%PYTHON_INSTALL%\\Scripts;%PATH% - - "python -m pip install .[testing,doc]" - -build: off - -test_script: - # run tests - - "pytest" From 4c2fbddf08ee2955558c6ee41ad8e3778863ee81 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 13:10:56 -0500 Subject: [PATCH 40/48] Update azure-pipelines.yml --- azure-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ac54558b..fcf7dbdd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,9 +35,3 @@ jobs: mkdir d:\temp && py.test --cov=slash --cov-report=html --sw tests displayName: 'pytest' env: {TMPDIR: 'd:\temp\'} - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() From db586701c503d45a22561aed440b62a77575872d Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 13:37:28 -0500 Subject: [PATCH 41/48] Update azure-pipelines.yml --- azure-pipelines.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fcf7dbdd..0dc73aa7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,6 +32,18 @@ jobs: displayName: 'Install dependencies' - script: | - mkdir d:\temp && py.test --cov=slash --cov-report=html --sw tests + mkdir d:\temp && py.test tests --cov=slash --cov-report=html --cov-report=xml --junitxml=junit/test-results.xml displayName: 'pytest' env: {TMPDIR: 'd:\temp\'} + + - task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testResultsFiles: '**/test-*.xml' + testRunTitle: 'Publish test results for Python $(python.version)' + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' From 4fb9b587228400bab7bed7098954ba8a3a2a5de6 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 14:07:49 -0500 Subject: [PATCH 42/48] Update test_logging.py --- tests/test_logging.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index 5f4eacbc..e92e8a68 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -73,7 +73,6 @@ def _decompress(input_file_name, use_gzip=True): with open(input_file_name, 'rb') as in_f: return brotli.decompress(in_f.read()).decode() -@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") @pytest.mark.parametrize('compression_enabled', [True, False]) @pytest.mark.parametrize('compression_method', ['gzip', 'brotli']) @pytest.mark.parametrize('use_rotating_raw_file', [True, False]) From 4206a1abbef0ccb3762313f0d5bb1b47aed53a79 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Thu, 10 Jan 2019 14:32:56 -0500 Subject: [PATCH 43/48] Update test_logging.py --- tests/test_logging.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index e92e8a68..65f41dc7 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -106,7 +106,6 @@ def test_logs_compression(files_dir, suite, config_override, compression_enabled else: assert session_log_path.endswith(".log") -@pytest.mark.skipif(sys.platform == 'win32', reason="does not run on windows") def test_compressing_to_unified_file(files_dir, suite, config_override): config_override("log.compression.enabled", True) config_override("log.subpath", slash.config.root.log.session_subpath) From 0142971c16c360febb1ca6e94eeeaaeefc83d1ec Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Fri, 11 Jan 2019 09:19:43 -0500 Subject: [PATCH 44/48] osx --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 587b83da..f4ae3e30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: include: - python: "3.6" env: TRAVIS_PYLINT=true + - os : osx # command to run tests, e.g. python setup.py test install: From 7627e43d9b76fb73e7544f5bdbedd4b5e5a4c383 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Fri, 11 Jan 2019 09:37:58 -0500 Subject: [PATCH 45/48] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f4ae3e30..842942f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ matrix: - python: "3.6" env: TRAVIS_PYLINT=true - os : osx + python: "3.7" # command to run tests, e.g. python setup.py test install: From 1b0a84516ad16e214259ee828b401e6e0272273a Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Fri, 11 Jan 2019 09:41:41 -0500 Subject: [PATCH 46/48] Adding Windows to Travis matrix --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index 587b83da..09fc556a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,19 @@ matrix: include: - python: "3.6" env: TRAVIS_PYLINT=true + - os: windows + language: sh + python: 3.7 + before_install: + - choco install python3 + - export PATH="/c/Python37:/c/Python37/Scripts:$PATH" + - python -m pip install --upgrade pip wheel + script: + - python -m virtualenv .env + - .env/Scripts/pip.exe install -e .[testing,doc] + - .env/Scripts/py.test.exe --cov=slash --cov-report=html tests + allow_failures: + os: windows # command to run tests, e.g. python setup.py test install: From 96f535f424a942f3ecefd658cb73955c96221325 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Fri, 11 Jan 2019 10:04:50 -0500 Subject: [PATCH 47/48] Update .travis.yml --- .travis.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 70e46451..f38ff6b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,9 @@ matrix: - python: "3.6" env: TRAVIS_PYLINT=true - os : osx - python: "3.7" + language: generic + python: 3.7 + env: PYTHON=3.7 - os: windows language: sh python: 3.7 @@ -31,6 +33,19 @@ matrix: os: windows # command to run tests, e.g. python setup.py test +before_install: | + if [ "$TRAVIS_OS_NAME" == "osx" ]; then + brew update + brew install openssl readline + brew outdated pyenv || brew upgrade pyenv + brew install pyenv-virtualenv + pyenv install $PYTHON + export PYENV_VERSION=$PYTHON + export PATH="/Users/travis/.pyenv/shims:${PATH}" + pyenv-virtualenv venv + source venv/bin/activate + python --version + fi install: - pip install virtualenv - pip install codecov From 24eea04e891fb0c05ee6097051d1e4c06b56fed1 Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Tue, 22 Jan 2019 08:28:09 -0500 Subject: [PATCH 48/48] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f38ff6b9..ca515e3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ matrix: - .env/Scripts/pip.exe install -e .[testing,doc] - .env/Scripts/py.test.exe --cov=slash --cov-report=html tests allow_failures: - os: windows + - os: windows # command to run tests, e.g. python setup.py test before_install: |