mirror of
https://github.com/meganz/MEGAcmd
synced 2025-09-01 06:15:09 +00:00
Run legacy python and shell script tests in one stage.
This commit is contained in:
@@ -109,4 +109,4 @@ FROM base as final
|
|||||||
|
|
||||||
ENV LD_LIBRARY_PATH /usr/local/lib
|
ENV LD_LIBRARY_PATH /usr/local/lib
|
||||||
COPY --from=build /usr/local/ /usr/local/
|
COPY --from=build /usr/local/ /usr/local/
|
||||||
COPY tests/*.py tests/*.sh /usr/local/bin/
|
COPY --chmod=654 tests/*.py tests/*.sh /usr/local/bin/
|
||||||
|
@@ -101,7 +101,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage("Build MEGAcmd"){
|
stage("Build MEGAcmd and run legacy integration tests"){
|
||||||
matrix {
|
matrix {
|
||||||
axes {
|
axes {
|
||||||
axis {
|
axis {
|
||||||
@@ -128,7 +128,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Run legacy MEGAcmd integration shell tests') {
|
stage('Run legacy MEGAcmd integration tests') {
|
||||||
matrix {
|
matrix {
|
||||||
axes {
|
axes {
|
||||||
axis {
|
axis {
|
||||||
@@ -137,16 +137,15 @@ pipeline {
|
|||||||
}
|
}
|
||||||
axis {
|
axis {
|
||||||
name 'TEST_SCRIPT'
|
name 'TEST_SCRIPT'
|
||||||
// megacmd_get_test.sh is disabled for now, as it needs two MEGA accounts
|
values 'megacmd_find_test.sh', 'megacmd_put_test.sh', 'megacmd_rm_test.sh', 'megacmd_find_test.py', 'megacmd_put_test.py', 'megacmd_rm_test.py'
|
||||||
values 'megacmd_find_test.sh', 'megacmd_put_test.sh', 'megacmd_rm_test.sh'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stages{
|
stages{
|
||||||
stage('Run MEGAcmd integration test scripts') {
|
stage('Run MEGAcmd integration test scripts requiring a single account') {
|
||||||
environment{
|
environment{
|
||||||
MEGA_EMAIL=''
|
MEGA_EMAIL=''
|
||||||
MEGA_PWD=credentials('MEGACMD_TESTS_PASSWORD')
|
MEGA_PWD=credentials('MEGACMD_TESTS_PASSWORD')
|
||||||
ASAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-asan-report"
|
ASAN_OPTIONS="atexit=1,print_stats=1,log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-asan-report"
|
||||||
TSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-tsan-report"
|
TSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-tsan-report"
|
||||||
UBSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-ubsan-report"
|
UBSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-ubsan-report"
|
||||||
}
|
}
|
||||||
@@ -155,7 +154,7 @@ pipeline {
|
|||||||
dir('test-results') {
|
dir('test-results') {
|
||||||
script {
|
script {
|
||||||
try {
|
try {
|
||||||
sh "docker run --user \$(id -u):\$(id -g) --env ASAN_OPTIONS --env TSAN_OPTIONS --env HOME=/tmp --env MEGA_EMAIL --env MEGA_PWD --rm --mount type=bind,src='${megacmd_sources_workspace}/test-results',target=/tmp/test-results -- meganz/megacmd-autotools-${SANITIZERS}:${env.BUILD_NUMBER} /usr/bin/bash -c '/usr/local/bin/mega-cmd-server > /dev/null & sleep 5 && mkdir /tmp/tests && cd /tmp/tests && bash -x /usr/local/bin/${TEST_SCRIPT}'"
|
sh "docker run --user \$(id -u):\$(id -g) --env ASAN_OPTIONS --env TSAN_OPTIONS --env HOME=/tmp --env MEGA_EMAIL --env MEGA_PWD --rm -- meganz/megacmd-autotools-${SANITIZERS}:${env.BUILD_NUMBER} /usr/bin/bash -c '/usr/local/bin/mega-cmd-server > /dev/null & sleep 1 && mkdir /tmp/tests && cd /tmp/tests && /usr/local/bin/${TEST_SCRIPT}'"
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (env.SANITIZERS == 'tsan'){
|
if (env.SANITIZERS == 'tsan'){
|
||||||
echo "${env.SANITIZERS} sanitizer build are expected to fail for now, will keep the build as successful"
|
echo "${env.SANITIZERS} sanitizer build are expected to fail for now, will keep the build as successful"
|
||||||
@@ -171,50 +170,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Run legacy MEGAcmd integration Python tests') {
|
stage('Run GTest MEGAcmd tests') {
|
||||||
matrix {
|
|
||||||
axes {
|
|
||||||
axis {
|
|
||||||
name 'SANITIZERS'
|
|
||||||
values 'ubsan', 'asan', 'tsan'
|
|
||||||
}
|
|
||||||
axis {
|
|
||||||
name 'TEST_SCRIPT'
|
|
||||||
// megacmd_get_test.sh is disabled for now, as it needs two MEGA accounts
|
|
||||||
values 'megacmd_find_test.py', 'megacmd_put_test.py', 'megacmd_rm_test.py'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stages{
|
|
||||||
stage('Run MEGAcmd integration test scripts') {
|
|
||||||
environment{
|
|
||||||
MEGA_EMAIL=''
|
|
||||||
MEGA_PWD=credentials('MEGACMD_TESTS_PASSWORD')
|
|
||||||
ASAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-asan-report"
|
|
||||||
TSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-tsan-report"
|
|
||||||
UBSAN_OPTIONS="log_path=/tmp/test-results/megacmd-${TEST_SCRIPT}-ubsan-report"
|
|
||||||
}
|
|
||||||
steps{
|
|
||||||
lock(label: 'testing_accounts_megacmd', variable: 'MEGA_EMAIL', quantity: 1, resource: null){
|
|
||||||
dir('test-results') {
|
|
||||||
script {
|
|
||||||
try {
|
|
||||||
sh "docker run --user \$(id -u):\$(id -g) --env ASAN_OPTIONS --env TSAN_OPTIONS --env HOME=/tmp --env MEGA_EMAIL --env MEGA_PWD --rm --mount type=bind,src='${megacmd_sources_workspace}/test-results',target=/tmp/test-results -- meganz/megacmd-autotools-${SANITIZERS}:${env.BUILD_NUMBER} /usr/bin/bash -c '/usr/local/bin/mega-cmd-server > /dev/null & sleep 1 && mkdir /tmp/tests && cd /tmp/tests && python3 /usr/local/bin/${TEST_SCRIPT}'"
|
|
||||||
} catch(e) {
|
|
||||||
if (env.SANITIZERS == 'tsan'){
|
|
||||||
echo "${env.SANITIZERS} sanitizer build are expected to fail for now, will keep the build as successful"
|
|
||||||
} else {
|
|
||||||
sh "exit 1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Test MEGAcmd') {
|
|
||||||
matrix {
|
matrix {
|
||||||
axes {
|
axes {
|
||||||
axis {
|
axis {
|
||||||
|
Reference in New Issue
Block a user