Routing: start once the offline build's extracts are in, not after Planetiler; merged file keeps the .osm.pbf extension osmium needs
This commit is contained in:
1 parent
ac7c7f3ba9
commit
58ca871662
4 files changed
+35
-15
No files matched your search
@@ -25,16 +25,18 @@ class RoutingTest < Minitest::Test
|
||||
assert_equal "waiting for the routing container", Maptool::Routing.build_status(@data)[:step]
|
||||
end
|
||||
|
||||
def test_a_request_during_an_offline_build_waits_for_it
|
||||
Maptool::PmtilesBuilder::OFFLINE_STATUS.replace(state: "running")
|
||||
def test_a_request_while_the_offline_build_downloads_waits_for_the_extracts_only
|
||||
Maptool::PmtilesBuilder.instance_variable_set(:@fetching_extracts, true)
|
||||
Maptool::Routing.request_build(@data)
|
||||
assert_equal "waiting for the offline map build", Maptool::Routing.build_status(@data)[:step]
|
||||
assert_equal "waiting for the offline map downloads", Maptool::Routing.build_status(@data)[:step]
|
||||
refute File.exist?(File.join(@routing, "build-request.json"))
|
||||
|
||||
Maptool::PmtilesBuilder::OFFLINE_STATUS.replace(state: "done")
|
||||
# Planetiler still running doesn't matter, the extracts are in.
|
||||
File.write(File.join(@data, "geofabrik_cache", "SK.osm.pbf"), "pbf")
|
||||
Maptool::Routing.offline_build_finished(@data)
|
||||
Maptool::PmtilesBuilder::OFFLINE_STATUS.replace(state: "running")
|
||||
Maptool::PmtilesBuilder.send(:extracts_ready, @data)
|
||||
assert File.exist?(File.join(@routing, "build-request.json"))
|
||||
refute Maptool::PmtilesBuilder.fetching_extracts?
|
||||
end
|
||||
|
||||
def test_update_check_compares_regions_and_extract_age
|
||||
|
||||
Reference in new issue
Block a user