From ec4fe905bccd666c72e51fe1d822e7a575da8b70 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 11 Jul 2024 14:55:08 +0200 Subject: ArtifactFactory: remove Identifier method ...since it is used in tests only. It also duplicated serialization-deserialization of ArtifactDescription. --- .../execution_engine/executor/executor.test.cpp | 37 +++++++++++----------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp') diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 9dc2f667..919ae998 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -24,6 +24,7 @@ #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" #include "src/buildtool/auth/authentication.hpp" +#include "src/buildtool/common/artifact_description.hpp" #include "src/buildtool/common/artifact_factory.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" @@ -270,13 +271,13 @@ TEST_CASE("Executor: Process artifact", "[executor]") { DependencyGraph g; auto [config, repo_config] = CreateTest(&g, workspace_path); - auto const local_cpp_desc = - ArtifactFactory::DescribeLocalArtifact("local.cpp", ""); - auto const local_cpp_id = ArtifactFactory::Identifier(local_cpp_desc); + auto const local_cpp_id = + ArtifactDescription::CreateLocal("local.cpp", "").Id(); - auto const known_cpp_desc = ArtifactFactory::DescribeKnownArtifact( - "known.cpp", 0, ObjectType::File); - auto const known_cpp_id = ArtifactFactory::Identifier(known_cpp_desc); + auto const known_cpp_id = + ArtifactDescription::CreateKnown( + ArtifactDigest{"known.cpp", 0, /*is_tree=*/false}, ObjectType::File) + .Id(); SECTION("Processing succeeds for valid config") { auto api = TestApi::Ptr{new TestApi{config}}; @@ -344,22 +345,20 @@ TEST_CASE("Executor: Process action", "[executor]") { DependencyGraph g; auto [config, repo_config] = CreateTest(&g, workspace_path); - auto const local_cpp_desc = - ArtifactFactory::DescribeLocalArtifact("local.cpp", ""); - auto const local_cpp_id = ArtifactFactory::Identifier(local_cpp_desc); + auto const local_cpp_id = + ArtifactDescription::CreateLocal("local.cpp", "").Id(); - auto const known_cpp_desc = ArtifactFactory::DescribeKnownArtifact( - "known.cpp", 0, ObjectType::File); - auto const known_cpp_id = ArtifactFactory::Identifier(known_cpp_desc); + auto const known_cpp_id = + ArtifactDescription::CreateKnown( + ArtifactDigest{"known.cpp", 0, /*is_tree=*/false}, ObjectType::File) + .Id(); - ActionIdentifier action_id{"test_action"}; - auto const output1_desc = - ArtifactFactory::DescribeActionArtifact(action_id, "output1.exe"); - auto const output1_id = ArtifactFactory::Identifier(output1_desc); + ActionIdentifier const action_id{"test_action"}; + auto const output1_id = + ArtifactDescription::CreateAction(action_id, "output1.exe").Id(); - auto const output2_desc = - ArtifactFactory::DescribeActionArtifact(action_id, "output2.exe"); - auto const output2_id = ArtifactFactory::Identifier(output2_desc); + auto const output2_id = + ArtifactDescription::CreateAction(action_id, "output2.exe").Id(); SECTION("Processing succeeds for valid config") { auto api = TestApi::Ptr{new TestApi{config}}; -- cgit v1.2.3