chore(tests): re-blessed all tests (#1582)
Some checks failed
Documentation / Build Docs (push) Has been cancelled
CI / Lint and Unit test (push) Has been cancelled
CI / Build and test docker images (push) Has been cancelled
CI / Build ${{ matrix.target }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, debian-x86_64) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
Demo / Demo (push) Has been cancelled
Code coverage / grcov (push) Has been cancelled
CI / Test AWS Lambda (push) Has been cancelled
CI / Test on ${{ matrix.os }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key, 15-3.3, require) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 11-3.0-alpine, disable) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 14-3.3-alpine, disable) (push) Has been cancelled
CI / Package (push) Has been cancelled
CI / CI Finished (push) Has been cancelled

insta currently produces this (quite annoying) warning:


![image](https://github.com/user-attachments/assets/253af8dd-c3f0-47e9-9812-8df377c8af47)

=> this PR re-blesses all files to get rid of it
This commit is contained in:
Frank Elsinga 2024-12-13 22:51:35 +01:00 committed by GitHub
parent 6b3da490d1
commit 12e51675cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 112 additions and 157 deletions

View File

@ -458,46 +458,31 @@ mod tests {
let bbox_mi = Bounds::from_str("-86.6271,41.6811,-82.3095,45.8058").unwrap();
let bbox_usa = Bounds::from_str("-124.8489,24.3963,-66.8854,49.3843").unwrap();
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[0])), @r###"
---
- "0: (0,0) - (0,0)"
"###);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[0])), @r#"- "0: (0,0) - (0,0)""#);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[3,7])), @r###"
---
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[3,7])), @r#"
- "3: (0,0) - (7,7)"
- "7: (0,0) - (127,127)"
"###);
"#);
assert_yaml_snapshot!(compute_tile_ranges(&arg_minmax(&[world], 2, 4)), @r###"
---
assert_yaml_snapshot!(compute_tile_ranges(&arg_minmax(&[world], 2, 4)), @r#"
- "2: (0,0) - (3,3)"
- "3: (0,0) - (7,7)"
- "4: (0,0) - (15,15)"
"###);
"#);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[14])), @r###"
---
- "14: (0,0) - (16383,16383)"
"###);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[14])), @r#"- "14: (0,0) - (16383,16383)""#);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa], &[14])), @r###"
---
- "14: (2509,5599) - (5147,7046)"
"###);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa], &[14])), @r#"- "14: (2509,5599) - (5147,7046)""#);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa, bbox_mi, bbox_ca], &[14])), @r###"
---
- "14: (2509,5599) - (5147,7046)"
"###);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa, bbox_mi, bbox_ca], &[14])), @r#"- "14: (2509,5599) - (5147,7046)""#);
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_ca_south, bbox_mi, bbox_ca], &[14])), @r###"
---
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_ca_south, bbox_mi, bbox_ca], &[14])), @r#"
- "14: (2791,6499) - (2997,6624)"
- "14: (4249,5841) - (4446,6101)"
- "14: (2526,6081) - (2790,6624)"
- "14: (2791,6081) - (2997,6498)"
"###);
"#);
}
fn args(bbox: &[Bounds], zooms: &[u8]) -> CopyArgs {

View File

@ -496,95 +496,86 @@ mod tests {
#[allow(clippy::too_many_lines)]
fn test_auto_publish_no_auto() {
let cfg = auto("{}");
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
source_id_format: "{table}"
auto_funcs:
source_id_format: "{function}"
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
source_id_format: "{table}"
auto_funcs:
source_id_format: "{function}"
"#);
let cfg = auto("tables: {}");
assert_yaml_snapshot!(cfg, @r###"
---
auto_table: ~
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r"
auto_table: ~
auto_funcs: ~
");
let cfg = auto("functions: {}");
assert_yaml_snapshot!(cfg, @r###"
---
auto_table: ~
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r"
auto_table: ~
auto_funcs: ~
");
let cfg = auto("auto_publish: true");
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
source_id_format: "{table}"
auto_funcs:
source_id_format: "{function}"
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
source_id_format: "{table}"
auto_funcs:
source_id_format: "{function}"
"#);
let cfg = auto("auto_publish: false");
assert_yaml_snapshot!(cfg, @r###"
---
auto_table: ~
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r"
auto_table: ~
auto_funcs: ~
");
let cfg = auto(indoc! {"
auto_publish:
from_schemas: public
tables: true"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
schemas:
- public
source_id_format: "{table}"
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
schemas:
- public
source_id_format: "{table}"
auto_funcs: ~
"#);
let cfg = auto(indoc! {"
auto_publish:
from_schemas: public
functions: true"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table: ~
auto_funcs:
schemas:
- public
source_id_format: "{function}"
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table: ~
auto_funcs:
schemas:
- public
source_id_format: "{function}"
"#);
let cfg = auto(indoc! {"
auto_publish:
from_schemas: public
tables: false"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table: ~
auto_funcs:
schemas:
- public
source_id_format: "{function}"
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table: ~
auto_funcs:
schemas:
- public
source_id_format: "{function}"
"#);
let cfg = auto(indoc! {"
auto_publish:
from_schemas: public
functions: false"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
schemas:
- public
source_id_format: "{table}"
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
schemas:
- public
source_id_format: "{table}"
auto_funcs: ~
"#);
let cfg = auto(indoc! {"
auto_publish:
@ -592,15 +583,14 @@ mod tests {
tables:
from_schemas: osm
id_format: 'foo_{schema}.{table}_bar'"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
schemas:
- osm
- public
source_id_format: "foo_{schema}.{table}_bar"
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
schemas:
- osm
- public
source_id_format: "foo_{schema}.{table}_bar"
auto_funcs: ~
"#);
let cfg = auto(indoc! {"
auto_publish:
@ -608,15 +598,14 @@ mod tests {
tables:
from_schemas: osm
source_id_format: '{schema}.{table}'"});
assert_yaml_snapshot!(cfg, @r###"
---
assert_yaml_snapshot!(cfg, @r#"
auto_table:
schemas:
- osm
- public
source_id_format: "{schema}.{table}"
auto_funcs: ~
"###);
"#);
let cfg = auto(indoc! {"
auto_publish:
@ -624,14 +613,13 @@ mod tests {
from_schemas:
- osm
- public"});
assert_yaml_snapshot!(cfg, @r###"
---
auto_table:
schemas:
- osm
- public
source_id_format: "{table}"
auto_funcs: ~
"###);
assert_yaml_snapshot!(cfg, @r#"
auto_table:
schemas:
- osm
- public
source_id_format: "{table}"
auto_funcs: ~
"#);
}
}

View File

@ -53,8 +53,7 @@ async fn mbt_get_catalog() {
let response = call_service(&app, req).await;
let response = assert_response(response).await;
let body: serde_json::Value = read_body_json(response).await;
assert_yaml_snapshot!(body, @r###"
---
assert_yaml_snapshot!(body, @r"
fonts: {}
sprites: {}
tiles:
@ -73,7 +72,7 @@ async fn mbt_get_catalog() {
m_webp:
content_type: image/webp
name: ne2sr
"###);
");
}
#[actix_rt::test]
@ -85,8 +84,7 @@ async fn mbt_get_catalog_gzip() {
let response = assert_response(response).await;
let body = decode_gzip(&read_body(response).await).unwrap();
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
assert_yaml_snapshot!(body, @r###"
---
assert_yaml_snapshot!(body, @r"
fonts: {}
sprites: {}
tiles:
@ -105,7 +103,7 @@ async fn mbt_get_catalog_gzip() {
m_webp:
content_type: image/webp
name: ne2sr
"###);
");
}
#[actix_rt::test]

View File

@ -17,14 +17,13 @@ fn init() {
async fn function_source_tilejson() {
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
let tj = source(&mock, "function_zxy_query").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
assert_yaml_snapshot!(tj, @r"
tilejson: 3.0.0
tiles: []
name: function_zxy_query
foo:
bar: foo
"###);
");
}
#[actix_rt::test]
@ -55,10 +54,9 @@ async fn function_source_schemas() {
from_schemas: MixedCase
"});
let sources = mock_sources(cfg).await.0.tiles;
assert_yaml_snapshot!(sources.get_catalog(), @r###"
---
assert_yaml_snapshot!(sources.get_catalog(), @r"
function_Mixed_Name:
content_type: application/x-protobuf
description: a function source with MixedCase name
"###);
");
}

View File

@ -53,7 +53,6 @@ postgres:
let body = read_body(response).await;
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
assert_yaml_snapshot!(body, @r#"
---
fonts: {}
sprites: {}
tiles:
@ -188,8 +187,7 @@ postgres:
.insert_header(("x-rewrite-url", "/tiles/table_source?token=martin"))
.to_request();
let result: TileJSON = call_and_read_body_json(&app, req).await;
assert_yaml_snapshot!(result, @r###"
---
assert_yaml_snapshot!(result, @r#"
tilejson: 3.0.0
tiles:
- "http://localhost:8080/tiles/table_source/{z}/{x}/{y}?token=martin"
@ -205,7 +203,7 @@ postgres:
name: table_source
foo:
bar: foo
"###);
"#);
}
#[actix_rt::test]
@ -1025,8 +1023,7 @@ tables:
assert_eq!(src.id_column, None);
assert!(matches!(&src.properties, Some(v) if v.len() == 1));
let tj = source(&mock, "no_id").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
assert_yaml_snapshot!(tj, @r"
tilejson: 3.0.0
tiles: []
vector_layers:
@ -1041,10 +1038,9 @@ tables:
- 90
description: a description from comment on table
name: no_id
"###);
");
assert_yaml_snapshot!(table(&mock, "id_only"), @r###"
---
assert_yaml_snapshot!(table(&mock, "id_only"), @r"
schema: MixedCase
table: MixPoints
srid: 4326
@ -1058,10 +1054,9 @@ tables:
geometry_type: POINT
properties:
TABLE: text
"###);
");
assert_yaml_snapshot!(table(&mock, "id_and_prop"), @r###"
---
assert_yaml_snapshot!(table(&mock, "id_and_prop"), @r"
schema: MixedCase
table: MixPoints
srid: 4326
@ -1076,10 +1071,9 @@ tables:
properties:
TABLE: text
giD: int4
"###);
");
assert_yaml_snapshot!(table(&mock, "prop_only"), @r###"
---
assert_yaml_snapshot!(table(&mock, "prop_only"), @r"
schema: MixedCase
table: MixPoints
srid: 4326
@ -1093,7 +1087,7 @@ tables:
properties:
TABLE: text
giD: int4
"###);
");
// --------------------------------------------

View File

@ -16,7 +16,6 @@ fn init() {
async fn table_source() {
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
assert_yaml_snapshot!(mock.0.tiles.get_catalog(), @r#"
---
"-function.withweired---_-characters":
content_type: application/x-protobuf
description: a function source with special characters
@ -91,8 +90,7 @@ async fn table_source() {
"#);
let source = table(&mock, "table_source");
assert_yaml_snapshot!(source, @r###"
---
assert_yaml_snapshot!(source, @r"
schema: public
table: table_source
srid: 4326
@ -105,15 +103,14 @@ async fn table_source() {
geometry_type: GEOMETRY
properties:
gid: int4
"###);
");
}
#[actix_rt::test]
async fn tables_tilejson() {
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
let tj = source(&mock, "table_source").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
assert_yaml_snapshot!(tj, @r"
tilejson: 3.0.0
tiles: []
vector_layers:
@ -128,7 +125,7 @@ async fn tables_tilejson() {
name: table_source
foo:
bar: foo
"###);
");
}
#[actix_rt::test]
@ -184,10 +181,9 @@ async fn table_source_schemas() {
functions: false
"});
let sources = mock_sources(cfg).await.0;
assert_yaml_snapshot!(sources.tiles.get_catalog(), @r###"
---
assert_yaml_snapshot!(sources.tiles.get_catalog(), @r"
MixPoints:
content_type: application/x-protobuf
description: a description from comment on table
"###);
");
}

View File

@ -51,14 +51,13 @@ async fn pmt_get_catalog() {
let response = call_service(&app, req).await;
let response = assert_response(response).await;
let body: serde_json::Value = read_body_json(response).await;
assert_yaml_snapshot!(body, @r###"
---
assert_yaml_snapshot!(body, @r"
fonts: {}
sprites: {}
tiles:
stamen_toner__raster_CC-BY-ODbL_z3:
content_type: image/png
"###);
");
}
#[actix_rt::test]
@ -70,14 +69,13 @@ async fn pmt_get_catalog_gzip() {
let response = assert_response(response).await;
let body = decode_gzip(&read_body(response).await).unwrap();
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
assert_yaml_snapshot!(body, @r###"
---
assert_yaml_snapshot!(body, @r"
fonts: {}
sprites: {}
tiles:
p_png:
content_type: image/png
"###);
");
}
#[actix_rt::test]

View File

@ -202,8 +202,7 @@ mod tests {
init_mbtiles_schema(&mut conn, MbtType::Flat).await.unwrap();
let res = mbt.summary(&mut conn).await?;
assert_yaml_snapshot!(res, @r###"
---
assert_yaml_snapshot!(res, @r"
file_size: ~
mbt_type: Flat
page_size: 512
@ -216,7 +215,7 @@ mod tests {
min_zoom: ~
max_zoom: ~
zoom_info: []
"###);
");
Ok(())
}
@ -228,8 +227,7 @@ mod tests {
let res = mbt.summary(&mut conn).await?;
assert_yaml_snapshot!(res, @r###"
---
assert_yaml_snapshot!(res, @r"
file_size: 49152
mbt_type: Flat
page_size: 4096
@ -316,7 +314,7 @@ mod tests {
- -40.97989806962015
- 180.00000000000003
- 61.60639637138628
"###);
");
Ok(())
}