Skip to content
Snippets Groups Projects
Unverified Commit 73ccfe8f authored by Yaman Umuroglu's avatar Yaman Umuroglu Committed by GitHub
Browse files

[Jenkins] back to separated tests in Jenkinsfile

parent 24918985
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,12 @@ pipeline {
string(name: 'PYNQ_PASSWORD', defaultValue: 'xilinx', description: 'PYNQ board password')
string(name: 'PYNQ_TARGET_DIR', defaultValue: '/home/xilinx/finn', description: 'PYNQ board target deployment directory')
string(name: 'NUM_DEFAULT_WORKERS', defaultValue: '1', description: 'Number of cores for parallel transformations')
string(name: 'DOCKER_TEST_CMD', defaultValue: """quicktest.sh main; quicktest.sh rtlsim; quicktest.sh end2end""", description: 'Test command')
// main test: everything except rtlsim and end2end tests, parallel run with xdist, no parallel transformations to save on memory
string(name: 'DOCKER_CMD_MAIN', defaultValue: """python setup.py test --addopts "-k 'not (rtlsim or end2end)' --dist=loadfile -n auto" """, description: 'Main test command')
// rtlsim tests: parallel run with pytest-parallel, no parallel transformations to save on memory
string(name: 'DOCKER_CMD_RTLSIM', defaultValue: """python setup.py test --addopts "-k rtlsim --workers auto" """, description: 'rtlsim test command')
// end2end tests: no parallel testing, use NUM_DEFAULT_WORKERS for parallel transformations
string(name: 'DOCKER_CMD_END2END', defaultValue: """python setup.py test --addopts "-k end2end" """, description: 'end2end test command')
}
environment {
DOCKER_TAG='finn_ci:$BUILD_ID'
......@@ -32,10 +37,11 @@ pipeline {
"""
}
}
stage('Test') {
stage('test-main') {
steps {
catchError {
sh """
docker run --name $DOCKER_INST_NAME --init \
docker run --init \
--hostname $DOCKER_INST_NAME \
-v ${params.VIVADO_PATH}:${params.VIVADO_PATH}:ro \
-e NUM_DEFAULT_WORKERS=1 \
......@@ -46,8 +52,46 @@ pipeline {
-e PYNQ_USERNAME=${params.PYNQ_USERNAME} \
-e PYNQ_PASSWORD=${params.PYNQ_PASSWORD} \
-e PYNQ_TARGET_DIR=${params.PYNQ_TARGET_DIR} \
$DOCKER_TAG bash -c "${params.DOCKER_CMD_MAIN}"
"""
$DOCKER_TAG ${params.DOCKER_CMD_MAIN}
"""}
}
}
stage('test-rtlsim') {
steps {
catchError {
sh """
docker run --init \
--hostname $DOCKER_INST_NAME \
-v ${params.VIVADO_PATH}:${params.VIVADO_PATH}:ro \
-e NUM_DEFAULT_WORKERS=1 \
-e FINN_INST_NAME=$DOCKER_INST_NAME \
-e VIVADO_PATH=${params.VIVADO_PATH} \
-e PYNQ_BOARD=${params.PYNQ_BOARD} \
-e PYNQ_IP=${params.PYNQ_IP} \
-e PYNQ_USERNAME=${params.PYNQ_USERNAME} \
-e PYNQ_PASSWORD=${params.PYNQ_PASSWORD} \
-e PYNQ_TARGET_DIR=${params.PYNQ_TARGET_DIR} \
$DOCKER_TAG ${params.DOCKER_CMD_RTLSIM}
"""}
}
}
stage('test-end2end') {
steps {
catchError {
sh """
docker run --init \
--hostname $DOCKER_INST_NAME \
-v ${params.VIVADO_PATH}:${params.VIVADO_PATH}:ro \
-e NUM_DEFAULT_WORKERS=${params.NUM_DEFAULT_WORKERS} \
-e FINN_INST_NAME=$DOCKER_INST_NAME \
-e VIVADO_PATH=${params.VIVADO_PATH} \
-e PYNQ_BOARD=${params.PYNQ_BOARD} \
-e PYNQ_IP=${params.PYNQ_IP} \
-e PYNQ_USERNAME=${params.PYNQ_USERNAME} \
-e PYNQ_PASSWORD=${params.PYNQ_PASSWORD} \
-e PYNQ_TARGET_DIR=${params.PYNQ_TARGET_DIR} \
$DOCKER_TAG ${params.DOCKER_CMD_END2END}
""" }
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment