From 8f2e68e4770b63e1fa55fc4c027a8d96b9d92d22 Mon Sep 17 00:00:00 2001 From: Carsten Hagelgans <52030581+carstenhagelgans@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:26:41 +0100 Subject: [PATCH] fixed nigiri rt test; updated GitHub action (exclude transfers); updated transfers --- .github/workflows/unix.yml | 4 ++-- .github/workflows/windows.yml | 2 +- .pkg | 2 +- .pkg.lock | 8 ++++---- modules/nigiri/include/motis/nigiri/routing.h | 8 ++++---- modules/nigiri/src/nigiri.cc | 7 +++---- modules/nigiri/src/routing.cc | 4 ++-- modules/nigiri/test/dst_test.cc | 2 +- modules/nigiri/test/rt_test.cc | 10 +++++----- 9 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/unix.yml b/.github/workflows/unix.yml index d58343cb9a..e470347859 100644 --- a/.github/workflows/unix.yml +++ b/.github/workflows/unix.yml @@ -168,7 +168,7 @@ jobs: --dataset.write_serialized false \ --nigiri.no_cache true \ --ris.db_max_size 1048576 \ - --exclude_modules address osrm parking path ppr tiles tripbased gbfs + --exclude_modules address osrm parking path ppr tiles tripbased gbfs transfers - name: Run Tests if: matrix.config.tests == 'On' @@ -325,7 +325,7 @@ jobs: --dataset.write_serialized false \ --nigiri.no_cache true \ --ris.db_max_size 1048576 \ - --exclude_modules address osrm parking path ppr tiles tripbased gbfs + --exclude_modules address osrm parking path ppr tiles tripbased gbfs transfers - name: Run Tests if: ${{ !matrix.config.skiptests }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 95d41e84ad..a11163eb94 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -84,7 +84,7 @@ jobs: --dataset.begin 20151004 --dataset.write_serialized false --nigiri.no_cache true - --exclude_modules address osrm parking path ppr tiles gbfs + --exclude_modules address osrm parking path ppr tiles gbfs transfers - name: Run Tests if: matrix.config.webui == 'Off' diff --git a/.pkg b/.pkg index 24a40c3e21..0ab9f28238 100644 --- a/.pkg +++ b/.pkg @@ -77,7 +77,7 @@ [transfers] url=git@github.com:motis-project/transfers.git branch=main - commit=4b1e57bddfa54dd2068d561d531fb807b0176768 + commit=3dd4a42e0a400f8385b4c3d173b8b749a71965f1 [utl] url=git@github.com:motis-project/utl.git branch=master diff --git a/.pkg.lock b/.pkg.lock index c870b27e98..cc2371a06c 100644 --- a/.pkg.lock +++ b/.pkg.lock @@ -1,4 +1,4 @@ -9757557820209303260 +1513444668081197509 cista a6218e9cd9da9e1c7a70c1188e2faf9e082b7f1c zlib fe8e13ffca867612951bc6baf114e5ac8b00f305 boost be5235eb2258d2ec19e32546ab767a62311d9b46 @@ -19,8 +19,8 @@ res 7d97784ba785ce8a2677ea77164040fde484fb04 date 26d109612ddb8ba331edba7619a6452667f842bb flatbuffers 068906e59b807a3fe1428d056541d6428528607d doctest 70e8f76437b76dd5e9c0a2eb9b907df190ab71a0 -geo 73e4f6fb9b80b178413cf7d9006501e231d41885 -lmdb 5be96596cb38c8a7919c5f543097429061c16fb6 +geo 98e98acce0b4ea56260b6f458c20a0209c6ea213 +lmdb 9bd01f14f549d8202413c4cd5f49b066b0a22b66 mimalloc 2a557cafb2e9e7c872358a83a63c62a7e14330b3 miniz 1edbdece9d71dc65c6ff405572ee37cbdcef7af4 libressl 390253a44ceef00eb620c38606588414326e9f23 @@ -46,7 +46,7 @@ pbf-sdf-fonts 91b369e4eb8a618e0a83b0c04b1b08632ea872c4 sol2 fdb0f8a60e48aa737f0a8d73edede48627f0c984 variant 3c7fc8266bb46046b42c2dc2663f9f505f0cec28 tiles 4a1352d5c6d3e1b777085877d1be18eed58667a2 -transfers 38e13dd7f980b0b683aa8edd8a1ade49ea0dab40 +transfers 4b1e57bddfa54dd2068d561d531fb807b0176768 LuaJIT 4638e9198beb2f14bd1c90b42aff744469eed404 OSM-binary 0be467dc07f2ee5271fb1e61c7c364dd20f29be0 cpp-statsd-client b60bc7bb930df664b4ab9573ad8bee80d29dc72d diff --git a/modules/nigiri/include/motis/nigiri/routing.h b/modules/nigiri/include/motis/nigiri/routing.h index 7ba14db04e..ce6630aaf7 100644 --- a/modules/nigiri/include/motis/nigiri/routing.h +++ b/modules/nigiri/include/motis/nigiri/routing.h @@ -13,9 +13,9 @@ namespace motis::nigiri { struct tag_lookup; -motis::module::msg_ptr route(tag_lookup const&, ::nigiri::timetable const&, - ::nigiri::rt_timetable const*, - ::nigiri::profile_idx_t const prf_idx, - motis::module::msg_ptr const&); +motis::module::msg_ptr route( + tag_lookup const&, ::nigiri::timetable const&, + ::nigiri::rt_timetable const*, motis::module::msg_ptr const&, + ::nigiri::profile_idx_t const prf_idx = ::nigiri::profile_idx_t{0U}); } // namespace motis::nigiri \ No newline at end of file diff --git a/modules/nigiri/src/nigiri.cc b/modules/nigiri/src/nigiri.cc index 7941804df6..8b7badb5fa 100644 --- a/modules/nigiri/src/nigiri.cc +++ b/modules/nigiri/src/nigiri.cc @@ -186,17 +186,16 @@ void nigiri::init(motis::module::registry& reg) { reg.register_op("/nigiri", [&](mm::msg_ptr const& msg) { return route(impl_->tags_, **impl_->tt_, - impl_->get_rtt().get(), n::profile_idx_t{0U}, - msg); + impl_->get_rtt().get(), msg); }, {}); if (!impl_->tt_->get()->profiles_.empty()) { - for (auto const& [prf_name, prf_idx] : impl_->tt_->get()->profiles_) { + for (auto [prf_name, prf_idx] : impl_->tt_->get()->profiles_) { reg.register_op(fmt::format("/nigiri/{}", prf_name), [&](mm::msg_ptr const& msg) { return route(impl_->tags_, **impl_->tt_, - impl_->get_rtt().get(), prf_idx, msg); + impl_->get_rtt().get(), msg, prf_idx); }, {}); } diff --git a/modules/nigiri/src/routing.cc b/modules/nigiri/src/routing.cc index d26d518f05..e42c1cafcd 100644 --- a/modules/nigiri/src/routing.cc +++ b/modules/nigiri/src/routing.cc @@ -145,8 +145,8 @@ auto run_search(n::routing::search_state& search_state, motis::module::msg_ptr route(tag_lookup const& tags, n::timetable const& tt, n::rt_timetable const* rtt, - n::profile_idx_t const prf_idx, - motis::module::msg_ptr const& msg) { + motis::module::msg_ptr const& msg, + n::profile_idx_t const prf_idx) { using motis::routing::RoutingRequest; auto const req = motis_content(RoutingRequest, msg); diff --git a/modules/nigiri/test/dst_test.cc b/modules/nigiri/test/dst_test.cc index 8841abb1bc..6acddd71e2 100644 --- a/modules/nigiri/test/dst_test.cc +++ b/modules/nigiri/test/dst_test.cc @@ -76,7 +76,7 @@ TEST(nigiri, dst_test) { tags.add(n::source_idx_t{0U}, "swiss_"); auto const routing_response = mn::route( - tags, tt, nullptr, n::profile_idx_t{0U}, + tags, tt, nullptr, mn::make_routing_msg( "swiss_8101236", "swiss_8503000:0:9", mn::to_unix(date::sys_days{2023_y / October / 29} + 14h + 48min))); diff --git a/modules/nigiri/test/rt_test.cc b/modules/nigiri/test/rt_test.cc index d912f4e5c7..6e7dc17b22 100644 --- a/modules/nigiri/test/rt_test.cc +++ b/modules/nigiri/test/rt_test.cc @@ -170,7 +170,7 @@ TEST(nigiri, rt_test) { /*** BASE LINE: A@09:00 -> E@09:55 direct via T1 ***/ auto const r0 = mn::route( - tags, tt, &rtt, n::profile_idx_t{0U}, + tags, tt, &rtt, mn::make_routing_msg( "tag_A", "tag_E", mn::to_unix(date::sys_days{2019_y / May / 1} + 7h + 50min))); @@ -187,7 +187,7 @@ TEST(nigiri, rt_test) { date::sys_days{2019_y / May / 1} + 9h)); EXPECT_EQ(1U, stats0.total_entities_success_); auto const r1 = mn::route( - tags, tt, &rtt, n::profile_idx_t{0U}, + tags, tt, &rtt, mn::make_routing_msg( "tag_A", "tag_E", mn::to_unix(date::sys_days{2019_y / May / 1} + 7h + 50min))); @@ -236,7 +236,7 @@ TEST(nigiri, rt_test) { EXPECT_EQ(stats.total_entities_success_, 5U); auto const routing_response = mn::route( - tags, tt, &rtt, n::profile_idx_t{0U}, + tags, tt, &rtt, mn::make_routing_msg("tag_A", "tag_E", mn::to_unix(date::sys_days{2019_y / May / 1} + 8h))); @@ -256,7 +256,7 @@ TEST(nigiri, rt_test) { date::sys_days{2019_y / May / 1} + 9h)); EXPECT_EQ(1U, stats2.total_entities_success_); auto const r2 = mn::route( - tags, tt, &rtt, n::profile_idx_t{0U}, + tags, tt, &rtt, mn::make_routing_msg( "tag_A", "tag_E", mn::to_unix(date::sys_days{2019_y / May / 1} + 7h + 50min))); @@ -276,7 +276,7 @@ TEST(nigiri, rt_test) { date::sys_days{2019_y / May / 1} + 9h)); EXPECT_EQ(1U, stats3.total_entities_success_); auto const r3 = mn::route( - tags, tt, &rtt, n::profile_idx_t{0U}, + tags, tt, &rtt, mn::make_routing_msg( "tag_A", "tag_E", mn::to_unix(date::sys_days{2019_y / May / 1} + 7h + 50min)));