FIX: Perpatch PY3
[csit.git] / resources / libraries / bash / entry / per_patch_perf.sh
index ef75ea9..95b067b 100644 (file)
@@ -39,7 +39,10 @@ source "${BASH_FUNCTION_DIR}/common.sh" || {
     exit 1
 }
 source "${BASH_FUNCTION_DIR}/per_patch.sh" || die "Source failed."
+# Cleanup needs ansible.
+source "${BASH_FUNCTION_DIR}/ansible.sh" || die "Source failed."
 common_dirs || die
+check_prerequisites || die
 set_perpatch_vpp_dir || die
 build_vpp_ubuntu_amd64 "CURRENT" || die
 set_aside_commit_build_artifacts || die
@@ -65,21 +68,22 @@ for ((iter=0; iter<iterations; iter++)); do
     if ((iter)); then
         # Function reserve_and_cleanup_testbed has already cleaned it once,
         # but we need to clean it explicitly on subsequent iterations.
-        cleanup_topo
+        ansible_hosts "cleanup" || die
     fi
-    select_build "build_parent" || die
+    # Testing current first. Good for early failures or for API changes.
+    select_build "build_current" || die
     check_download_dir || die
     run_pybot || die
     copy_archives || die
-    archive_parse_test_results "csit_parent/${iter}" || die
+    archive_parse_test_results "csit_current/${iter}" || die
     die_on_pybot_error || die
     # TODO: Use less heavy way to avoid apt remove failures.
-    cleanup_topo
-    select_build "build_current" || die
+    ansible_hosts "cleanup" || die
+    select_build "build_parent" || die
     check_download_dir || die
     run_pybot || die
     copy_archives || die
-    archive_parse_test_results "csit_current/${iter}" || die
+    archive_parse_test_results "csit_parent/${iter}" || die
     die_on_pybot_error || die
 done
 untrap_and_unreserve_testbed || die