From acd7fba3d50aca132e2d3ce6fb75279b2d1f3631 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 11 Oct 2019 16:52:22 +0300 Subject: [PATCH] [render-test] Add more probe tests for file size Also make the tests simpler. --- .../fail-file-doesnt-match/expected.png | Bin 686 -> 169 bytes .../fail-file-doesnt-match/metrics.json | 1 + .../fail-file-doesnt-match/style.json | 14 +++----- .../filesize/fail-file-not-found/expected.png | Bin 0 -> 169 bytes .../filesize/fail-file-not-found/style.json | 32 ++++++++++++++++++ .../filesize/fail-size-is-over/expected.png | Bin 686 -> 169 bytes .../filesize/fail-size-is-over/style.json | 10 ++---- .../filesize/fail-size-is-under/expected.png | Bin 686 -> 169 bytes .../filesize/fail-size-is-under/style.json | 10 ++---- .../filesize/pass-size-is-same/expected.png | Bin 686 -> 169 bytes .../filesize/pass-size-is-same/metrics.json | 2 +- .../filesize/pass-size-is-same/style.json | 10 ++---- render-test/tests/should-fail.json | 3 +- 13 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 render-test/tests/filesize/fail-file-doesnt-match/metrics.json create mode 100644 render-test/tests/filesize/fail-file-not-found/expected.png create mode 100644 render-test/tests/filesize/fail-file-not-found/style.json diff --git a/render-test/tests/filesize/fail-file-doesnt-match/expected.png b/render-test/tests/filesize/fail-file-doesnt-match/expected.png index feed2e457f16b98a90e0e3e49ee150c0fef0a566..83d01c4e5da4ddc6255fffa6942907f36ef762cb 100644 GIT binary patch delta 141 zcmZ3-x{`5%N_~N+i(^Q|oVV8;xf&D%STDS=xO?8ZY<1BBg+&=tn?B3^nL4|$;7TSF z0~pk8yD~-D`+3x?S=rZSy`AqGY~qKRaKtN+#*veyM<6q1PRLu`Q8r pobXGC=jHr^!MFMaAo@!-Fz>u-&#PeabTvr8)0NH7Wt~$(699?$JUjpZ literal 686 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKIq4wY+k=ML zb5muGJ-q*U-sBEPrwe?AMVmBd#$OD4F3ggyIBBKGk-S%8Tz-5`E(JVd_Kov8ChyST zN`I-;#`ow-ldDsw=$#FU_S>V8nmrUeVjOe+sL2{;V)F=s9pB z!&-6qfkPFBwL9uQU0yr={br?J(OusjZvVa3w=XI?+QxCxW*77Ny6;zSuW?9booD~& z(Wz&b&&%*1PU){daqZ8;`On$E=k5L1(8m^*P+a@CqQO>Y!vQ947?ISl_w3i+WUJX1 zZf@n@cTc|Un;fUg1P3N0Vr}8qQ`!0dK0TOy{{4lM4(_|#Kj%(Th8ch`s_99__kw-C z>ddmbv(t`5Z|rc@NfPXiIHDv5XEs%2-!xe~xv`I}`UpZJf|azv-D>8giIWRA?9fqH zp6m1SUTlBA->UxI)SG+7?kO~~2zj6o7rtKZ&#Q4)7q&b5$K3>l`VQ@(z`j%gmA1AlD{+|~s nC&$}Y|F%O!KZx~n{a;?+R}(F?``*<76Ci`9tDnm{r-UW|9%wk1 diff --git a/render-test/tests/filesize/fail-file-doesnt-match/metrics.json b/render-test/tests/filesize/fail-file-doesnt-match/metrics.json new file mode 100644 index 000000000..8401ce91e --- /dev/null +++ b/render-test/tests/filesize/fail-file-doesnt-match/metrics.json @@ -0,0 +1 @@ +{"fileSize":[["image","foo.123",442],["style","bar.321",609]]} diff --git a/render-test/tests/filesize/fail-file-doesnt-match/style.json b/render-test/tests/filesize/fail-file-doesnt-match/style.json index 91e90ffbe..a3267fcf5 100644 --- a/render-test/tests/filesize/fail-file-doesnt-match/style.json +++ b/render-test/tests/filesize/fail-file-doesnt-match/style.json @@ -3,8 +3,8 @@ "metadata": { "test": { "operations": [ - ["probeFileSize", "style", "aaaaa.json"], - ["probeFileSize", "image", "bbbbb.png"] + ["probeFileSize", "style", "style.json"], + ["probeFileSize", "image", "expected.png"] ], "width": 64, "height": 64 @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/fail-file-not-found/expected.png b/render-test/tests/filesize/fail-file-not-found/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..83d01c4e5da4ddc6255fffa6942907f36ef762cb GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=1)eUBAr*7pUUTGXP!M3f@WSHm zdF!&(MGF)bWlU}QEca*X?81U8nM^>XKv1{s$`obq=TWm}WnY{1cG}kn>3f%-t@o9P zlKHy*?0m^8nWTIBr2=+^UU&G#wnV;h!Y?77m-7z>-|82D=r7s8yz{C(uY$?b)gS>+ LS3j3^P6qGY~qKRaKtN+#*veyM<6q1PRLu`Q8r pobXGC=jHr^!MFMaAo@!-Fz>u-&#PeabTvr8)0NH7Wt~$(699?$JUjpZ literal 686 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKIq4wY+k=ML zb5muGJ-q*U-sBEPrwe?AMVmBd#$OD4F3ggyIBBKGk-S%8Tz-5`E(JVd_Kov8ChyST zN`I-;#`ow-ldDsw=$#FU_S>V8nmrUeVjOe+sL2{;V)F=s9pB z!&-6qfkPFBwL9uQU0yr={br?J(OusjZvVa3w=XI?+QxCxW*77Ny6;zSuW?9booD~& z(Wz&b&&%*1PU){daqZ8;`On$E=k5L1(8m^*P+a@CqQO>Y!vQ947?ISl_w3i+WUJX1 zZf@n@cTc|Un;fUg1P3N0Vr}8qQ`!0dK0TOy{{4lM4(_|#Kj%(Th8ch`s_99__kw-C z>ddmbv(t`5Z|rc@NfPXiIHDv5XEs%2-!xe~xv`I}`UpZJf|azv-D>8giIWRA?9fqH zp6m1SUTlBA->UxI)SG+7?kO~~2zj6o7rtKZ&#Q4)7q&b5$K3>l`VQ@(z`j%gmA1AlD{+|~s nC&$}Y|F%O!KZx~n{a;?+R}(F?``*<76Ci`9tDnm{r-UW|9%wk1 diff --git a/render-test/tests/filesize/fail-size-is-over/style.json b/render-test/tests/filesize/fail-size-is-over/style.json index ce2069a37..a3267fcf5 100644 --- a/render-test/tests/filesize/fail-size-is-over/style.json +++ b/render-test/tests/filesize/fail-size-is-over/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/fail-size-is-under/expected.png b/render-test/tests/filesize/fail-size-is-under/expected.png index feed2e457f16b98a90e0e3e49ee150c0fef0a566..83d01c4e5da4ddc6255fffa6942907f36ef762cb 100644 GIT binary patch delta 141 zcmZ3-x{`5%N_~N+i(^Q|oVV8;xf&D%STDS=xO?8ZY<1BBg+&=tn?B3^nL4|$;7TSF z0~pk8yD~-D`+3x?S=rZSy`AqGY~qKRaKtN+#*veyM<6q1PRLu`Q8r pobXGC=jHr^!MFMaAo@!-Fz>u-&#PeabTvr8)0NH7Wt~$(699?$JUjpZ literal 686 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKIq4wY+k=ML zb5muGJ-q*U-sBEPrwe?AMVmBd#$OD4F3ggyIBBKGk-S%8Tz-5`E(JVd_Kov8ChyST zN`I-;#`ow-ldDsw=$#FU_S>V8nmrUeVjOe+sL2{;V)F=s9pB z!&-6qfkPFBwL9uQU0yr={br?J(OusjZvVa3w=XI?+QxCxW*77Ny6;zSuW?9booD~& z(Wz&b&&%*1PU){daqZ8;`On$E=k5L1(8m^*P+a@CqQO>Y!vQ947?ISl_w3i+WUJX1 zZf@n@cTc|Un;fUg1P3N0Vr}8qQ`!0dK0TOy{{4lM4(_|#Kj%(Th8ch`s_99__kw-C z>ddmbv(t`5Z|rc@NfPXiIHDv5XEs%2-!xe~xv`I}`UpZJf|azv-D>8giIWRA?9fqH zp6m1SUTlBA->UxI)SG+7?kO~~2zj6o7rtKZ&#Q4)7q&b5$K3>l`VQ@(z`j%gmA1AlD{+|~s nC&$}Y|F%O!KZx~n{a;?+R}(F?``*<76Ci`9tDnm{r-UW|9%wk1 diff --git a/render-test/tests/filesize/fail-size-is-under/style.json b/render-test/tests/filesize/fail-size-is-under/style.json index ce2069a37..a3267fcf5 100644 --- a/render-test/tests/filesize/fail-size-is-under/style.json +++ b/render-test/tests/filesize/fail-size-is-under/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/pass-size-is-same/expected.png b/render-test/tests/filesize/pass-size-is-same/expected.png index feed2e457f16b98a90e0e3e49ee150c0fef0a566..83d01c4e5da4ddc6255fffa6942907f36ef762cb 100644 GIT binary patch delta 141 zcmZ3-x{`5%N_~N+i(^Q|oVV8;xf&D%STDS=xO?8ZY<1BBg+&=tn?B3^nL4|$;7TSF z0~pk8yD~-D`+3x?S=rZSy`AqGY~qKRaKtN+#*veyM<6q1PRLu`Q8r pobXGC=jHr^!MFMaAo@!-Fz>u-&#PeabTvr8)0NH7Wt~$(699?$JUjpZ literal 686 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Or9=|Ar*{or0OmKIq4wY+k=ML zb5muGJ-q*U-sBEPrwe?AMVmBd#$OD4F3ggyIBBKGk-S%8Tz-5`E(JVd_Kov8ChyST zN`I-;#`ow-ldDsw=$#FU_S>V8nmrUeVjOe+sL2{;V)F=s9pB z!&-6qfkPFBwL9uQU0yr={br?J(OusjZvVa3w=XI?+QxCxW*77Ny6;zSuW?9booD~& z(Wz&b&&%*1PU){daqZ8;`On$E=k5L1(8m^*P+a@CqQO>Y!vQ947?ISl_w3i+WUJX1 zZf@n@cTc|Un;fUg1P3N0Vr}8qQ`!0dK0TOy{{4lM4(_|#Kj%(Th8ch`s_99__kw-C z>ddmbv(t`5Z|rc@NfPXiIHDv5XEs%2-!xe~xv`I}`UpZJf|azv-D>8giIWRA?9fqH zp6m1SUTlBA->UxI)SG+7?kO~~2zj6o7rtKZ&#Q4)7q&b5$K3>l`VQ@(z`j%gmA1AlD{+|~s nC&$}Y|F%O!KZx~n{a;?+R}(F?``*<76Ci`9tDnm{r-UW|9%wk1 diff --git a/render-test/tests/filesize/pass-size-is-same/metrics.json b/render-test/tests/filesize/pass-size-is-same/metrics.json index 607565213..cf4bb89dd 100644 --- a/render-test/tests/filesize/pass-size-is-same/metrics.json +++ b/render-test/tests/filesize/pass-size-is-same/metrics.json @@ -1 +1 @@ -{"fileSize":[["image","expected.png",686],["style","style.json",609]]} \ No newline at end of file +{"fileSize":[["image","expected.png",169],["style","style.json",510]]} \ No newline at end of file diff --git a/render-test/tests/filesize/pass-size-is-same/style.json b/render-test/tests/filesize/pass-size-is-same/style.json index ce2069a37..a3267fcf5 100644 --- a/render-test/tests/filesize/pass-size-is-same/style.json +++ b/render-test/tests/filesize/pass-size-is-same/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/should-fail.json b/render-test/tests/should-fail.json index 28859d415..1c3784d47 100644 --- a/render-test/tests/should-fail.json +++ b/render-test/tests/should-fail.json @@ -1,5 +1,6 @@ { "tests/filesize/fail-size-is-over": "Should fail, size is bigger than expected.", "tests/filesize/fail-size-is-under": "Should fail, size is smaller than expected.", - "tests/filesize/fail-file-doesnt-match": "Should fail, file not found." + "tests/filesize/fail-file-doesnt-match": "Should fail, doesn't match the expectation.", + "tests/filesize/fail-file-not-found": "Should fail, file not found." }