Skip to content

Commit

Permalink
use nose2 in pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamar Lavee committed Aug 14, 2023
1 parent 646bbc2 commit c80644b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ variables:
- echo "tests/*" > .git/info/sparse-checkout
- git pull --depth=1 origin main
- 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 nose parameterized
- /root/rsmenv/bin/pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple rsmtool nose2 parameterized

script:
- "/root/rsmenv/bin/nosetests --nologcapture -w ${TESTDIR} ${TESTFILES}"
- "/root/rsmenv/bin/nose2 --quiet -s ${TESTDIR} ${TESTFILES}"

# first set of test files
testset1:
Expand Down
54 changes: 27 additions & 27 deletions DistributeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,43 @@ Write-Host "Total tests: $testCount"
$testsToRun= @()

if ($agentNumber -eq 1) {
$testsToRun = $testsToRun + "test_experiment_rsmtool_1.py"
$testsToRun = $testsToRun + "test_experiment_rsmtool_1"
}
elseif ($agentNumber -eq 2) {
$testsToRun = $testsToRun + "test_comparer.py"
$testsToRun = $testsToRun + "test_configuration_parser.py"
$testsToRun = $testsToRun + "test_experiment_rsmtool_2.py"
$testsToRun = $testsToRun + "test_container.py"
$testsToRun = $testsToRun + "test_comparer"
$testsToRun = $testsToRun + "test_configuration_parser"
$testsToRun = $testsToRun + "test_experiment_rsmtool_2"
$testsToRun = $testsToRun + "test_container"
}
elseif ($agentNumber -eq 3) {
$testsToRun = $testsToRun + "test_analyzer.py"
$testsToRun = $testsToRun + "test_experiment_rsmeval.py"
$testsToRun = $testsToRun + "test_fairness_utils.py"
$testsToRun = $testsToRun + "test_utils_prmse.py"
$testsToRun = $testsToRun + "test_test_utils.py"
$testsToRun = $testsToRun + "test_cli.py"
$testsToRun = $testsToRun + "test_analyzer"
$testsToRun = $testsToRun + "test_experiment_rsmeval"
$testsToRun = $testsToRun + "test_fairness_utils"
$testsToRun = $testsToRun + "test_utils_prmse"
$testsToRun = $testsToRun + "test_test_utils"
$testsToRun = $testsToRun + "test_cli"
}
elseif ($agentNumber -eq 4) {
$testsToRun = $testsToRun + "test_experiment_rsmcompare.py"
$testsToRun = $testsToRun + "test_experiment_rsmsummarize.py"
$testsToRun = $testsToRun + "test_modeler.py"
$testsToRun = $testsToRun + "test_preprocessor.py"
$testsToRun = $testsToRun + "test_writer.py"
$testsToRun = $testsToRun + "test_experiment_rsmtool_3.py"
$testsToRun = $testsToRun + "test_experiment_rsmcompare"
$testsToRun = $testsToRun + "test_experiment_rsmsummarize"
$testsToRun = $testsToRun + "test_modeler"
$testsToRun = $testsToRun + "test_preprocessor"
$testsToRun = $testsToRun + "test_writer"
$testsToRun = $testsToRun + "test_experiment_rsmtool_3"
}
elseif ($agentNumber -eq 5) {
$testsToRun = $testsToRun + "test_experiment_rsmpredict.py"
$testsToRun = $testsToRun + "test_reader.py"
$testsToRun = $testsToRun + "test_reporter.py"
$testsToRun = $testsToRun + "test_transformer.py"
$testsToRun = $testsToRun + "test_utils.py"
$testsToRun = $testsToRun + "test_experiment_rsmtool_4.py"
$testsToRun = $testsToRun + "test_experiment_rsmpredict"
$testsToRun = $testsToRun + "test_reader"
$testsToRun = $testsToRun + "test_reporter"
$testsToRun = $testsToRun + "test_transformer"
$testsToRun = $testsToRun + "test_utils"
$testsToRun = $testsToRun + "test_experiment_rsmtool_4"
}
elseif ($agentNumber -eq 6) {
$testsToRun = $testsToRun + "test_experiment_rsmxval.py"
$testsToRun = $testsToRun + "test_experiment_rsmexplain.py"
$testsToRun = $testsToRun + "test_explanation_utils.py"

$testsToRun = $testsToRun + "test_experiment_rsmxval"
$testsToRun = $testsToRun + "test_experiment_rsmexplain"
$testsToRun = $testsToRun + "test_explanation_utils"
$testsToRun = $testsToRun + "test_wandb"
}

# join all test files seperated by space. pytest runs multiple test files in following format pytest test1.py test2.py test3.py
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
displayName: "Update conda"
- script: |
conda create --name rsmenv --yes --quiet -c conda-forge -c ets python=%PYTHON_VERSION% nose parameterized
conda create --name rsmenv --yes --quiet -c conda-forge -c ets python=%PYTHON_VERSION% nose2 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
Expand All @@ -56,12 +56,12 @@ jobs:
- script: |
echo $(pytestfiles)
CALL activate rsmenv
nosetests --with-xunit -w %TESTDIR% $(pytestfiles)
nose2 --quiet -s %TESTDIR% $(pytestfiles)
displayName: 'Run tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: 'nosetests.xml'
testResultsFiles: 'junit.xml'
testRunTitle: 'RSMTool tests'
condition: succeededOrFailed()

0 comments on commit c80644b

Please sign in to comment.