From 392c6003321047421467e07eac31e12875377ead Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 12 Mar 2021 12:38:33 +0300 Subject: Add more step ids to worker script Also rename bpkg.test-installed.{configure.build,update,test} to bpkg.test-separate-installed.*. --- bbot/worker/worker.cxx | 161 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 111 insertions(+), 50 deletions(-) (limited to 'bbot') diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index ef86dd4..bd880ae 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -511,12 +511,21 @@ build (size_t argc, const char* argv[]) // enum class step_id { + bpkg_module_create, + bpkg_module_configure_add, + bpkg_module_configure_fetch, + bpkg_module_configure_build, + bpkg_module_update, + bpkg_module_test, bpkg_create, bpkg_configure_add, bpkg_configure_fetch, bpkg_configure_build, bpkg_update, bpkg_test, + bpkg_test_separate_configure_build, + bpkg_test_separate_update, + bpkg_test_separate_test, bpkg_install, b_test_installed_create, b_test_installed_configure, @@ -524,19 +533,28 @@ build (size_t argc, const char* argv[]) bpkg_test_installed_create, bpkg_test_installed_configure_add, bpkg_test_installed_configure_fetch, - bpkg_test_installed_configure_build, - bpkg_test_installed_update, - bpkg_test_installed_test, + bpkg_test_separate_installed_configure_build, + bpkg_test_separate_installed_update, + bpkg_test_separate_installed_test, bpkg_uninstall }; const strings step_id_str { + "bpkg.module.create", + "bpkg.module.configure.add", + "bpkg.module.configure.fetch", + "bpkg.module.configure.build", + "bpkg.module.update", + "bpkg.module.test", "bpkg.create", "bpkg.configure.add", "bpkg.configure.fetch", "bpkg.configure.build", "bpkg.update", "bpkg.test", + "bpkg.test-separate.configure.build", + "bpkg.test-separate.update", + "bpkg.test-separate.test", "bpkg.install", "b.test-installed.create", "b.test-installed.configure", @@ -544,9 +562,9 @@ build (size_t argc, const char* argv[]) "bpkg.test-installed.create", "bpkg.test-installed.configure.add", "bpkg.test-installed.configure.fetch", - "bpkg.test-installed.configure.build", - "bpkg.test-installed.update", - "bpkg.test-installed.test", + "bpkg.test-separate-installed.configure.build", + "bpkg.test-separate-installed.update", + "bpkg.test-separate-installed.test", "bpkg.uninstall"}; // Split the argument into prefix (empty if not present) and unquoted @@ -834,8 +852,9 @@ build (size_t argc, const char* argv[]) return true; }; - // The main phase. + // The module phase. // + // If this is a build system module, perform a "pre-step" by building it // in a separate configuration reproducing the one used to build build2 // itself. Note that the configuration and the environment options and @@ -876,6 +895,8 @@ build (size_t argc, const char* argv[]) // b create() config.config.load=~build2 // + // [bpkg.module.create] + // // Note also that we suppress warnings about unused config.* values, // such CLI configuration. // @@ -910,14 +931,21 @@ build (size_t argc, const char* argv[]) // bpkg add // - // bpkg.configure.add + // bpkg.module.configure.add (bpkg.configure.add) // r.status |= run_bpkg ( trace, r.log, wre, "-v", "add", - step_args (env_args, step_id::bpkg_configure_add), - step_args (config_args, step_id::bpkg_configure_add), + + step_args (env_args, + step_id::bpkg_module_configure_add, + step_id::bpkg_configure_add), + + step_args (config_args, + step_id::bpkg_module_configure_add, + step_id::bpkg_configure_add), + repo); if (!r.status) @@ -925,14 +953,21 @@ build (size_t argc, const char* argv[]) // bpkg fetch // - // bpkg.configure.fetch + // bpkg.module.configure.fetch (bpkg.configure.fetch) // r.status |= run_bpkg ( trace, r.log, wre, "-v", "fetch", - step_args (env_args, step_id::bpkg_configure_fetch), - step_args (config_args, step_id::bpkg_configure_fetch), + + step_args (env_args, + step_id::bpkg_module_configure_fetch, + step_id::bpkg_configure_fetch), + + step_args (config_args, + step_id::bpkg_module_configure_fetch, + step_id::bpkg_configure_fetch), + trust_ops); if (!r.status) @@ -940,6 +975,8 @@ build (size_t argc, const char* argv[]) // bpkg build --configure-only / // + // [bpkg.module.configure.build] + // r.status |= run_bpkg ( trace, r.log, wre, "-v", @@ -995,6 +1032,8 @@ build (size_t argc, const char* argv[]) // bpkg update // + // [bpkg.module.update] + // r.status |= run_bpkg ( trace, r.log, wre, "-v", @@ -1027,6 +1066,8 @@ build (size_t argc, const char* argv[]) // // bpkg test // + // [bpkg.module.test] + // r.status |= run_bpkg ( trace, r.log, wre, "-v", @@ -1041,7 +1082,7 @@ build (size_t argc, const char* argv[]) } } - // The "main" step. + // The main phase. // // Use the global override for modules that require bootstrap. @@ -1188,7 +1229,9 @@ build (size_t argc, const char* argv[]) bool internal_tests; if (module) + { internal_tests = false; + } else { prj = prj_info (pkg_dir, true /* ext_mods */, "project"); @@ -1233,10 +1276,11 @@ build (size_t argc, const char* argv[]) // override and/or set the environment variables for bpkg processes. // Return true if all operations for all packages succeed. // - // Pass true as the installed argument to use the test installed phase - // step ids (bpkg.test-installed.*), falling back to the main phase step - // ids (bpkg.*) when no environment/configuration arguments are specified - // for them. + // Pass true as the installed argument to use the test separate installed + // phase step ids (bpkg.test-separate-installed.*) and the test separate + // phase step ids (bpkg.test-separate.*) otherwise. In both cases fall + // back to the main phase step ids (bpkg.*) when no environment/ + // configuration arguments are specified for them. // // Pass true as the sys_dep argument to configure the dependent package as // a system dependency, which is normally required for testing modules and @@ -1256,12 +1300,13 @@ build (size_t argc, const char* argv[]) { auto args = [installed, &step_args] ( const std::multimap& args, - step_id main_step, - step_id test_installed_step) + step_id test_separate_installed_step, + step_id test_separate_step, + step_id main_step) { return installed - ? step_args (args, test_installed_step, main_step) - : step_args (args, main_step); + ? step_args (args, test_separate_installed_step, main_step) + : step_args (args, test_separate_step, main_step); }; @@ -1274,7 +1319,7 @@ build (size_t argc, const char* argv[]) // bpkg build --configure-only // '[ ]' // - // bpkg.configure.build + // bpkg.test-separate[-installed].configure.build (bpkg.configure.build) // r.status |= run_bpkg ( envvars, @@ -1286,12 +1331,14 @@ build (size_t argc, const char* argv[]) "--yes", args (env_args, - step_id::bpkg_configure_build, - step_id::bpkg_test_installed_configure_build), + step_id::bpkg_test_separate_installed_configure_build, + step_id::bpkg_test_separate_configure_build, + step_id::bpkg_configure_build), args (config_args, - step_id::bpkg_configure_build, - step_id::bpkg_test_installed_configure_build), + step_id::bpkg_test_separate_installed_configure_build, + step_id::bpkg_test_separate_configure_build, + step_id::bpkg_configure_build), import, "--", @@ -1336,7 +1383,7 @@ build (size_t argc, const char* argv[]) // // bpkg update // - // bpkg.update.update + // bpkg.test-separate[-installed].update (bpkg.update) // r.status |= run_bpkg ( envvars, @@ -1345,12 +1392,14 @@ build (size_t argc, const char* argv[]) "update", args (env_args, - step_id::bpkg_update, - step_id::bpkg_test_installed_update), + step_id::bpkg_test_separate_installed_update, + step_id::bpkg_test_separate_update, + step_id::bpkg_update), args (config_args, - step_id::bpkg_update, - step_id::bpkg_test_installed_update), + step_id::bpkg_test_separate_installed_update, + step_id::bpkg_test_separate_update, + step_id::bpkg_update), import, pkg); @@ -1365,7 +1414,7 @@ build (size_t argc, const char* argv[]) // // bpkg test // - // bpkg.test.test + // bpkg.test-separate[-installed].test (bpkg.test) // r.status |= run_bpkg ( envvars, @@ -1375,12 +1424,14 @@ build (size_t argc, const char* argv[]) "--package-cwd", // See above for details. args (env_args, - step_id::bpkg_test, - step_id::bpkg_test_installed_test), + step_id::bpkg_test_separate_installed_test, + step_id::bpkg_test_separate_test, + step_id::bpkg_test), args (config_args, - step_id::bpkg_test, - step_id::bpkg_test_installed_test), + step_id::bpkg_test_separate_installed_test, + step_id::bpkg_test_separate_test, + step_id::bpkg_test), import, pkg); @@ -1407,7 +1458,7 @@ build (size_t argc, const char* argv[]) // Run internal tests. // - if (internal_tests) + if (internal_tests) // Note: false for modules (see above). { // bpkg test // @@ -1433,13 +1484,20 @@ build (size_t argc, const char* argv[]) // Thus, we test them in the configuration used to build the dependent // package (except for the build system module). // - if (external_tests && - !test (r, - dist_root, - false /* installed */, - module, - bootstrap ? module_import.c_str () : nullptr)) - break; + if (external_tests) + { + // The test separate phase. + // + if (!test (r, + dist_root, + false /* installed */, + module, + bootstrap ? module_import.c_str () : nullptr)) + break; + + // Back to the main phase. + // + } rm.status |= r.status; } @@ -1495,6 +1553,7 @@ build (size_t argc, const char* argv[]) // The test installed phase. // + // Make sure that the installed package executables are properly imported // when configuring and running tests, unless we are testing the build // system module (that supposedly doesn't install any executables). @@ -1646,7 +1705,7 @@ build (size_t argc, const char* argv[]) // // bpkg create // - // bpkg.test-installed.create (fallback to bpkg.create) + // bpkg.test-installed.create (bpkg.create) // dir_path config_dir ("build-installed-bpkg"); @@ -1676,7 +1735,7 @@ build (size_t argc, const char* argv[]) // bpkg add // - // bpkg.test-installed.configure.add (fallback to bpkg.configure.add) + // bpkg.test-installed.configure.add (bpkg.configure.add) // r.status |= run_bpkg ( trace, r.log, wre, @@ -1698,8 +1757,7 @@ build (size_t argc, const char* argv[]) // bpkg fetch // - // bpkg.test-installed.configure.fetch (fallback to - // bpkg.configure.fetch) + // bpkg.test-installed.configure.fetch (bpkg.configure.fetch) // r.status |= run_bpkg ( trace, r.log, wre, @@ -1719,7 +1777,7 @@ build (size_t argc, const char* argv[]) if (!r.status) break; - // Build/test. + // The test separate installed phase. // if (!test (r, rwd / dir_path ("dist-installed"), @@ -1728,6 +1786,9 @@ build (size_t argc, const char* argv[]) nullptr /* import */, envvars)) break; + + // Back to the test installed phase. + // } rm.status |= r.status; -- cgit v1.1