[render-test] Add network metrics test case
This commit is contained in:
BIN
render-test/tests/network/fail-requests-transferred/expected.png
Normal file
BIN
render-test/tests/network/fail-requests-transferred/expected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"network": [
|
||||
[
|
||||
"end",
|
||||
2,
|
||||
200000
|
||||
],
|
||||
[
|
||||
"start",
|
||||
0,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"version": 8,
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeNetworkStart"],
|
||||
["probeNetwork", "start"],
|
||||
["wait"],
|
||||
["probeNetwork", "end"],
|
||||
["probeNetworkEnd"]
|
||||
],
|
||||
"height": 256,
|
||||
"width": 1024
|
||||
}
|
||||
},
|
||||
"center": [
|
||||
-73,
|
||||
15
|
||||
],
|
||||
"zoom": 4.5,
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"maxzoom": 14,
|
||||
"tiles": [
|
||||
"local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line-center",
|
||||
"type": "symbol",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"layout": {
|
||||
"text-field": "{name_en}",
|
||||
"symbol-placement": "line-center",
|
||||
"text-allow-overlap": true,
|
||||
"text-size": 35,
|
||||
"text-letter-spacing": 0.4,
|
||||
"text-offset": [3, 0],
|
||||
"text-font": [
|
||||
"Open Sans Semibold",
|
||||
"Arial Unicode MS Bold"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line",
|
||||
"type": "line",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"paint": {
|
||||
"line-width": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
render-test/tests/network/fail-requests/expected.png
Normal file
BIN
render-test/tests/network/fail-requests/expected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
14
render-test/tests/network/fail-requests/metrics.json
Normal file
14
render-test/tests/network/fail-requests/metrics.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"network": [
|
||||
[
|
||||
"end",
|
||||
2,
|
||||
183111
|
||||
],
|
||||
[
|
||||
"start",
|
||||
0,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
67
render-test/tests/network/fail-requests/style.json
Normal file
67
render-test/tests/network/fail-requests/style.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"version": 8,
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeNetworkStart"],
|
||||
["probeNetwork", "start"],
|
||||
["wait"],
|
||||
["probeNetwork", "end"],
|
||||
["probeNetworkEnd"]
|
||||
],
|
||||
"height": 256,
|
||||
"width": 1024
|
||||
}
|
||||
},
|
||||
"center": [
|
||||
-73,
|
||||
15
|
||||
],
|
||||
"zoom": 4.5,
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"maxzoom": 14,
|
||||
"tiles": [
|
||||
"local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line-center",
|
||||
"type": "symbol",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"layout": {
|
||||
"text-field": "{name_en}",
|
||||
"symbol-placement": "line-center",
|
||||
"text-allow-overlap": true,
|
||||
"text-size": 35,
|
||||
"text-letter-spacing": 0.4,
|
||||
"text-offset": [3, 0],
|
||||
"text-font": [
|
||||
"Open Sans Semibold",
|
||||
"Arial Unicode MS Bold"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line",
|
||||
"type": "line",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"paint": {
|
||||
"line-width": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
render-test/tests/network/fail-transferred/expected.png
Normal file
BIN
render-test/tests/network/fail-transferred/expected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
14
render-test/tests/network/fail-transferred/metrics.json
Normal file
14
render-test/tests/network/fail-transferred/metrics.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"network": [
|
||||
[
|
||||
"end",
|
||||
3,
|
||||
100000
|
||||
],
|
||||
[
|
||||
"start",
|
||||
0,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
67
render-test/tests/network/fail-transferred/style.json
Normal file
67
render-test/tests/network/fail-transferred/style.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"version": 8,
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeNetworkStart"],
|
||||
["probeNetwork", "start"],
|
||||
["wait"],
|
||||
["probeNetwork", "end"],
|
||||
["probeNetworkEnd"]
|
||||
],
|
||||
"height": 256,
|
||||
"width": 1024
|
||||
}
|
||||
},
|
||||
"center": [
|
||||
-73,
|
||||
15
|
||||
],
|
||||
"zoom": 4.5,
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"maxzoom": 14,
|
||||
"tiles": [
|
||||
"local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line-center",
|
||||
"type": "symbol",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"layout": {
|
||||
"text-field": "{name_en}",
|
||||
"symbol-placement": "line-center",
|
||||
"text-allow-overlap": true,
|
||||
"text-size": 35,
|
||||
"text-letter-spacing": 0.4,
|
||||
"text-offset": [3, 0],
|
||||
"text-font": [
|
||||
"Open Sans Semibold",
|
||||
"Arial Unicode MS Bold"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line",
|
||||
"type": "line",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"paint": {
|
||||
"line-width": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
render-test/tests/network/pass/expected.png
Normal file
BIN
render-test/tests/network/pass/expected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
14
render-test/tests/network/pass/metrics.json
Normal file
14
render-test/tests/network/pass/metrics.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"network": [
|
||||
[
|
||||
"end",
|
||||
3,
|
||||
183111
|
||||
],
|
||||
[
|
||||
"start",
|
||||
0,
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
67
render-test/tests/network/pass/style.json
Normal file
67
render-test/tests/network/pass/style.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"version": 8,
|
||||
"metadata": {
|
||||
"test": {
|
||||
"operations": [
|
||||
["probeNetworkStart"],
|
||||
["probeNetwork", "start"],
|
||||
["wait"],
|
||||
["probeNetwork", "end"],
|
||||
["probeNetworkEnd"]
|
||||
],
|
||||
"height": 256,
|
||||
"width": 1024
|
||||
}
|
||||
},
|
||||
"center": [
|
||||
-73,
|
||||
15
|
||||
],
|
||||
"zoom": 4.5,
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"maxzoom": 14,
|
||||
"tiles": [
|
||||
"local://tiles/mapbox.mapbox-streets-v7/{z}-{x}-{y}.mvt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line-center",
|
||||
"type": "symbol",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"layout": {
|
||||
"text-field": "{name_en}",
|
||||
"symbol-placement": "line-center",
|
||||
"text-allow-overlap": true,
|
||||
"text-size": 35,
|
||||
"text-letter-spacing": 0.4,
|
||||
"text-offset": [3, 0],
|
||||
"text-font": [
|
||||
"Open Sans Semibold",
|
||||
"Arial Unicode MS Bold"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "line",
|
||||
"type": "line",
|
||||
"source": "mapbox",
|
||||
"source-layer": "marine_label",
|
||||
"paint": {
|
||||
"line-width": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,5 +2,8 @@
|
||||
"tests/file-size/fail-size-is-over": "Should fail, size is bigger than expected.",
|
||||
"tests/file-size/fail-size-is-under": "Should fail, size is smaller than expected.",
|
||||
"tests/file-size/fail-file-doesnt-match": "Should fail, doesn't match the expectation.",
|
||||
"tests/file-size/fail-file-not-found": "Should fail, file not found."
|
||||
"tests/file-size/fail-file-not-found": "Should fail, file not found.",
|
||||
"tests/network/fail-requests": "Should fail, number of requests higher than expected.",
|
||||
"tests/network/fail-transferred": "Should fail, amount of transferred data higher than expected.",
|
||||
"tests/network/fail-requests-transferred": "Should fail, number of requests higher than expected and amount of transferred data less than expected."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user