Skip to content

Commit

Permalink
Fix integrationTest failure
Browse files Browse the repository at this point in the history
Finish incomplete merger of `TestUtils.java` from onthegomap#826
Update expected ids in `OsmQaTilesTest.java`

Branch status:
- Branch and tests are passing compilation
- Output tiles have the new Feature ID values for OSM elements
- One test is failing and was temporarily disabled: `testPreprocessOsmNodesAndWays`
  • Loading branch information
zstadler committed Jun 3, 2024
1 parent 4976dd8 commit 10c0d91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ void testOsmPoint() throws Exception {
feature(newPoint(128, 128), Map.of(
"attr", "value",
"name", "name value"
)).withId(1)
)).withId(11)
)
), results.tiles);
}
Expand Down Expand Up @@ -1040,7 +1040,7 @@ void testOsmLine() throws Exception {
feature(newLineString(128, 128, 192, 192), Map.of(
"attr", "value",
"name", "name value"
)).withId(3)
)).withId(32)
)
), results.tiles);
}
Expand Down Expand Up @@ -1166,7 +1166,7 @@ record TestRelationInfo(long id, String name) implements OsmRelationInfo {}
"attr", "value",
"name", "name value",
"relname", "rel name"
)).withId(17)
)).withId(173)
)
), results.tiles);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ public static Map<TileCoord, List<ComparableFeature>> getTileMap(ReadableTileArc
case UNKNOWN -> throw new IllegalArgumentException("cannot decompress \"UNKNOWN\"");
};
var decoded = VectorTile.decode(bytes).stream()
.map(feature -> feature(decodeSilently(feature.geometry()), feature.layer(), feature.tags())).toList();
.map(feature -> feature(decodeSilently(feature.geometry()), feature.layer(),
feature.tags()).withId(feature.id()))
.toList();
tiles.put(tile.coord(), decoded);
}
return tiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public OsmElement originalElement() {
}

@Test
@Disabled /* TODO: Fix failing test */
void integrationTest(@TempDir Path tmpDir) throws Exception {
Path dbPath = tmpDir.resolve("output.mbtiles");
OsmQaTiles.run(Arguments.of(
Expand All @@ -109,7 +108,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception {
"public_transport", "stop_position",
"@type", "node",
"@version", 4L,
"@id", 1699777833L
"@id", 16997778331L
), GeoUtils.WORLD_LAT_LON_BOUNDS, 1, Point.class);
TestUtils
.assertNumFeatures(mbtiles, "osm", 12, Map.of(
Expand All @@ -122,7 +121,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception {
"wikidata", "Q45240",
"@type", "relation",
"@version", 9L,
"@id", 5986438L
"@id", 59864383L
), GeoUtils.WORLD_LAT_LON_BOUNDS, 1, Polygon.class);
TestUtils
.assertNumFeatures(mbtiles, "osm", 12, Map.of(
Expand All @@ -133,7 +132,7 @@ void integrationTest(@TempDir Path tmpDir) throws Exception {
"lanes", "2",
"@type", "way",
"@version", 5L,
"@id", 166009791L
"@id", 1660097912L
), GeoUtils.WORLD_LAT_LON_BOUNDS, 1, LineString.class);
}
}
Expand Down

0 comments on commit 10c0d91

Please sign in to comment.