Skip to content

Commit

Permalink
fixed nigiri rt test; updated GitHub action (exclude transfers); upda…
Browse files Browse the repository at this point in the history
…ted transfers
  • Loading branch information
carstenhagelgans committed Nov 13, 2023
1 parent 7f7a635 commit 8f2e68e
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
[transfers]
[email protected]:motis-project/transfers.git
branch=main
commit=4b1e57bddfa54dd2068d561d531fb807b0176768
commit=3dd4a42e0a400f8385b4c3d173b8b749a71965f1
[utl]
[email protected]:motis-project/utl.git
branch=master
Expand Down
8 changes: 4 additions & 4 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
9757557820209303260
1513444668081197509
cista a6218e9cd9da9e1c7a70c1188e2faf9e082b7f1c
zlib fe8e13ffca867612951bc6baf114e5ac8b00f305
boost be5235eb2258d2ec19e32546ab767a62311d9b46
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions modules/nigiri/include/motis/nigiri/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions modules/nigiri/src/nigiri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
{});
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nigiri/src/routing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion modules/nigiri/test/dst_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
10 changes: 5 additions & 5 deletions modules/nigiri/test/rt_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand All @@ -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)));
Expand Down Expand Up @@ -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)));

Expand All @@ -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)));
Expand All @@ -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)));
Expand Down

0 comments on commit 8f2e68e

Please sign in to comment.