Skip to content

Commit 53523d3

Browse files
committed
Add remaining targets to ci.py
This adds build/test commands for all of the CI environments except ARM (that one will come in a follow up). Most of the invocations are similar and the scripts come straight from the Jenkinsfile. This improves the current situation by making it much easier to get CI environments locally. This also wraps pytest invocations in CI so that failures are parsed and a repro command is reported at the end of the failing CI run step alongside other logs to increase the visibility into this tool. This isn't perfect yet so some work (such as ARM support and certain tests that require pytest flags like in `tests/scripts/task_python_microtvm.sh`) is left for a follow up.
1 parent 86ba517 commit 53523d3

13 files changed

+461
-49
lines changed

Jenkinsfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ tvm_multilib_tsim = 'build/libvta_tsim.so, ' +
8383

8484
// command to start a docker container
8585
docker_run = 'docker/bash.sh'
86+
pytest_wrapper = './tests/scripts/pytest_wrapper.py'
8687
// timeout in minutes
8788
max_time = 240
8889

@@ -255,14 +256,14 @@ def ci_setup(image) {
255256

256257
def python_unittest(image) {
257258
sh (
258-
script: "${docker_run} ${image} ./tests/scripts/task_python_unittest.sh",
259+
script: "${docker_run} ${image} ${pytest_wrapper} ./tests/scripts/task_python_unittest.sh",
259260
label: 'Run Python unit tests',
260261
)
261262
}
262263

263264
def fsim_test(image) {
264265
sh (
265-
script: "${docker_run} ${image} ./tests/scripts/task_python_vta_fsim.sh",
266+
script: "${docker_run} ${image} ${pytest_wrapper} ./tests/scripts/task_python_vta_fsim.sh",
266267
label: 'Run VTA tests in FSIM',
267268
)
268269
}
@@ -290,11 +291,11 @@ stage('Build') {
290291
node('GPUBUILD') {
291292
ws(per_exec_ws('tvm/build-gpu')) {
292293
init_git()
293-
sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh"
294+
sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh build"
294295
make(ci_gpu, 'build', '-j2')
295296
pack_lib('gpu', tvm_multilib)
296297
// compiler test
297-
sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu_other.sh"
298+
sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu_other.sh build2"
298299
make(ci_gpu, 'build2', '-j2')
299300
}
300301
}
@@ -306,7 +307,7 @@ stage('Build') {
306307
ws(per_exec_ws('tvm/build-cpu')) {
307308
init_git()
308309
sh (
309-
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh",
310+
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh build",
310311
label: 'Create CPU cmake config',
311312
)
312313
make(ci_cpu, 'build', '-j2')
@@ -329,7 +330,7 @@ stage('Build') {
329330
ws(per_exec_ws('tvm/build-wasm')) {
330331
init_git()
331332
sh (
332-
script: "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh",
333+
script: "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh build",
333334
label: 'Create WASM cmake config',
334335
)
335336
make(ci_wasm, 'build', '-j2')
@@ -352,7 +353,7 @@ stage('Build') {
352353
ws(per_exec_ws('tvm/build-i386')) {
353354
init_git()
354355
sh (
355-
script: "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh",
356+
script: "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh build",
356357
label: 'Create i386 cmake config',
357358
)
358359
make(ci_i386, 'build', '-j2')
@@ -369,7 +370,7 @@ stage('Build') {
369370
ws(per_exec_ws('tvm/build-arm')) {
370371
init_git()
371372
sh (
372-
script: "${docker_run} ${ci_arm} ./tests/scripts/task_config_build_arm.sh",
373+
script: "${docker_run} ${ci_arm} ./tests/scripts/task_config_build_arm.sh build",
373374
label: 'Create ARM cmake config',
374375
)
375376
make(ci_arm, 'build', '-j4')
@@ -386,7 +387,7 @@ stage('Build') {
386387
ws(per_exec_ws('tvm/build-qemu')) {
387388
init_git()
388389
sh (
389-
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh",
390+
script: "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh build",
390391
label: 'Create QEMU cmake config',
391392
)
392393
try {
@@ -417,7 +418,7 @@ stage('Build') {
417418
ws(per_exec_ws('tvm/build-hexagon')) {
418419
init_git()
419420
sh (
420-
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh",
421+
script: "${docker_run} ${ci_hexagon} ./tests/scripts/task_config_build_hexagon.sh build",
421422
label: 'Create Hexagon cmake config',
422423
)
423424
try {
@@ -459,11 +460,11 @@ stage('Test') {
459460
label: 'Run Java unit tests',
460461
)
461462
sh (
462-
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
463+
script: "${docker_run} ${ci_gpu} ${pytest_wrapper} ./tests/scripts/task_python_unittest_gpuonly.sh",
463464
label: 'Run Python GPU unit tests',
464465
)
465466
sh (
466-
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
467+
script: "${docker_run} ${ci_gpu} ${pytest_wrapper} ./tests/scripts/task_python_integration_gpuonly.sh",
467468
label: 'Run Python GPU integration tests',
468469
)
469470
}
@@ -486,7 +487,7 @@ stage('Test') {
486487
timeout(time: max_time, unit: 'MINUTES') {
487488
ci_setup(ci_cpu)
488489
sh (
489-
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh",
490+
script: "${docker_run} ${ci_cpu} ${pytest_wrapper} ./tests/scripts/task_python_integration.sh",
490491
label: 'Run CPU integration tests',
491492
)
492493
}
@@ -511,7 +512,7 @@ stage('Test') {
511512
python_unittest(ci_cpu)
512513
fsim_test(ci_cpu)
513514
sh (
514-
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh",
515+
script: "${docker_run} ${ci_cpu} ${pytest_wrapper} ./tests/scripts/task_python_vta_tsim.sh",
515516
label: 'Run VTA tests in TSIM',
516517
)
517518
}
@@ -535,7 +536,7 @@ stage('Test') {
535536
ci_setup(ci_i386)
536537
python_unittest(ci_i386)
537538
sh (
538-
script: "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration_i386only.sh",
539+
script: "${docker_run} ${ci_i386} ${pytest_wrapper} ./tests/scripts/task_python_integration_i386only.sh",
539540
label: 'Run i386 integration tests',
540541
)
541542
fsim_test(ci_i386)
@@ -584,7 +585,7 @@ stage('Test') {
584585
timeout(time: max_time, unit: 'MINUTES') {
585586
ci_setup(ci_gpu)
586587
sh (
587-
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh",
588+
script: "${docker_run} ${ci_gpu} ${pytest_wrapper} ./tests/scripts/task_python_topi.sh",
588589
label: 'Run TOPI tests',
589590
)
590591
}
@@ -607,7 +608,7 @@ stage('Test') {
607608
timeout(time: max_time, unit: 'MINUTES') {
608609
ci_setup(ci_gpu)
609610
sh (
610-
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh 1",
611+
script: "${docker_run} ${ci_gpu} ${pytest_wrapper} ./tests/scripts/task_python_frontend.sh 1",
611612
label: 'Run Python frontend tests (shard 1)',
612613
)
613614
}
@@ -630,7 +631,7 @@ stage('Test') {
630631
timeout(time: max_time, unit: 'MINUTES') {
631632
ci_setup(ci_gpu)
632633
sh (
633-
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh 2",
634+
script: "${docker_run} ${ci_gpu} ${pytest_wrapper} ./tests/scripts/task_python_frontend.sh 2",
634635
label: 'Run Python frontend tests (shard 2)',
635636
)
636637
}
@@ -653,7 +654,7 @@ stage('Test') {
653654
timeout(time: max_time, unit: 'MINUTES') {
654655
ci_setup(ci_cpu)
655656
sh (
656-
script: "${docker_run} ${ci_cpu} ./tests/scripts/task_python_frontend_cpu.sh",
657+
script: "${docker_run} ${ci_cpu} ${pytest_wrapper} ./tests/scripts/task_python_frontend_cpu.sh",
657658
label: 'Run Python frontend tests',
658659
)
659660
}

docker/install/ubuntu_install_python_package.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ pip3 install \
3737
requests \
3838
scipy \
3939
synr==0.6.0 \
40+
junitparser==2.4.2 \
4041
six \
4142
tornado

0 commit comments

Comments
 (0)