From f69c98f0a110d3341df5911480d5b2ad478cf049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Guilherme?= Date: Sat, 1 Dec 2018 14:40:32 +0000 Subject: [PATCH 01/10] Set up CI with Azure Pipelines --- azure-pipelines.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..c3bdce76c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,58 @@ +# 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 + +jobs: + +- job: 'Test' + pool: + vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'Ubuntu 16.04', 'vs2017-win2016' + strategy: + matrix: + Python27: + browser: 'Ie' + robot.options: '--dotted' + python.version: '2.7' + Python36: + browser: 'Ie' + robot.options: '--dotted' + python.version: '3.6' + Python37: + browser: 'Ie' + robot.options: '--dotted' + python.version: '3.7' + maxParallel: 3 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements.txt + displayName: 'Install dependencies' + + - script: | + python atest/run.py %BROWSER% --interpreter python%PYTHON_VERSION% %ROBOT_OPTIONS% + displayName: 'acceptance tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/atest/results/* + testRunTitle: 'Python %PYTHON_VERSION%' + condition: succeededOrFailed() + +- job: 'Publish' + dependsOn: 'Test' + pool: + vmImage: 'vs2017-win2016' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' + architecture: 'x64' + + - script: python setup.py sdist + displayName: 'Build sdist' From 1c8b05d960b11e40c72f9b29d415f0fc43ebac53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Guilherme?= Date: Sat, 1 Dec 2018 14:46:22 +0000 Subject: [PATCH 02/10] Update azure-pipelines.yml --- azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3bdce76c..a2be8e0b8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,15 +12,15 @@ jobs: matrix: Python27: browser: 'Ie' - robot.options: '--dotted' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '2.7' Python36: browser: 'Ie' - robot.options: '--dotted' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.6' Python37: browser: 'Ie' - robot.options: '--dotted' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.7' maxParallel: 3 @@ -39,7 +39,7 @@ jobs: - task: PublishTestResults@2 inputs: - testResultsFiles: '**/atest/results/* + testResultsFiles: '**/atest/results/results.xml' testRunTitle: 'Python %PYTHON_VERSION%' condition: succeededOrFailed() From ea7c24dd65a86445d2d1a25ecdcee96f48635f11 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sat, 1 Dec 2018 18:17:12 +0000 Subject: [PATCH 03/10] Fix environment variables for Azure style. Added requirements-dev.txt --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a2be8e0b8..180b73b5a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,17 +30,17 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements.txt + - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt displayName: 'Install dependencies' - script: | - python atest/run.py %BROWSER% --interpreter python%PYTHON_VERSION% %ROBOT_OPTIONS% + python atest/run.py $(browser) --interpreter 'python$(python.version)' $(robot.options) displayName: 'acceptance tests' - task: PublishTestResults@2 inputs: testResultsFiles: '**/atest/results/results.xml' - testRunTitle: 'Python %PYTHON_VERSION%' + testRunTitle: 'Python $(python.version)' condition: succeededOrFailed() - job: 'Publish' From c61438f3135f8f21390e36499cc4c8136dfa2f65 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 2 Dec 2018 02:51:58 +0000 Subject: [PATCH 04/10] Adds the possibility to run tests on Windows. --- atest/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atest/run.py b/atest/run.py index 23ad3ca33..0b6781c70 100755 --- a/atest/run.py +++ b/atest/run.py @@ -225,7 +225,7 @@ def sauce_credentials(sauce_username, sauce_key): if args.nounit: print('Not running unit tests.') else: - rc = subprocess.call([interpreter, UNIT_TEST_RUNNER]) + rc = subprocess.call([interpreter, UNIT_TEST_RUNNER], shell=(os.name == 'nt')) if rc != 0: print('Not running acceptance test, because unit tests failed.') sys.exit(rc) From 0db2b03f70a2696d4d92fc32e4bf53c9fec19505 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 2 Dec 2018 03:00:17 +0000 Subject: [PATCH 05/10] Fix interpreter command. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 180b73b5a..c9f416514 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: displayName: 'Install dependencies' - script: | - python atest/run.py $(browser) --interpreter 'python$(python.version)' $(robot.options) + python atest/run.py $(browser) --interpreter python $(robot.options) displayName: 'acceptance tests' - task: PublishTestResults@2 From 40185a13184a929bf034c5f91dc90689f72d846f Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 2 Dec 2018 15:48:46 +0000 Subject: [PATCH 06/10] Attempt to get and set IEDriverServer. --- azure-pipelines.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 180b73b5a..e02f54636 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,8 @@ # 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 +# +# See https://github.com/Microsoft/azure-pipelines-tasks/issues/8798 for the solution to download files jobs: @@ -24,8 +26,28 @@ jobs: python.version: '3.7' maxParallel: 3 + - task: PythonScript@0 + inputs: + url: 'http://selenium-release.storage.googleapis.com/3.141/IEDriverServer_Win32_3.141.0.zip' + fileName: '$(Build.SourcesDirectory)IEDriverServer_Win32.zip' + scriptSource: 'inline' + script: from urllib.request import urlretrieve; urlretrieve('$(url)', '$(fileName)') + displayName: 'Get IeDriverServer' + + - task: ExtractFiles@0 + inputs: + archiveFilePatterns: '*.zip' + destinationFolder: $(Build.SourcesDirectory) + #cleanDestinationFolder: true + displayName: 'Extract IeDriverServer' + variables: + Path: $(Build.SourcesDirectory);$(Path) + steps: - - task: UsePythonVersion@0 + - script: echo Path is $(Path) + + steps: + - task: UsePythonVersion@1 inputs: versionSpec: '$(python.version)' architecture: 'x64' From 85073326a1cbdcfefb903bb70274d484434851e0 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 2 Dec 2018 22:41:50 +0000 Subject: [PATCH 07/10] Comment one block. Same structure as original. --- azure-pipelines.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9f13759b9..d3ac51e78 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,11 +13,11 @@ jobs: strategy: matrix: Python27: - browser: 'Ie' + browser: 'Chrome' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '2.7' Python36: - browser: 'Ie' + browser: 'Firefox' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.6' Python37: @@ -27,22 +27,6 @@ jobs: maxParallel: 3 steps: - - task: PythonScript@0 - inputs: - url: 'http://selenium-release.storage.googleapis.com/3.141/IEDriverServer_Win32_3.141.0.zip' - fileName: '$(Build.SourcesDirectory)IEDriverServer_Win32.zip' - scriptSource: 'inline' - script: from urllib.request import urlretrieve; urlretrieve('$(url)', '$(fileName)') - displayName: 'Get IeDriverServer' - - - task: ExtractFiles@0 - inputs: - archiveFilePatterns: '*.zip' - destinationFolder: $(Build.SourcesDirectory) - #cleanDestinationFolder: true - displayName: 'Extract IeDriverServer' - Path: $(Build.SourcesDirectory);$(Path) - - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' @@ -55,7 +39,7 @@ jobs: python atest/run.py $(browser) --interpreter python $(robot.options) displayName: 'acceptance tests' - - task: PublishTestResults@0 + - task: PublishTestResults@2 inputs: testResultsFiles: '**/atest/results/results.xml' testRunTitle: 'Python $(python.version)' @@ -67,7 +51,7 @@ jobs: vmImage: 'vs2017-win2016' steps: - - task: UsePythonVersion@1 + - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' From a32a63bb110d75ecf327dbe4ae2575ed8137bb20 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Sun, 2 Dec 2018 23:53:27 +0000 Subject: [PATCH 08/10] Saved azure config for Windows. Set azure config for MacOS. --- azure-pipelines.yml | 6 ++-- azure-pipelines_windows.yml | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 azure-pipelines_windows.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d3ac51e78..7231ae500 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ jobs: - job: 'Test' pool: - vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'Ubuntu 16.04', 'vs2017-win2016' + vmImage: 'macOS-10.13' # other options: 'macOS-10.13', 'Ubuntu 16.04', 'vs2017-win2016' strategy: matrix: Python27: @@ -21,7 +21,7 @@ jobs: robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.6' Python37: - browser: 'Ie' + browser: 'Safari' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.7' maxParallel: 3 @@ -48,7 +48,7 @@ jobs: - job: 'Publish' dependsOn: 'Test' pool: - vmImage: 'vs2017-win2016' + vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 diff --git a/azure-pipelines_windows.yml b/azure-pipelines_windows.yml new file mode 100644 index 000000000..d3ac51e78 --- /dev/null +++ b/azure-pipelines_windows.yml @@ -0,0 +1,60 @@ +# 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 +# +# See https://github.com/Microsoft/azure-pipelines-tasks/issues/8798 for the solution to download files + +jobs: + +- job: 'Test' + pool: + vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'Ubuntu 16.04', 'vs2017-win2016' + strategy: + matrix: + Python27: + browser: 'Chrome' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' + python.version: '2.7' + Python36: + browser: 'Firefox' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' + python.version: '3.6' + Python37: + browser: 'Ie' + robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' + python.version: '3.7' + maxParallel: 3 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt + displayName: 'Install dependencies' + + - script: | + python atest/run.py $(browser) --interpreter python $(robot.options) + displayName: 'acceptance tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/atest/results/results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + +- job: 'Publish' + dependsOn: 'Test' + pool: + vmImage: 'vs2017-win2016' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' + architecture: 'x64' + + - script: python setup.py sdist + displayName: 'Build sdist' From 5af028054c337f2f147142f0003159d26847568a Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Tue, 18 Dec 2018 22:05:34 +0000 Subject: [PATCH 09/10] Adds webdrivermanager tool. --- azure-pipelines.yml | 8 ++++---- requirements-dev.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7231ae500..8b41ec3be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,15 +13,15 @@ jobs: strategy: matrix: Python27: - browser: 'Chrome' + browser: 'chrome' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '2.7' Python36: - browser: 'Firefox' + browser: 'firefox' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.6' Python37: - browser: 'Safari' + browser: 'chrome' robot.options: '--xunit results.xml --xunitskipnoncritical --dotted' python.version: '3.7' maxParallel: 3 @@ -32,7 +32,7 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt + - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt && webdrivermanager $(browser) displayName: 'Install dependencies' - script: | diff --git a/requirements-dev.txt b/requirements-dev.txt index af2ac9005..853db2adf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,6 +4,7 @@ mockito >= 1.0.0 robotstatuschecker approvaltests >= 0.2.4 +webdrivermanager >= 0.5.0 # Include normal dependencies from requirements.txt. Makes it possible to use # requirements-dev.txt as a single requirement file in PyCharm and other IDEs. From 4422166dda8aaea2b6f871b399ecb2e5441f6075 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Tue, 18 Dec 2018 23:03:30 +0000 Subject: [PATCH 10/10] Adds webdriver to PATH --- azure-pipelines.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8b41ec3be..42422edfb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,9 +32,14 @@ jobs: versionSpec: '$(python.version)' architecture: 'x64' - - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt && webdrivermanager $(browser) + - script: python -m pip install --upgrade pip && pip install robotstatuschecker && pip install -r requirements-dev.txt && webdrivermanager -d /Users/vsts/bin $(browser) displayName: 'Install dependencies' + - script: | + export PATH=$(PATH):/Users/vsts/bin + echo $(PATH) $PATH + displayName: 'Add webdriver to PATH' + - script: | python atest/run.py $(browser) --interpreter python $(robot.options) displayName: 'acceptance tests'