From e86e1008fac3aaa5471a36229f92e6aebf273f77 Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Tue, 8 Mar 2022 18:56:34 -0500 Subject: [PATCH 1/2] Update YAML files and include rsmxval tests. --- .gitlab-ci.yml | 17 ++++++++++++----- DistributeTests.ps1 | 17 ++++++++++------- azure-pipelines.yml | 8 ++++---- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c433e20..01b73b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,11 +4,11 @@ stages: - test variables: - PYVERSION: "3.7" - RSMVERSION: "8.1.2" + PYVERSION: "3.8" + RSMVERSION: "9.0.0" BINPATH: "/root/rsmenv/bin" TESTDIR: "/root/rsmcode/tests" - + # set up the basic job to run only for pull requests .runtests: only: @@ -21,7 +21,7 @@ variables: - git config core.sparsecheckout true - echo "tests/*" > .git/info/sparse-checkout - git pull --depth=1 origin main - - conda create --prefix /root/rsmenv python=3.7 --yes + - conda create --prefix /root/rsmenv python=${PYVERSION} --yes - /root/rsmenv/bin/pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple rsmtool==${RSMVERSION} nose parameterized script: @@ -60,4 +60,11 @@ testset5: extends: ".runtests" variables: TESTFILES: "test_experiment_rsmpredict.py test_reader.py test_reporter.py test_transformer.py test_utils.py test_experiment_rsmtool_4.py" - stage: "test" \ No newline at end of file + stage: "test" + +# sixth set of test files +testset6: + extends: ".runtests" + variables: + TESTFILES: "test_experiment_rsmxval.py" + stage: "test" diff --git a/DistributeTests.ps1 b/DistributeTests.ps1 index 8d320b9..6a3074c 100644 --- a/DistributeTests.ps1 +++ b/DistributeTests.ps1 @@ -1,9 +1,9 @@ -<# -.SYNOPSIS - Distribute the tests in VSTS pipeline across multiple agents -.DESCRIPTION +<# +.SYNOPSIS + Distribute the tests in VSTS pipeline across multiple agents +.DESCRIPTION This script divides test files across multiple agents for running on Azure DevOps. - It is adapted from the script in this repository: + It is adapted from the script in this repository: https://github.com/PBoraMSFT/ParallelTestingSample-Python/blob/master/DistributeTests.ps1 The distribution is basically identical to the way we do it in .travis.yaml @@ -61,9 +61,12 @@ elseif ($agentNumber -eq 5) { $testsToRun = $testsToRun + "test_utils.py" $testsToRun = $testsToRun + "test_experiment_rsmtool_4.py" } +elseif ($agentNumber -eq 6) { + $testsToRun = $testsToRun + "test_experiment_rsmxval.py" +} # join all test files seperated by space. pytest runs multiple test files in following format pytest test1.py test2.py test3.py $testFiles = $testsToRun -Join " " Write-Host "Test files $testFiles" -# write these files into variable so that we can run them using pytest in subsequent task. -Write-Host "##vso[task.setvariable variable=pytestfiles;]$testFiles" +# write these files into variable so that we can run them using pytest in subsequent task. +Write-Host "##vso[task.setvariable variable=pytestfiles;]$testFiles" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3d818a2..c22ffc0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,8 +5,8 @@ variables: MPLBACKEND: Agg - PYTHON_VERSION: 3.8 - RSMVERSION: 8.1.2 + PYTHON_VERSION: 3.10 + RSMVERSION: 9.0.0 TESTDIR: $(Build.SourcesDirectory)\rsmcode\tests BINPATH: C:\Miniconda\envs\rsmenv\Scripts @@ -20,7 +20,7 @@ jobs: pool: vmImage: 'windows-latest' strategy: - parallel: 5 + parallel: 6 steps: - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" @@ -50,7 +50,7 @@ jobs: conda install -c conda-forge --yes pywin32 displayName: 'Install TestPyPI package for RSMTool' - - powershell: ./DistributeTests.ps1 + - powershell: ./DistributeTests.ps1 displayName: 'PowerShell Script to distribute tests' - script: | From 634b17669cef377e7d5626c9c6aab3f010bd4e3a Mon Sep 17 00:00:00 2001 From: Nitin Madnani Date: Tue, 8 Mar 2022 21:06:50 -0500 Subject: [PATCH 2/2] Install nose via conda instead of via pip. --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c22ffc0..800792b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,10 +42,10 @@ jobs: displayName: "Update conda" - script: | - conda create --name rsmenv --yes --quiet -c conda-forge -c ets python=%PYTHON_VERSION% + conda create --name rsmenv --yes --quiet -c conda-forge -c ets python=%PYTHON_VERSION% nose parameterized conda init cmd.exe CALL activate rsmenv - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple rsmtool==%RSMVERSION% nose parameterized + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple rsmtool==%RSMVERSION% pip uninstall --yes pywin32 conda install -c conda-forge --yes pywin32 displayName: 'Install TestPyPI package for RSMTool'