summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api
diff options
context:
space:
mode:
Diffstat (limited to 'test/buildtool/execution_api')
-rw-r--r--test/buildtool/execution_api/execution_service/TARGETS1
-rw-r--r--test/buildtool/execution_api/execution_service/cas_server.test.cpp5
-rw-r--r--test/buildtool/execution_api/local/TARGETS1
-rw-r--r--test/buildtool/execution_api/local/local_execution.test.cpp5
4 files changed, 4 insertions, 8 deletions
diff --git a/test/buildtool/execution_api/execution_service/TARGETS b/test/buildtool/execution_api/execution_service/TARGETS
index f50057c7..754615d5 100644
--- a/test/buildtool/execution_api/execution_service/TARGETS
+++ b/test/buildtool/execution_api/execution_service/TARGETS
@@ -17,7 +17,6 @@
, ["@", "src", "src/buildtool/storage", "config"]
, ["@", "src", "src/buildtool/storage", "storage"]
, ["@", "gsl", "", "gsl"]
- , ["@", "src", "src/buildtool/crypto", "hash_function"]
]
, "stage": ["test", "buildtool", "execution_api", "execution_service"]
}
diff --git a/test/buildtool/execution_api/execution_service/cas_server.test.cpp b/test/buildtool/execution_api/execution_service/cas_server.test.cpp
index 845d94aa..3e566861 100644
--- a/test/buildtool/execution_api/execution_service/cas_server.test.cpp
+++ b/test/buildtool/execution_api/execution_service/cas_server.test.cpp
@@ -17,7 +17,6 @@
#include "catch2/catch_test_macros.hpp"
#include "gsl/gsl"
#include "src/buildtool/common/artifact_digest.hpp"
-#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/execution_service/cas_server.hpp"
#include "src/buildtool/file_system/git_repo.hpp"
#include "src/buildtool/file_system/object_type.hpp"
@@ -59,7 +58,7 @@ TEST_CASE("CAS Service: upload incomplete tree", "[execution_service]") {
auto empty_tree = GitRepo::CreateShallowTree(empty_entries);
REQUIRE(empty_tree);
auto empty_tree_digest = ArtifactDigest::Create<ObjectType::Tree>(
- HashFunction::Instance(), empty_tree->second);
+ storage_config.Get().hash_function, empty_tree->second);
// Create a tree containing the empty tree.
auto entries = GitRepo::tree_entries_t{};
@@ -67,7 +66,7 @@ TEST_CASE("CAS Service: upload incomplete tree", "[execution_service]") {
auto tree = GitRepo::CreateShallowTree(entries);
REQUIRE(tree);
auto tree_digest = ArtifactDigest::Create<ObjectType::Tree>(
- HashFunction::Instance(), tree->second);
+ storage_config.Get().hash_function, tree->second);
// Upload tree. The tree invariant is violated, thus, a negative answer is
// expected.
diff --git a/test/buildtool/execution_api/local/TARGETS b/test/buildtool/execution_api/local/TARGETS
index 212bf0b6..41870428 100644
--- a/test/buildtool/execution_api/local/TARGETS
+++ b/test/buildtool/execution_api/local/TARGETS
@@ -15,7 +15,6 @@
, ["utils", "test_storage_config"]
, ["@", "src", "src/buildtool/storage", "storage"]
, ["@", "src", "src/buildtool/storage", "config"]
- , ["@", "src", "src/buildtool/crypto", "hash_function"]
]
, "stage": ["test", "buildtool", "execution_api", "local"]
}
diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp
index cac83b2a..8aea5950 100644
--- a/test/buildtool/execution_api/local/local_execution.test.cpp
+++ b/test/buildtool/execution_api/local/local_execution.test.cpp
@@ -21,7 +21,6 @@
#include "catch2/catch_test_macros.hpp"
#include "src/buildtool/common/artifact_description.hpp"
#include "src/buildtool/common/repository_config.hpp"
-#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
#include "src/buildtool/execution_api/local/local_api.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
@@ -174,7 +173,7 @@ TEST_CASE("LocalExecution: No input, create output", "[execution_api]") {
std::string test_content("test");
auto test_digest = ArtifactDigest::Create<ObjectType::File>(
- HashFunction::Instance(), test_content);
+ storage_config.Get().hash_function, test_content);
std::string output_path{"output_file"};
std::vector<std::string> const cmdline = {
@@ -234,7 +233,7 @@ TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") {
std::string test_content("test");
auto test_digest = ArtifactDigest::Create<ObjectType::File>(
- HashFunction::Instance(), test_content);
+ storage_config.Get().hash_function, test_content);
REQUIRE(api.Upload(ArtifactBlobContainer{{ArtifactBlob{
test_digest, test_content, /*is_exec=*/false}}},
false));