diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-28 17:49:38 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-03-24 09:33:46 +0100 |
commit | 88c25cccdeda497cb84de59e0a60f15fb3476e91 (patch) | |
tree | df6234d83f1649bb911c765dfde89d0e827e3566 /test/buildtool/execution_api/bazel | |
parent | 4adc474d49d14472972a82f4a256c0346f722ce6 (diff) | |
download | justbuild-88c25cccdeda497cb84de59e0a60f15fb3476e91.tar.gz |
BytestreamClient: Read to temporary files.
Diffstat (limited to 'test/buildtool/execution_api/bazel')
-rw-r--r-- | test/buildtool/execution_api/bazel/TARGETS | 3 | ||||
-rw-r--r-- | test/buildtool/execution_api/bazel/bytestream_client.test.cpp | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/buildtool/execution_api/bazel/TARGETS b/test/buildtool/execution_api/bazel/TARGETS index acbee81f..d5ad72c9 100644 --- a/test/buildtool/execution_api/bazel/TARGETS +++ b/test/buildtool/execution_api/bazel/TARGETS @@ -62,12 +62,13 @@ , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] , ["@", "src", "src/buildtool/execution_api/remote", "config"] , ["@", "src", "src/buildtool/file_system", "object_type"] + , ["@", "src", "src/buildtool/storage", "config"] , ["@", "src", "src/utils/cpp", "expected"] , ["utils", "catch-main-remote-execution"] , ["utils", "execution_bazel"] , ["utils", "test_auth_config"] - , ["utils", "test_hash_function_type"] , ["utils", "test_remote_config"] + , ["utils", "test_storage_config"] ] , "stage": ["test", "buildtool", "execution_api", "bazel"] } diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index 49a88109..2de1f578 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -28,12 +28,14 @@ #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/utils/cpp/expected.hpp" -#include "test/utils/hermeticity/test_hash_function_type.hpp" +#include "test/utils/hermeticity/test_storage_config.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { + auto storage_config = TestStorageConfig::Create(); auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -45,7 +47,8 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { remote_config->remote_address->port, &*auth_config}; - HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; + HashFunction const hash_function = storage_config.Get().hash_function; + auto const temp_space = storage_config.Get().CreateTypedTmpDir("space"); SECTION("Upload small blob") { std::string instance_name{"remote-execution"}; @@ -59,7 +62,7 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { CHECK(stream.Write(instance_name, *blob)); auto const downloaded_blob = - stream.Read(instance_name, blob->GetDigest()); + stream.Read(instance_name, blob->GetDigest(), temp_space); REQUIRE(downloaded_blob.has_value()); auto const downloaded_content = downloaded_blob->ReadContent(); @@ -86,7 +89,7 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { SECTION("Download large blob") { auto const downloaded_blob = - stream.Read(instance_name, blob->GetDigest()); + stream.Read(instance_name, blob->GetDigest(), temp_space); REQUIRE(downloaded_blob.has_value()); auto const downloaded_content = downloaded_blob->ReadContent(); |