Skip to content

Commit ce30ce6

Browse files
Fix test second run (#1077)
Fix test VersionedLayerGetAggregatedDataTest.ParentTileFarAway which was failing on second run due to directory leftovers. Resolves: OLPEDGE-2335 Signed-off-by: Serhii Lozynskyi <[email protected]>
1 parent 3532ef8 commit ce30ce6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/integration/olp-cpp-sdk-dataservice-read/VersionedLayerGetAggregatedDataTest.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <olp/core/cache/KeyValueCache.h>
2424
#include <olp/core/client/OlpClientSettingsFactory.h>
2525
#include <olp/core/http/HttpStatusCode.h>
26+
#include <olp/core/utils/Dir.h>
2627
#include <olp/dataservice/read/VersionedLayerClient.h>
2728

2829
#include <mocks/NetworkMock.h>
@@ -43,12 +44,15 @@ using testing::_;
4344
const auto kCatalog = "hrn:here:data::olp-here-test:catalog";
4445
const client::HRN kCatalogHrn = client::HRN::FromString(kCatalog);
4546
const auto kEndpoint = "https://localhost";
47+
const auto kCachePathMutable = "./tmp_cache";
4648

4749
constexpr auto kWaitTimeout = std::chrono::seconds(3);
4850

4951
class VersionedLayerGetAggregatedDataTest : public ::testing::Test {
5052
public:
5153
void SetUp() override {
54+
olp::utils::Dir::remove(kCachePathMutable);
55+
5256
network_mock_ = std::make_shared<NetworkMock>();
5357

5458
settings_.api_lookup_settings.catalog_endpoint_provider =
@@ -63,6 +67,7 @@ class VersionedLayerGetAggregatedDataTest : public ::testing::Test {
6367
testing::Mock::VerifyAndClearExpectations(network_mock_.get());
6468
network_mock_.reset();
6569
settings_.task_scheduler.reset();
70+
olp::utils::Dir::remove(kCachePathMutable);
6671
}
6772

6873
void ExpectQuadTreeRequest(const std::string& layer, int64_t version,
@@ -130,7 +135,7 @@ TEST_F(VersionedLayerGetAggregatedDataTest, ParentTileFarAway) {
130135
}
131136

132137
olp::cache::CacheSettings settings;
133-
settings.disk_path_mutable = "./tmp_cache";
138+
settings.disk_path_mutable = kCachePathMutable;
134139
settings_.cache =
135140
olp::client::OlpClientSettingsFactory::CreateDefaultCache(settings);
136141

0 commit comments

Comments
 (0)