Skip to content

Commit

Permalink
Consolidate object store sync util files into util/ directory (#6789)
Browse files Browse the repository at this point in the history
* Moved object store sync util files to util/ directory
* Moved obj store test sync util files to test/object-store/util/sync/
  • Loading branch information
Michael Wilkerson-Barker authored Jul 27, 2023
1 parent c6f8832 commit c2a9ab9
Show file tree
Hide file tree
Showing 33 changed files with 287 additions and 218 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### Internals
* `wait_for_upload_completion`/`wait_for_download_completion` internal API was changed to use `Status`'s instead of `std::error_code`. The SDK-facing was already `Status` oriented, so this change should only result in better error messages. ([PR #6796](https://github.com/realm/realm-core/pull/6796))
* Separate local and baas object store tests into separate evergreen tasks and allow custom test specification. ([PR #6805](https://github.com/realm/realm-core/pull/6805))
* Consolidate object store sync util files into test/object-store/util/sync/ directory. ([PR #6789](https://github.com/realm/realm-core/pull/6789))

----------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions test/object-store/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ file(GLOB RESOURCES RELATIVE ${CMAKE_CURRENT_BINARY_DIR}
"*.realm")

if(REALM_ENABLE_AUTH_TESTS)
list(APPEND SOURCES util/baas_admin_api.cpp)
list(APPEND SOURCES util/sync/baas_admin_api.cpp)
endif()

if(REALM_ENABLE_SYNC)
list(APPEND HEADERS
sync/flx_sync_harness.hpp
sync/session/session_util.hpp
sync/sync_test_utils.hpp
util/baas_admin_api.hpp
util/sync/flx_sync_harness.hpp
util/sync/session_util.hpp
util/sync/sync_test_utils.hpp
util/sync/baas_admin_api.hpp
)
list(APPEND SOURCES
bson.cpp
Expand All @@ -72,9 +72,9 @@ if(REALM_ENABLE_SYNC)
sync/session/session.cpp
sync/session/wait_for_completion.cpp
sync/sync_manager.cpp
sync/sync_test_utils.cpp
sync/user.cpp
sync/app.cpp
util/sync/sync_test_utils.cpp
)
if(APPLE)
list(APPEND SOURCES audit.cpp)
Expand Down
19 changes: 9 additions & 10 deletions test/object-store/audit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
//
////////////////////////////////////////////////////////////////////////////

#include <catch2/catch_all.hpp>
#include <util/event_loop.hpp>
#include <util/test_file.hpp>
#include <util/test_utils.hpp>
#include <util/sync/baas_admin_api.hpp>
#include <util/sync/flx_sync_harness.hpp>

#include "sync/flx_sync_harness.hpp"
#include "util/event_loop.hpp"
#include "util/test_file.hpp"
#include "util/test_utils.hpp"
#include "util/baas_admin_api.hpp"
#include <realm/set.hpp>
#include <realm/list.hpp>
#include <realm/dictionary.hpp>

#include <realm/object-store/audit.hpp>
#include <realm/object-store/audit_serializer.hpp>
Expand All @@ -32,17 +34,14 @@
#include <realm/object-store/schema.hpp>
#include <realm/object-store/shared_realm.hpp>
#include <realm/object-store/impl/object_accessor_impl.hpp>

#include <realm/object-store/sync/sync_user.hpp>
#include <realm/object-store/sync/sync_manager.hpp>
#include <realm/object-store/sync/sync_session.hpp>
#include <realm/object-store/sync/mongo_client.hpp>
#include <realm/object-store/sync/mongo_database.hpp>
#include <realm/object-store/sync/mongo_collection.hpp>

#include <realm/set.hpp>
#include <realm/list.hpp>
#include <realm/dictionary.hpp>
#include <catch2/catch_all.hpp>

#include <external/json/json.hpp>

Expand Down
6 changes: 3 additions & 3 deletions test/object-store/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ set(SOURCES

if(REALM_ENABLE_SYNC)
list(APPEND HEADERS
../sync/sync_test_utils.hpp
../sync/session/session_util.hpp
../util/sync/sync_test_utils.hpp
../util/sync/session_util.hpp
)
list(APPEND SOURCES
../sync/sync_test_utils.cpp
../util/sync/sync_test_utils.cpp
client_reset.cpp
)
endif()
Expand Down
8 changes: 4 additions & 4 deletions test/object-store/benchmarks/client_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

#define CATCH_CONFIG_ENABLE_BENCHMARKING

#include "util/test_file.hpp"
#include "util/test_utils.hpp"

#include "sync/sync_test_utils.hpp"
#include <util/test_file.hpp>
#include <util/test_utils.hpp>
#include <util/sync/sync_test_utils.hpp>

#include <realm/object-store/object_schema.hpp>
#include <realm/object-store/object_store.hpp>
#include <realm/object-store/property.hpp>
#include <realm/object-store/schema.hpp>

#include <realm/sync/noinst/client_history_impl.hpp>
#include <realm/sync/noinst/client_reset.hpp>
#include <realm/sync/noinst/client_reset_recovery.hpp>
Expand Down
16 changes: 8 additions & 8 deletions test/object-store/benchmarks/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@

#define CATCH_CONFIG_ENABLE_BENCHMARKING

#include "util/index_helpers.hpp"
#include "util/test_file.hpp"
#include "util/test_utils.hpp"
#include <util/index_helpers.hpp>
#include <util/test_file.hpp>
#include <util/test_utils.hpp>

#include <realm/db.hpp>
#include <realm/query_expression.hpp>

#include <realm/object-store/impl/object_accessor_impl.hpp>
#include <realm/object-store/impl/realm_coordinator.hpp>
#include <realm/object-store/binding_context.hpp>
#include <realm/object-store/object_schema.hpp>
#include <realm/object-store/property.hpp>
#include <realm/object-store/results.hpp>
#include <realm/object-store/schema.hpp>
#include <realm/object-store/impl/object_accessor_impl.hpp>
#include <realm/object-store/impl/realm_coordinator.hpp>
#include <realm/object-store/util/scheduler.hpp>

#include <realm/db.hpp>
#include <realm/query_expression.hpp>

#include <memory>
#include <vector>

Expand Down
10 changes: 5 additions & 5 deletions test/object-store/benchmarks/results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

#define CATCH_CONFIG_ENABLE_BENCHMARKING

#include "util/test_file.hpp"
#include "util/test_utils.hpp"
#include <util/test_file.hpp>
#include <util/test_utils.hpp>

#include <realm/db.hpp>
#include <realm/query_expression.hpp>

#include <realm/object-store/object_schema.hpp>
#include <realm/object-store/property.hpp>
Expand All @@ -28,9 +31,6 @@
#include <realm/object-store/sectioned_results.hpp>
#include <realm/object-store/impl/realm_coordinator.hpp>

#include <realm/db.hpp>
#include <realm/query_expression.hpp>

using namespace realm;

TEST_CASE("Benchmark results", "[benchmark][results]") {
Expand Down
41 changes: 33 additions & 8 deletions test/object-store/c_api/c_api.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
#include <catch2/catch_all.hpp>
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2019 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#include <util/event_loop.hpp>
#include <util/test_file.hpp>
#include <util/sync/flx_sync_harness.hpp>

#include <realm.h>

#include <realm/object-store/object.hpp>
#include <realm/object-store/c_api/conversion.hpp>
#include <realm/object-store/c_api/realm.hpp>
#include <realm/object-store/c_api/types.hpp>
#include <realm/object-store/impl/object_accessor_impl.hpp>
#include <realm/object-store/sync/generic_network_transport.hpp>

#include <realm/sync/binding_callback_thread_observer.hpp>

#include <realm/util/base64.hpp>
#include <realm/util/logger.hpp>

#include "sync/flx_sync_harness.hpp"
#include "util/test_file.hpp"
#include "util/event_loop.hpp"
#include "realm/util/logger.hpp"
#include "realm/object-store/impl/object_accessor_impl.hpp"
#include <catch2/catch_all.hpp>

#include <cstring>
#include <numeric>
Expand All @@ -22,16 +43,20 @@

#if REALM_ENABLE_SYNC
#include <realm/object-store/sync/sync_user.hpp>

#include <external/json/json.hpp>
#endif

#if REALM_ENABLE_AUTH_TESTS
#include <util/sync/baas_admin_api.hpp>
#include <util/sync/sync_test_utils.hpp>

#include <realm/object-store/sync/app_utils.hpp>

#include <realm/sync/client_base.hpp>
#include <realm/sync/network/websocket.hpp>

#include <realm/util/misc_errors.hpp>
#include "sync/sync_test_utils.hpp"
#include "util/baas_admin_api.hpp"
#endif

using namespace realm;
Expand Down
18 changes: 9 additions & 9 deletions test/object-store/geospatial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@
//
////////////////////////////////////////////////////////////////////////////

#include <catch2/catch_all.hpp>
#include <util/event_loop.hpp>
#include <util/index_helpers.hpp>
#include <util/test_file.hpp>

#include "util/event_loop.hpp"
#include "util/index_helpers.hpp"
#include "util/test_file.hpp"
#include <realm/geospatial.hpp>
#include <realm/group.hpp>

#include <realm/object-store/feature_checks.hpp>
#include <realm/object-store/collection_notifications.hpp>
#include <realm/object-store/object_accessor.hpp>
#include <realm/object-store/property.hpp>
#include <realm/object-store/schema.hpp>
#include <realm/object-store/object.hpp>
#include <realm/object-store/util/scheduler.hpp>

#include <realm/object-store/impl/realm_coordinator.hpp>
#include <realm/object-store/impl/object_accessor_impl.hpp>
#include <realm/object-store/util/scheduler.hpp>

#include <realm/geospatial.hpp>
#include <realm/group.hpp>
#include <realm/util/any.hpp>

#if REALM_ENABLE_AUTH_TESTS
#include "sync/flx_sync_harness.hpp"
#include <util/sync/flx_sync_harness.hpp>
#endif // REALM_ENABLE_AUTH_TESTS

#include <catch2/catch_all.hpp>

#include <cstdint>

using namespace realm;
Expand Down
14 changes: 7 additions & 7 deletions test/object-store/migrations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@
//
////////////////////////////////////////////////////////////////////////////

#include <catch2/catch_all.hpp>
#include <util/test_file.hpp>
#include <util/test_utils.hpp>

#include "util/test_file.hpp"
#include "util/test_utils.hpp"
#include <realm/group.hpp>
#include <realm/table.hpp>

#include <realm/object-store/object_schema.hpp>
#include <realm/object-store/object_store.hpp>
#include <realm/object-store/property.hpp>
#include <realm/object-store/schema.hpp>

#include <realm/object-store/impl/object_accessor_impl.hpp>

#include <realm/group.hpp>
#include <realm/table.hpp>
#include <realm/util/scope_exit.hpp>

#include <catch2/catch_all.hpp>

#ifdef _WIN32
#include <Windows.h>
#endif

#if REALM_ENABLE_AUTH_TESTS
#include "sync/flx_sync_harness.hpp"
#include <util/sync/flx_sync_harness.hpp>
#endif // REALM_ENABLE_AUTH_TESTS

using namespace realm;
Expand Down
34 changes: 19 additions & 15 deletions test/object-store/realm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,44 @@
//
////////////////////////////////////////////////////////////////////////////

#include <catch2/catch_all.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>
#include <util/event_loop.hpp>
#include <util/test_file.hpp>
#include <util/test_utils.hpp>
#include <../util/semaphore.hpp>

#include <realm/db.hpp>
#include <realm/history.hpp>

#include "util/event_loop.hpp"
#include "util/test_file.hpp"
#include "util/test_utils.hpp"
#include "../util/semaphore.hpp"
#include <realm/impl/simulated_failure.hpp>

#include <realm/object-store/binding_context.hpp>
#include <realm/object-store/impl/realm_coordinator.hpp>
#include <realm/object-store/keypath_helpers.hpp>
#include <realm/object-store/object_schema.hpp>
#include <realm/object-store/object_store.hpp>
#include <realm/object-store/property.hpp>
#include <realm/object-store/results.hpp>
#include <realm/object-store/schema.hpp>
#include <realm/object-store/thread_safe_reference.hpp>
#include <realm/object-store/util/scheduler.hpp>
#include <realm/object-store/impl/realm_coordinator.hpp>
#include <realm/object-store/util/event_loop_dispatcher.hpp>
#include <realm/object-store/util/scheduler.hpp>

#include <realm/util/base64.hpp>
#include <realm/util/fifo_helper.hpp>
#include <realm/util/scope_exit.hpp>

#if REALM_ENABLE_SYNC
#include <util/sync/flx_sync_harness.hpp>

#include <realm/object-store/sync/async_open_task.hpp>
#include <realm/object-store/sync/impl/sync_metadata.hpp>

#include <realm/sync/noinst/client_history_impl.hpp>
#include <realm/sync/subscriptions.hpp>
#include "sync/flx_sync_harness.hpp"
#endif

#include <realm/db.hpp>
#include <realm/history.hpp>
#include <realm/impl/simulated_failure.hpp>
#include <realm/util/base64.hpp>
#include <realm/util/fifo_helper.hpp>
#include <realm/util/scope_exit.hpp>
#include <catch2/catch_all.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>

#include <external/json/json.hpp>

Expand Down
Loading

0 comments on commit c2a9ab9

Please sign in to comment.