diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-13 14:13:01 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-18 12:05:10 +0200 |
commit | 05b734f11b7a45a1da5c38fcc1f27780c3fe4354 (patch) | |
tree | f784191e033ff0f32c79439e4036423d7d066ce2 /test/buildtool/serve_api | |
parent | 866391f5436488cec823ad6bc0a446c0c9d70625 (diff) | |
download | justbuild-05b734f11b7a45a1da5c38fcc1f27780c3fe4354.tar.gz |
Create an individual instance of RemoteServeConfig in tests
...instead of intialization of the singleton.
Diffstat (limited to 'test/buildtool/serve_api')
-rw-r--r-- | test/buildtool/serve_api/TARGETS | 2 | ||||
-rw-r--r-- | test/buildtool/serve_api/source_tree_client.test.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/buildtool/serve_api/TARGETS b/test/buildtool/serve_api/TARGETS index 5d8af3c0..190f1445 100644 --- a/test/buildtool/serve_api/TARGETS +++ b/test/buildtool/serve_api/TARGETS @@ -7,6 +7,8 @@ [ ["@", "catch2", "", "catch2"] , ["utils", "catch-main-serve"] , ["@", "src", "src/buildtool/serve_api/remote", "source_tree_client"] + , ["utils", "test_serve_config"] + , ["@", "src", "src/buildtool/serve_api/remote", "config"] ] , "stage": ["test", "buildtool", "serve_api"] } diff --git a/test/buildtool/serve_api/source_tree_client.test.cpp b/test/buildtool/serve_api/source_tree_client.test.cpp index 3de6e864..604471cb 100644 --- a/test/buildtool/serve_api/source_tree_client.test.cpp +++ b/test/buildtool/serve_api/source_tree_client.test.cpp @@ -18,6 +18,7 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/serve_api/remote/config.hpp" #include "src/buildtool/serve_api/remote/source_tree_client.hpp" +#include "test/utils/serve_service/test_serve_config.hpp" auto const kRootCommit = std::string{"e4fc610c60716286b98cf51ad0c8f0d50f3aebb5"}; @@ -30,7 +31,9 @@ auto const kRootSymId = std::string{"18770dacfe14c15d88450c21c16668e13ab0e7f9"}; auto const kBazSymId = std::string{"1868f82682c290f0b1db3cacd092727eef1fa57f"}; TEST_CASE("Serve service client: tree-of-commit request", "[serve_api]") { - auto const address = RemoteServeConfig::Instance().RemoteAddress(); + auto config = TestServeConfig::ReadServeConfigFromEnvironment(); + REQUIRE(config); + auto const address = config->RemoteAddress(); // Create TLC client SourceTreeClient st_client(*address); |