Skip to content

Commit

Permalink
Merge pull request #13 from EducationalTestingService/test/9.0.0
Browse files Browse the repository at this point in the history
Test v9 PyPI package.
  • Loading branch information
desilinguist authored Mar 10, 2022
2 parents 747a53e + 634b176 commit 041c79e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
17 changes: 12 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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"
stage: "test"

# sixth set of test files
testset6:
extends: ".runtests"
variables:
TESTFILES: "test_experiment_rsmxval.py"
stage: "test"
17 changes: 10 additions & 7 deletions DistributeTests.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -20,7 +20,7 @@ jobs:
pool:
vmImage: 'windows-latest'
strategy:
parallel: 5
parallel: 6

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
Expand All @@ -42,15 +42,15 @@ 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'
- powershell: ./DistributeTests.ps1
- powershell: ./DistributeTests.ps1
displayName: 'PowerShell Script to distribute tests'

- script: |
Expand Down

0 comments on commit 041c79e

Please sign in to comment.