Skip to content

Commit

Permalink
mark F2/GNIRS wavecal tests as "wavecal" and parallelize instrument-s…
Browse files Browse the repository at this point in the history
…pecific tests
  • Loading branch information
chris-simpson committed Apr 20, 2024
1 parent 734b740 commit 18fd64d
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 150 deletions.
291 changes: 147 additions & 144 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -186,154 +186,157 @@ pipeline {
} // end parallel
}

stage('F2 Tests') {
when {
expression { runtests_f2 == 1 }
}
stage('Instrument tests') {
stage('F2 Tests') {
when {
expression { runtests_f2 == 1 }
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "f2_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/f2/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-f2 -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/f2_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F f2'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside F2 Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-f2/reports/*_results.xml'
)
echo "Deleting F2 Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('GSAOI Tests') {
when {
expression { runtests_gsaoi == 1 }
}
agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "f2_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/f2/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-f2 -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/f2_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F f2'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside F2 Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-f2/reports/*_results.xml'
)
echo "Deleting F2 Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('GSAOI Tests') {
when {
expression { runtests_gsaoi == 1 }
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "gsaoi_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/gsaoi/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gsaoi -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gsaoi_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F gsaoi'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside GSAOI Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-gsaoi/reports/*_results.xml'
)
echo "Deleting GSAOI Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('NIRI Tests') {
when {
expression { runtests_niri == 1 }
}
agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "gsaoi_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/gsaoi/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gsaoi -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gsaoi_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F gsaoi'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside GSAOI Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-gsaoi/reports/*_results.xml'
)
echo "Deleting GSAOI Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('NIRI Tests') {
when {
expression { runtests_niri == 1 }
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "niri_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/niri/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-niri -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/niri_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F niri'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside NIRI Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-niri/reports/*_results.xml'
)
echo "Deleting NIRI Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('GNIRS Tests') {
when {
expression { runtests_gnirs == 1 }
}
agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "niri_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/niri/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-niri -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/niri_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F niri'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside NIRI Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-niri/reports/*_results.xml'
)
echo "Deleting NIRI Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('GNIRS Tests') {
when {
expression { runtests_gnirs == 1 }
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "gnirs_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/gnirs/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gnirs -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gnirs_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F gnirs'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside GNIRS Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-gnirs/reports/*_results.xml'
)
echo "Deleting GNIRS Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
}

agent { label "master" }
environment {
MPLBACKEND = "agg"
DRAGONS_TEST_OUT = "gnirs_tests_outputs"
TOX_ARGS = "astrodata geminidr gemini_instruments gempy recipe_system"
TMPDIR = "${env.WORKSPACE}/.tmp/gnirs/"
}
steps {
echo "Running build #${env.BUILD_ID} on ${env.NODE_NAME}"
checkout scm
sh '.jenkins/scripts/setup_dirs.sh'
echo "Running tests"
sh 'tox -e py310-gnirs -v -- --basetemp=${DRAGONS_TEST_OUT} --junit-xml reports/gnirs_results.xml ${TOX_ARGS}'
echo "Reporting coverage"
sh 'tox -e codecov -- -F gnirs'
} // end steps
post {
always {
echo "Running 'archivePlots' from inside GNIRS Tests"
archiveArtifacts artifacts: "plots/*", allowEmptyArchive: true
junit (
allowEmptyResults: true,
testResults: '.tmp/py310-gnirs/reports/*_results.xml'
)
echo "Deleting GNIRS Tests workspace ${env.WORKSPACE}"
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
} // end always
} // end post
} // end stage
stage('WaveCal Tests') {
when {
expression { runtests_wavecal == 1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
}

# Tests Definitions ------------------------------------------------------------
@pytest.mark.slow
@pytest.mark.wavecal
@pytest.mark.preprocessed_data
@pytest.mark.regression
@pytest.mark.parametrize("ad, params", input_pars, indirect=['ad'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@


# Tests Definitions ------------------------------------------------------------
@pytest.mark.slow
@pytest.mark.wavecal
@pytest.mark.preprocessed_data
@pytest.mark.regression
@pytest.mark.parametrize("ad, params", input_pars, indirect=['ad'])
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ commands =
integ: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "integration_test and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
gmosls: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "gmosls and not slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
wavecal: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
f2: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(f2 or f2ls or f2image) and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
f2: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(f2 or f2ls or f2image) and not slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
gsaoi: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(gsaoi or gsaoiimage) and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
niri: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(niri or nirils or niriimage) and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
gnirs: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(gnirs or gnirsls or gnirsimage) and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
niri: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(niri or nirils or niriimage) and not slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
gnirs: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(gnirs or gnirsls or gnirsimage) and not slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
ghost: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "(ghost or ghostbundle or ghostslit or ghostspect) and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
reg: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "regression and not slow" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
reg: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "regression and not slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
slow: python -m coverage run --rcfile={toxinidir}/.coveragerc -m pytest -v --dragons-remote-data --durations=20 -m "slow and not wavecal" {posargs:astrodata geminidr gemini_instruments gempy recipe_system}
docs: sphinx-build {posargs} . _build/html

Expand Down

0 comments on commit 18fd64d

Please sign in to comment.