From fb0d88b8b1e66e17e8a82144163c28dcfa4013d1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 31 Mar 2020 19:42:09 +0300 Subject: Fix operation status merge for shared logs in bbot worker --- bbot/worker/worker.cxx | 29 +++++++++++++++++++++-------- tests/integration/testscript | 5 +++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index eb2609d..8a5c8d7 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -344,6 +344,15 @@ build (size_t argc, const char* argv[]) return rm.results.back (); }; + // Note that we don't consider the build system module configuring and + // testing during the "pre-step" as separate operations and share the + // operation logs with the "main" configure and test steps (see below). + // Thus, we save pointers to the added result objects for the subsequent + // use. + // + operation_result* configure_result (nullptr); + operation_result* test_result (nullptr); + dir_path rwd; // Root working directory. for (;;) // The "breakout" loop. @@ -614,14 +623,6 @@ build (size_t argc, const char* argv[]) bool module (pkg.compare (0, 10, "libbuild2-") == 0); dir_path module_dir ("build-module"); - // Note that we don't consider the module configuring and testing during - // this pre-step separate operations and share the operation logs with the - // "main" configure and test steps (see below). Thus, we save pointers to - // the added result objects for the subsequent use. - // - operation_result* configure_result (nullptr); - operation_result* test_result (nullptr); - rwd = current_directory (); if (module) @@ -1327,7 +1328,19 @@ build (size_t argc, const char* argv[]) } if (!rm.results.empty ()) + { rm.status |= rm.results.back ().status; // Merge last in case of a break. + + // Also merge statuses of the configure and test operations, which logs + // can potentially be shared across multiple steps and which results may + // not be the last in the list. + // + if (configure_result != nullptr) + rm.status |= configure_result->status; + + if (test_result != nullptr) + rm.status |= test_result->status; + } else assert (rm.status == result_status::abort); diff --git a/tests/integration/testscript b/tests/integration/testscript index 9cbb00e..7970f0c 100644 --- a/tests/integration/testscript +++ b/tests/integration/testscript @@ -74,14 +74,15 @@ rfp = yes #\ pkg = libbuild2-hello -ver = 0.1.0-a.0.20191106105744.1ad196b43c42 +ver = 0.1.0-a.0.20200303044811.aeb178751f6a rep_url = "https://github.com/build2/libbuild2-hello.git#master" rep_type = git rfp = yes #\ + #\ pkg = curl -ver = 7.67.0 +ver = 7.67.0+8 rep_url = https://pkg.cppget.org/1/testing rep_type = pkg rfp = yes -- cgit v1.1