diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-11 14:55:08 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-12 15:43:37 +0200 |
commit | ec4fe905bccd666c72e51fe1d822e7a575da8b70 (patch) | |
tree | dc44ae8b1e311f9e474b12d5859ef21d7f238730 /test/buildtool/execution_engine/executor/executor.test.cpp | |
parent | 711f341fc50cc90906d294f7d027ff8555d92d57 (diff) | |
download | justbuild-ec4fe905bccd666c72e51fe1d822e7a575da8b70.tar.gz |
ArtifactFactory: remove Identifier method
...since it is used in tests only. It also duplicated serialization-deserialization of ArtifactDescription.
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r-- | test/buildtool/execution_engine/executor/executor.test.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
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}}; |