diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-09-12 17:45:14 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-09-16 10:01:34 +0200 |
commit | 49c2382ea5ea45966ef15140fce6ad89672e956c (patch) | |
tree | da781f16f3315f662492af00648fc1469efa55a0 /test/buildtool/execution_api/local/local_execution.test.cpp | |
parent | 7d925d8d6c5fed37bb74506c5b7589b99f5d2885 (diff) | |
download | justbuild-49c2382ea5ea45966ef15140fce6ad89672e956c.tar.gz |
execution_response: Allow failures to be reported while populating
As populating the containers from remote response only takes place
once, no assumptions should be made that this cannot fail (for
example if wrong or invalid entries were produced). Instead, return
error messages on failure to callers that can log accordingly.
Diffstat (limited to 'test/buildtool/execution_api/local/local_execution.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/local/local_execution.test.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index 120100de..28fd03c6 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -211,9 +211,10 @@ TEST_CASE("LocalExecution: No input, create output", "[execution_api]") { // verify result CHECK_FALSE(output->IsCached()); - auto artifacts = output->Artifacts(); - REQUIRE(artifacts.contains(output_path)); - CHECK(artifacts.at(output_path).digest == test_digest); + auto const artifacts = output->Artifacts(); + REQUIRE(artifacts.has_value()); + REQUIRE(artifacts.value()->contains(output_path)); + CHECK(artifacts.value()->at(output_path).digest == test_digest); // ensure result IS in cache output = action->Execute(nullptr); @@ -229,9 +230,10 @@ TEST_CASE("LocalExecution: No input, create output", "[execution_api]") { // verify result CHECK_FALSE(output->IsCached()); - auto artifacts = output->Artifacts(); - REQUIRE(artifacts.contains(output_path)); - CHECK(artifacts.at(output_path).digest == test_digest); + auto const artifacts = output->Artifacts(); + REQUIRE(artifacts.has_value()); + REQUIRE(artifacts.value()->contains(output_path)); + CHECK(artifacts.value()->at(output_path).digest == test_digest); // ensure result IS STILL NOT in cache output = action->Execute(nullptr); @@ -290,9 +292,10 @@ TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") { // verify result CHECK_FALSE(output->IsCached()); - auto artifacts = output->Artifacts(); - REQUIRE(artifacts.contains(output_path)); - CHECK(artifacts.at(output_path).digest == test_digest); + auto const artifacts = output->Artifacts(); + REQUIRE(artifacts.has_value()); + REQUIRE(artifacts.value()->contains(output_path)); + CHECK(artifacts.value()->at(output_path).digest == test_digest); // ensure result IS in cache output = action->Execute(nullptr); @@ -308,9 +311,10 @@ TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") { // verify result CHECK_FALSE(output->IsCached()); - auto artifacts = output->Artifacts(); - REQUIRE(artifacts.contains(output_path)); - CHECK(artifacts.at(output_path).digest == test_digest); + auto const artifacts = output->Artifacts(); + REQUIRE(artifacts.has_value()); + REQUIRE(artifacts.value()->contains(output_path)); + CHECK(artifacts.value()->at(output_path).digest == test_digest); // ensure result IS STILL NOT in cache output = action->Execute(nullptr); |