diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2023-03-15 12:51:16 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-03-15 14:36:44 +0100 |
commit | 73c00a4820097588c2dc0bd9a89d34a65de0084b (patch) | |
tree | 636a91ceab2fee08dccd1c4ff8c3d81021ac5792 /test | |
parent | 88c6de41173424390400a8937b8db214975b688a (diff) | |
download | justbuild-73c00a4820097588c2dc0bd9a89d34a65de0084b.tar.gz |
bazel client: remove BazelAcClient::UpdateActionResult...
...both buildbarn and just execute do not allow a direct upload to the
action cache. Moreover, our tool does not support it, anyway, meaning
it was dead code.
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/execution_api/bazel/TARGETS | 17 | ||||
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_ac_client.test.cpp | 64 |
2 files changed, 2 insertions, 79 deletions
diff --git a/test/buildtool/execution_api/bazel/TARGETS b/test/buildtool/execution_api/bazel/TARGETS index 1b70c429..966485b2 100644 --- a/test/buildtool/execution_api/bazel/TARGETS +++ b/test/buildtool/execution_api/bazel/TARGETS @@ -1,16 +1,4 @@ -{ "ac_client": - { "type": ["test/utils/remote_execution", "CC test"] - , "name": ["ac_client"] - , "srcs": ["bazel_ac_client.test.cpp"] - , "private-deps": - [ ["@", "catch2", "", "catch2"] - , ["test/utils", "catch-main-remote-execution"] - , ["test/utils", "execution_bazel"] - , ["src/buildtool/execution_api/remote", "bazel_network"] - ] - , "stage": ["test", "buildtool", "execution_api", "bazel"] - } -, "cas_client": +{ "cas_client": { "type": ["test/utils/remote_execution", "CC test"] , "name": ["cas_client"] , "srcs": ["bazel_cas_client.test.cpp"] @@ -88,8 +76,7 @@ { "type": "install" , "tainted": ["test"] , "deps": - [ "ac_client" - , "bytestream_client" + [ "bytestream_client" , "cas_client" , "execution_client" , "msg_factory" diff --git a/test/buildtool/execution_api/bazel/bazel_ac_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_ac_client.test.cpp deleted file mode 100644 index ca0c0568..00000000 --- a/test/buildtool/execution_api/bazel/bazel_ac_client.test.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2022 Huawei Cloud Computing Technology Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include <string> - -#include "catch2/catch.hpp" -#include "src/buildtool/execution_api/remote/bazel/bazel_ac_client.hpp" -#include "src/buildtool/execution_api/remote/config.hpp" -#include "test/utils/remote_execution/bazel_action_creator.hpp" -#include "test/utils/test_env.hpp" - -auto CreateActionCacheEntry(BazelAcClient* ac_client, - std::string const& instance_name, - bazel_re::Digest const& action_id, - std::string const& output) { - bazel_re::ActionResult result{}; - result.set_stdout_raw(output); - REQUIRE(ac_client->UpdateActionResult(instance_name, action_id, result, 1)); -} - -// IMPORTANT: we are hiding this test case because the version of buildbarn we -// are currently using does not allow us to upload the action to the AC -// directly. The test was not failing due to a similar action being updated by -// another test (and lack of hermeticity), so it is better to disable it than to -// have it fail if we change that other test or reset the buildbarn server and -// run only the current test case. See issue#30 in -// https://rnd-gitlab-eu-c.huawei.com/germany-research-center/intelligent-cloud-technologies-laboratory/9424510-devcloud-build-tool-technology-project-de/-/issues/30 -TEST_CASE("Bazel internals: AC Client", "[!hide][execution_api]") { - auto const& info = RemoteExecutionConfig::RemoteAddress(); - - BazelAcClient ac_client(info->host, info->port); - - std::string instance_name{"remote-execution"}; - std::string content("test"); - auto test_digest = ArtifactDigest::Create<ObjectType::File>(content); - - auto action_id = CreateAction(instance_name, - {"echo", "-n", content}, - {}, - RemoteExecutionConfig::PlatformProperties()); - REQUIRE(action_id); - - // TODO(investigate): Upload fails due to permission issues. The BuildBarn - // revision we are currently using seems to ignore the - // 'allowAcUpdatesForInstances' setting. - CreateActionCacheEntry(&ac_client, instance_name, *action_id, content); - - auto ac_result = - ac_client.GetActionResult(instance_name, *action_id, true, true, {}); - REQUIRE(ac_result); - CHECK(std::equal_to<bazel_re::Digest>{}(ac_result->stdout_digest(), - test_digest)); -} |