Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test everything always #1003

Merged
merged 11 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ env/
spack-build_stage/
spack-test_stage/
spack-misc_cache/
user-config/
user-config/linux/
user-cache/
30 changes: 15 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ pipeline {
}
post {
always {
archiveArtifacts artifacts: 'log/**/*.log', allowEmptyArchive: true
withCredentials([string(credentialsId: 'd976fe24-cabf-479e-854f-587c152644bc', variable: 'GITHUB_AUTH_TOKEN')]) {
sh """
source env/bin/activate
python3 src/report_tests.py --auth_token ${GITHUB_AUTH_TOKEN} --build_id ${BUILD_ID} --issue_id ${ghprbPullId}
"""
}
sh """
python3 tools/summarize_logs.py || true
"""
archiveArtifacts artifacts: 'log/*', allowEmptyArchive: true
deleteDir()
}
}
Expand All @@ -32,36 +29,39 @@ pipeline {
"""
}
}
stage('Unit Tests') {
stage('Bootstrap spack') {
steps {
sh """
mkdir -p log/${NODENAME}/unit_test
source env/bin/activate
python3 test/unit_test.py ${NODENAME} > log/${NODENAME}/unit_test/summary.log 2>&1
source ./setup-env.sh
spack spec gnuconfig
"""
}
}
stage('Bootstrap spack') {
stage('Unit Tests') {
steps {
sh """
source env/bin/activate
. ./setup-env.sh
spack spec gnuconfig
python3 test/unit_test.py
"""
}
}
stage('Integration Tests') {
steps {
sh """
source env/bin/activate
pytest -v -n auto --scope \"""" + env.ghprbCommentBody + " \" test/integration_test.py"
source ./setup-env.sh $USER_ENV_ROOT
pytest -v -n auto test/integration_test.py
"""
}
}
stage('System Tests') {
steps {
sh """
source env/bin/activate
pytest -v -n auto --maxprocesses=24 --scope \"""" + env.ghprbCommentBody + " \" test/system_test.py"
source ./setup-env.sh $USER_ENV_ROOT
pytest -v -n auto test/system_test.py
"""
}
}
}
Expand Down
27 changes: 12 additions & 15 deletions setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@
parent_dir=$( cd "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" ; pwd -P )

if [[ "$#" == 1 ]]; then
machine="$1"
else
machine="$( "$parent_dir"/src/machine.sh )"
if [[ "$machine" == "balfrin" || "$machine" == "tasna" ]]; then
machine="/mch-environment/v6"
fi
fi
uenv="$1"
export SPACK_UENV_PATH="$uenv"
export SPACK_SYSTEM_CONFIG_PATH="$uenv"/config

if [[ ${machine:0:1} == "/" ]]; then
export SPACK_SYSTEM_CONFIG_PATH="$machine"/config
export SPACK_USER_CONFIG_PATH="$parent_dir"/sysconfigs/uenv
else
export SPACK_SYSTEM_CONFIG_PATH="$parent_dir"/sysconfigs/"$machine"
export SPACK_USER_CONFIG_PATH="$parent_dir"/user-config
if [[ $uenv == "euler" ]]; then
export SPACK_SYSTEM_CONFIG_PATH="$parent_dir"/sysconfigs/euler
fi
fi

export SPACK_USER_CONFIG_PATH="$parent_dir"/user-config
export SPACK_USER_CACHE_PATH="$parent_dir"/user-cache

. "$parent_dir"/spack/share/spack/setup-env.sh

echo Spack configured for "$machine".
if [[ -n "$uenv" ]]; then
echo Spack configured with upstream "$uenv".
else
echo Spack configured with no upstream.
fi
34 changes: 0 additions & 34 deletions src/format.py

This file was deleted.

87 changes: 0 additions & 87 deletions src/github.py

This file was deleted.

90 changes: 0 additions & 90 deletions src/report_tests.py

This file was deleted.

34 changes: 0 additions & 34 deletions src/scope.py

This file was deleted.

Loading
Loading