From ea4b259aa4c4b1be8eb730aae6c183ff4f8f5927 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 8 Apr 2016 15:49:55 -0700 Subject: [PATCH 01/24] Expand server corpus --- .../15afdcf2cadb93f56dbe36233d8cd7ea9d2bd6fe | Bin 0 -> 286 bytes .../5841d898d2cd804f2d6373538e341dfba8a4dfab | Bin 0 -> 101 bytes .../7839f12a8410a73d66e191cb5183d36d09a375e8 | Bin 0 -> 43 bytes .../8ec00f45afb097066f47d0bad256a8b856b1efe8 | Bin 0 -> 287 bytes .../986c9ca7db83b2cddbae2a0db2dca87f52277074 | Bin 0 -> 101 bytes .../9a176b6f7e0dc5f681a1788d8954f76fabd08cad | Bin 0 -> 2047 bytes .../e7ad0c4b7d0f289c90a3988309e9e03b78f7eea3 | Bin 0 -> 60 bytes .../f5f0615030439dda162e8862b6bbd09f81f14d81 | Bin 0 -> 67 bytes ...t-6e980a9d12c392175b5f66683e608626ae983276 | Bin 0 -> 2047 bytes tools/run_tests/tests.json | 198 ++++++++++++++++++ 10 files changed, 198 insertions(+) create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/15afdcf2cadb93f56dbe36233d8cd7ea9d2bd6fe create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/5841d898d2cd804f2d6373538e341dfba8a4dfab create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/7839f12a8410a73d66e191cb5183d36d09a375e8 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/8ec00f45afb097066f47d0bad256a8b856b1efe8 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/986c9ca7db83b2cddbae2a0db2dca87f52277074 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/9a176b6f7e0dc5f681a1788d8954f76fabd08cad create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/e7ad0c4b7d0f289c90a3988309e9e03b78f7eea3 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/f5f0615030439dda162e8862b6bbd09f81f14d81 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-6e980a9d12c392175b5f66683e608626ae983276 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/15afdcf2cadb93f56dbe36233d8cd7ea9d2bd6fe b/test/core/end2end/fuzzers/server_fuzzer_corpus/15afdcf2cadb93f56dbe36233d8cd7ea9d2bd6fe new file mode 100644 index 0000000000000000000000000000000000000000..b63ef6bacc1870d985cc991062d63c3cccd142ed GIT binary patch literal 286 zcmY+9%}&EG49B-o#HcnY2e_h&6CX?4?YJjk2Si2t0$$=ZmeM3@UBq~99)NT=EZh3| z?+?k<=OKH^-kPQ=c6qr@*J=Ge<=JeO#F*@NKG9rU?*p(|7ANnEBlO~CKPZD8CWbl0 zszWwjC)G#Yh{X7TZ>?8gClV{=9iwB(=YS6of+Yn^-W6>h)GHerWb`kvq{ZE&Nl*#{ zOLWR>a_v3oxKDiEXgpb9+_XOw#Da0jJ&?tI5a~EzFQJWtk4Ml_S&Eol&Z(lzxADci a%$_W{@%veI}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzsj35@H08e^RL9%X1W^QVJX$hBM bu0eirYKlT~F-!$Bx(XA8;?(5)yp&=9j20Dy literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/7839f12a8410a73d66e191cb5183d36d09a375e8 b/test/core/end2end/fuzzers/server_fuzzer_corpus/7839f12a8410a73d66e191cb5183d36d09a375e8 new file mode 100644 index 0000000000000000000000000000000000000000..b03b904e1dee3d67e952f753e5144a90d91668b7 GIT binary patch literal 43 pcmWFt@>I}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzmj35?cI{=f?1mgez literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/8ec00f45afb097066f47d0bad256a8b856b1efe8 b/test/core/end2end/fuzzers/server_fuzzer_corpus/8ec00f45afb097066f47d0bad256a8b856b1efe8 new file mode 100644 index 0000000000000000000000000000000000000000..6561c1c44097d469391f04550d2bb3d2bde161c7 GIT binary patch literal 287 zcmY+9%}&EG49B}s#HcnY2e_h&6CcakA#vFgj02*geE~1=8cS&swJu^jHxEF%8hmps%J)rE6)&4|m94V+eacCaq%kJ@olP_om%9LL7RAx~;sCw4+6~HJhpAx> zvFebG*J<@pHzGBD;A`s@*onkadB^Bj@+sgQgkVVllXpei2ldQ`1{wVeENO8wX%dve zz!IJEnp}HJI_?vn)*6o%7}xC&1uI}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzsj35@H08e^RL9%X1W^QVJX$hC1 buR(rsYKlT~F-!$Bx(XA8;?(5)yp&=9hPD-C literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/9a176b6f7e0dc5f681a1788d8954f76fabd08cad b/test/core/end2end/fuzzers/server_fuzzer_corpus/9a176b6f7e0dc5f681a1788d8954f76fabd08cad new file mode 100644 index 0000000000000000000000000000000000000000..ef52cd7c81a487e5da090d60afe5f1201384a590 GIT binary patch literal 2047 zcmeHD!Ait15N);MT3pCM@5PhKwy7R_@v4W#V*3NL>1-3oCLx`I>$iI_?H}xQ?Z7-{ z;JpX$)n6akbN1f0HGeJ2b-GTQ?SxSjC1Jx{M)7pT?5c7=a>e)7@*Q|~T@6Cw0TW5& z!goNDwoB^Ire$dbWB9zH%#uxFQcqqaRp04(M~}1L0u@T`sf=XExgjUKTGQT2W?? lTAA_tDSG>zgT*s0urzRn4K!z%X^C`d1J$X5h5x@A_ybeVN{;{l literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/e7ad0c4b7d0f289c90a3988309e9e03b78f7eea3 b/test/core/end2end/fuzzers/server_fuzzer_corpus/e7ad0c4b7d0f289c90a3988309e9e03b78f7eea3 new file mode 100644 index 0000000000000000000000000000000000000000..a4fd83a79f49f7defe94b1f567d4f484d7bb3f0c GIT binary patch literal 60 xcmWFt@>I}L@CXSB&^OXE;N{}w3ibt&3=9k`KnwI}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzsj35@H08e^RL9%X1W^QVJX$hBM NsX}pTa(-S)F#u_C4KDxy literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-6e980a9d12c392175b5f66683e608626ae983276 b/test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-6e980a9d12c392175b5f66683e608626ae983276 new file mode 100644 index 0000000000000000000000000000000000000000..f0489f8266e7cfd6553de9c7f7dce1a88216c38d GIT binary patch literal 2047 zcmeHD!Ait16il_^T3pCM@5PhKrmY@(@v4W#V*3LzdD{lENl0J8_16_@+CSLq+6QlV z4`v2ts*ktyF@0^CDu2$3b+S(C?SzDoIBb}65=~b`FG|O;Tje|ZGmfLDmt`+H*hAbQ zy727*J1gVry>4hy@*#X);o(YK!F6YQq}Re41cM9@4k&j{E5T7&legXpdNU#8LV!aC zMp&s#dn;k5Il@NCpbUPS_FFl6hOk1 Date: Fri, 8 Apr 2016 22:52:10 -0700 Subject: [PATCH 02/24] Expand uri corpus --- .../02d156dc5e6f2c11c90c2e06fcee04adf036a342 | 2 + .../1155aa6ea7ef262a81a63692513ea395f84dad6f | 2 + .../13856a5569ffd085a4d5c07af5f8e9310835a118 | 1 + .../396568fc41c8ccb31ec925b4a862e4d29ead1327 | 1 + .../3b1e7526a99918006b87e499d2beb6c4ac9c3c0c | 1 + .../41963cc10752f70c3af7e3d85868efb097a0ea9c | 1 + .../56a2da4b2e6fb795243901023ed8d0aa083d1aab | 1 + .../574c2f13858a9a6d724654bd913ede9ae3abf822 | 2 + .../582f789c19033a152094cbf8565f14154a778ddb | 1 + .../6ae3acd9d8507b61bf235748026080a4138dba58 | 1 + .../7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb | 1 + .../87daa131e0973b77a232a870ed749ef29cf58e6d | 2 + .../8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb | 1 + .../9671149af0b444f59bbdf71340d3441dadd8a7b4 | 1 + .../a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 | 1 + .../aba1472880406a318ce207ee79815b7acf087757 | 1 + .../c28a47409cf5d95bb372238d01e73d8b831408e4 | 1 + .../c3ef1d41888063a08700c3add1e4465aabcf8807 | 2 + .../c550a76af21f9b9cc92a386d5c8998b26f8f2e4d | 1 + .../c79721406d0ab80495f186fd88e37fba98637ae9 | 1 + .../e241f29957b0e30ec11aaaf91b2339f7015fa5fd | 1 + tools/run_tests/tests.json | 462 ++++++++++++++++++ 22 files changed, 488 insertions(+) create mode 100644 test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342 create mode 100644 test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f create mode 100644 test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118 create mode 100644 test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327 create mode 100644 test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c create mode 100644 test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c create mode 100644 test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab create mode 100644 test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822 create mode 100644 test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb create mode 100644 test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58 create mode 100644 test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb create mode 100644 test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d create mode 100644 test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb create mode 100644 test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4 create mode 100644 test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 create mode 100644 test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757 create mode 100644 test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4 create mode 100644 test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807 create mode 100644 test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d create mode 100644 test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9 create mode 100644 test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd diff --git a/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342 b/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342 new file mode 100644 index 00000000000..a85e7a8c217 --- /dev/null +++ b/test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342 @@ -0,0 +1,2 @@ +::nix::ii///ii/\a‡?=n;iI_!';&b.cii??nn!%i!*% +*; \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f b/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f new file mode 100644 index 00000000000..5b913f1bb87 --- /dev/null +++ b/test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f @@ -0,0 +1,2 @@ +:ipip~6:‡i:::1 +v:miP/ii:::/iu?n?n)i!= \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118 b/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118 new file mode 100644 index 00000000000..76f157cda5a --- /dev/null +++ b/test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118 @@ -0,0 +1 @@ +i:i:‡ii:i?nip~??ni=niI&6.u/n_!'p~ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327 b/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327 new file mode 100644 index 00000000000..694d51dc9a0 --- /dev/null +++ b/test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327 @@ -0,0 +1 @@ +uni:/i:i:‡i:i:‡i??ni=niIi??ni=niI__!!i?n!i'p'pR2p~~ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c b/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c new file mode 100644 index 00000000000..af80f07d192 --- /dev/null +++ b/test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c @@ -0,0 +1 @@ +i:i:‡i??ni=niI_!'p~ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c b/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c new file mode 100644 index 00000000000..7f0f2ea6eac --- /dev/null +++ b/test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c @@ -0,0 +1 @@ +:‡i?=niI_!';; \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab b/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab new file mode 100644 index 00000000000..f975f970596 --- /dev/null +++ b/test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab @@ -0,0 +1 @@ +i:i?nip~&6.u/n \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822 b/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822 new file mode 100644 index 00000000000..d5fb7ba2746 --- /dev/null +++ b/test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822 @@ -0,0 +1,2 @@ +:unix://ii//a.b.ci?n!% +* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb b/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb new file mode 100644 index 00000000000..1860e1c5b49 --- /dev/null +++ b/test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb @@ -0,0 +1 @@ +:‡i?P=niIii-i?%n'!%*i= \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58 b/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58 new file mode 100644 index 00000000000..fe908d213a8 --- /dev/null +++ b/test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58 @@ -0,0 +1 @@ +uni::.ilP:%:%i:i‡i:‡i?=nii?n(!ipRI_&/.i;;!?=ii/?n#lniiI_!*Kii!/?ni* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb b/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb new file mode 100644 index 00000000000..0e7f44caf26 --- /dev/null +++ b/test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb @@ -0,0 +1 @@ +i:i:‡i:i:‡i??ni=niIi??ni=niI__!!'p'p~~ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d b/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d new file mode 100644 index 00000000000..679f13e3071 --- /dev/null +++ b/test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d @@ -0,0 +1,2 @@ +unix:///a/:.:ii/i?nc!% +i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb b/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb new file mode 100644 index 00000000000..ffd807b39ea --- /dev/null +++ b/test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb @@ -0,0 +1 @@ +ilP:%i:‡i?=niI_.i;;!ii/?nni*! \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4 b/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4 new file mode 100644 index 00000000000..8ad79f9eb90 --- /dev/null +++ b/test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4 @@ -0,0 +1 @@ +:‡i?P-niI%'i= \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 b/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 new file mode 100644 index 00000000000..facb11c5ed8 --- /dev/null +++ b/test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6 @@ -0,0 +1 @@ +:%i:‡i?=niI_!ii/?ni*! \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757 b/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757 new file mode 100644 index 00000000000..b7e7e970f8b --- /dev/null +++ b/test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757 @@ -0,0 +1 @@ +:iI/i?n!%š* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4 b/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4 new file mode 100644 index 00000000000..119b0808c9f --- /dev/null +++ b/test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4 @@ -0,0 +1 @@ +:%i:i‡?=#liI_!Kii/?ni* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807 b/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807 new file mode 100644 index 00000000000..01db5d8aa44 --- /dev/null +++ b/test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807 @@ -0,0 +1,2 @@ +::unix://ii//a‡?=niI_!';.b.ci?n!% +*; \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d b/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d new file mode 100644 index 00000000000..2ccb535449a --- /dev/null +++ b/test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d @@ -0,0 +1 @@ +uni::.i?n(!ipR&/ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9 b/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9 new file mode 100644 index 00000000000..f3c0404be7b --- /dev/null +++ b/test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9 @@ -0,0 +1 @@ +::nix::ii///ii/\a:‡?=n;iI_!';&b.ciii \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd b/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd new file mode 100644 index 00000000000..497bfd37ee4 --- /dev/null +++ b/test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd @@ -0,0 +1 @@ +ilP:%:%i:i‡i:‡i?=niI_.i;;!?=ii/?n#lniiI_!*Kii!/?ni* \ No newline at end of file diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 3c7d1711a84..d9f94fb98aa 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -52683,6 +52683,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/02d156dc5e6f2c11c90c2e06fcee04adf036a342" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342" @@ -52727,6 +52749,50 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/1155aa6ea7ef262a81a63692513ea395f84dad6f" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/13856a5569ffd085a4d5c07af5f8e9310835a118" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc" @@ -52903,6 +52969,50 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/396568fc41c8ccb31ec925b4a862e4d29ead1327" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/3b1e7526a99918006b87e499d2beb6c4ac9c3c0c" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc" @@ -52925,6 +53035,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/41963cc10752f70c3af7e3d85868efb097a0ea9c" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1" @@ -52947,6 +53079,72 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/56a2da4b2e6fb795243901023ed8d0aa083d1aab" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/574c2f13858a9a6d724654bd913ede9ae3abf822" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/582f789c19033a152094cbf8565f14154a778ddb" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8" @@ -53013,6 +53211,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/6ae3acd9d8507b61bf235748026080a4138dba58" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6" @@ -53057,6 +53277,50 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/7ff4d8b8d1ffd0d42c48bbb91e5856a9ec31aecb" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/87daa131e0973b77a232a870ed749ef29cf58e6d" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266" @@ -53079,6 +53343,50 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/8d7e944fd5d0ede94097fcc98b47b09a3f9c76cb" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/9671149af0b444f59bbdf71340d3441dadd8a7b4" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb" @@ -53145,6 +53453,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/a1140f3f8b5cffc1010221b9a4084a25fb75c1f6" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de" @@ -53211,6 +53541,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/aba1472880406a318ce207ee79815b7acf087757" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2" @@ -53255,6 +53607,94 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/c28a47409cf5d95bb372238d01e73d8b831408e4" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/c3ef1d41888063a08700c3add1e4465aabcf8807" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/c550a76af21f9b9cc92a386d5c8998b26f8f2e4d" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ + "test/core/client_config/uri_corpus/c79721406d0ab80495f186fd88e37fba98637ae9" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245" @@ -53365,6 +53805,28 @@ "posix" ] }, + { + "args": [ + "test/core/client_config/uri_corpus/e241f29957b0e30ec11aaaf91b2339f7015fa5fd" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "uri_fuzzer_test_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, { "args": [ "test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71" From 1bca98966fa51dcb778aef54024d10fa8f4876ce Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sat, 9 Apr 2016 14:31:33 -0700 Subject: [PATCH 03/24] Expand server corpus --- .../1d614f3d6b826f844178a77094bedb534748a362 | Bin 0 -> 102 bytes .../546367bfdd2b9464fbfe5d74f55d8cd220accbab | Bin 0 -> 628 bytes .../6c5bb78b51cf5006c92258292de19550985c00ba | Bin 0 -> 702 bytes .../7ddfac7d7845b424bf670070781ca6ff8586c63b | Bin 0 -> 287 bytes .../aefcbc29f2caea5038cda4dbc927cdadd9b844c4 | Bin 0 -> 102 bytes .../c5ff50ae447ac7a0c8fb3363b2458824d405e64c | Bin 0 -> 287 bytes ...h-7af5da2a8da23d197d9336e32da72c9ff64c15b3 | Bin 0 -> 31 bytes tools/run_tests/tests.json | 154 ++++++++++++++++++ 8 files changed, 154 insertions(+) create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/1d614f3d6b826f844178a77094bedb534748a362 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/546367bfdd2b9464fbfe5d74f55d8cd220accbab create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/6c5bb78b51cf5006c92258292de19550985c00ba create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/7ddfac7d7845b424bf670070781ca6ff8586c63b create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/aefcbc29f2caea5038cda4dbc927cdadd9b844c4 create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/c5ff50ae447ac7a0c8fb3363b2458824d405e64c create mode 100644 test/core/end2end/fuzzers/server_fuzzer_corpus/crash-7af5da2a8da23d197d9336e32da72c9ff64c15b3 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/1d614f3d6b826f844178a77094bedb534748a362 b/test/core/end2end/fuzzers/server_fuzzer_corpus/1d614f3d6b826f844178a77094bedb534748a362 new file mode 100644 index 0000000000000000000000000000000000000000..ece6c2f4d95ac2b0c82bee2b05ef5fb3f5fa0fc2 GIT binary patch literal 102 zcmWFt@>I}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzsj35@H08e^RL9%X1W^QVJX-Suu Wp{YV~YI1&FN-<0cGpZ6UgbDz!p%x(k literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/546367bfdd2b9464fbfe5d74f55d8cd220accbab b/test/core/end2end/fuzzers/server_fuzzer_corpus/546367bfdd2b9464fbfe5d74f55d8cd220accbab new file mode 100644 index 0000000000000000000000000000000000000000..d2711d91044fbd4a42d5252a280c8571ddee557e GIT binary patch literal 628 zcmdT?Jx|0i3{6i(92F;JfW2Y@bp3#_3o8tWit8WnCB7z7E{RfC;`rT+45WpH2?iD{ z`N@`S%g@j4^Fw}}-*;VG-Inz#TV*n%vC(Xlz7 s7Z6ol-o#^+b$)5I9bc~4-TQosWX69AztSz8box~6k7<5A0CSdo04vC2&;S4c literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/6c5bb78b51cf5006c92258292de19550985c00ba b/test/core/end2end/fuzzers/server_fuzzer_corpus/6c5bb78b51cf5006c92258292de19550985c00ba new file mode 100644 index 0000000000000000000000000000000000000000..d1af2812d99013e85945b42f4e19b55bd77be0ad GIT binary patch literal 702 zcma)4OHRWu5S=tZv=J3qz!pWU+Nx;^?7D#^ED#aR0dO5RvE(L}GnHCaJsT(BDqMiz ze5lH&2urqSJf87;&l5b}xdZn$3Q0i>%;b8anobEVZZj zx+5}5M3Uv`9MLRAmZFDi$vVhZ=qI=k&Pl8!-9fU;Py=lU!s`$2J)_}KZZ%51myQWH zR&!G0_6Vg+qQ_F2MLdm9d8CnWTn{5Q7X;Zbe&*6?A#0-|Trib8_A+Pcy(kKg#QO62 zj6@z4T$^sJ^mECvuUO1;WQs-qmjw4};t(kXrv!PH`lTqfG!^!zuh_*O*a0LpJi4Xu z8+=JU>W@bkTI)~cJ6h-vj9rySW49-Gx?J@E-pwO$zVvP2#dAfCHkUeE~1=8cS&swJu`3H+RzAux#t+ zzds~bpKtk7{@OHExhpoSY?amTQ%;g3jWOBpY@(UC+y`K@D39Kk2k6DseozKGObv60 zRflZ6POFc)5vlP5Ut6!hP9&DfJ4VNnPXX^B1WO8-yer#2sAo1b$mm~SNsF6Flb{p^ zb`q7>7*vJ^2tpHt;av5hYl coBY9&8^0gL^4wtR(2snv-E{STX}+uf0GK9NEC2ui literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/aefcbc29f2caea5038cda4dbc927cdadd9b844c4 b/test/core/end2end/fuzzers/server_fuzzer_corpus/aefcbc29f2caea5038cda4dbc927cdadd9b844c4 new file mode 100644 index 0000000000000000000000000000000000000000..a95b626ec70015cc8ce99339cfa8fd89ac117da7 GIT binary patch literal 102 zcmWFt@>I}L@CXSB&^OXE;N{}w3ibt&3=9k`Knwzsj35@H08e^RL9%X1W^QVJX$hC1 VsjotDYI1&FN-<0cGlmkF3IL)Q71#g( literal 0 HcmV?d00001 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/c5ff50ae447ac7a0c8fb3363b2458824d405e64c b/test/core/end2end/fuzzers/server_fuzzer_corpus/c5ff50ae447ac7a0c8fb3363b2458824d405e64c new file mode 100644 index 0000000000000000000000000000000000000000..ccebb3610d0d8fd7138d620103354da123a5f42f GIT binary patch literal 287 zcmY+9%}&EG49B-o#HcnY2e_h&6CX?4?YJjk2Si2t0$$=ZmeM3@UBq~99)NT=EZh3| z?+?k<=OKH^-kPQ=c6qr@*J=Ge<=JeO#F*@NKG9rU?*p(|7ANnEBlO~CKPZD8CWbl0 zszWwjC)G#Yh{X7TZ>?8gClV{=9iwB(=YS6of+Yn^-W6>h)GHerWb`kvq{ZE&Nl*#{ zJBi9`a_v3oxKDiEXgpb9+_XOw#Da0jJ&?tI5a~EzFQJWtk4Ml_S&Eol&Z(lzxADci b%$_W{@%ve Date: Fri, 8 Apr 2016 14:15:04 -0700 Subject: [PATCH 04/24] update nuget dependencies to nunit3 --- src/csharp/.nuget/packages.config | 2 +- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 21 +++---------------- src/csharp/Grpc.Core.Tests/packages.config | 3 +-- .../Grpc.Examples.Tests.csproj | 5 +++-- .../Grpc.Examples.Tests/packages.config | 2 +- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 3 +++ src/csharp/Grpc.Examples/packages.config | 2 +- .../Grpc.HealthCheck.Tests.csproj | 5 +++-- .../Grpc.HealthCheck.Tests/packages.config | 2 +- .../Grpc.IntegrationTesting.csproj | 5 +++-- .../Grpc.IntegrationTesting/packages.config | 2 +- 11 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/csharp/.nuget/packages.config b/src/csharp/.nuget/packages.config index acb43ae4b3d..6154b3561f4 100644 --- a/src/csharp/.nuget/packages.config +++ b/src/csharp/.nuget/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 3bfd49b10fe..5f0efb48890 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -35,24 +35,9 @@ ..\keys\Grpc.snk - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll - False - - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll - False - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll - False - - - ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll - False + + False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll diff --git a/src/csharp/Grpc.Core.Tests/packages.config b/src/csharp/Grpc.Core.Tests/packages.config index 610831dfe1e..e019bcbd7e0 100644 --- a/src/csharp/Grpc.Core.Tests/packages.config +++ b/src/csharp/Grpc.Core.Tests/packages.config @@ -1,6 +1,5 @@  - - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 9aeab059f95..baf25770900 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -41,8 +41,9 @@ False ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index ed30d2d428e..28010f412f8 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 15b04c8d8b7..f0a0aa3a266 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -41,6 +41,9 @@ False ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll + diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index dfb8304ad10..a424cd2ea02 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index bb6488b4f12..62474b46911 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -41,8 +41,9 @@ False ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index 47280939791..caf99ecfdbe 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 7ea80b11f0d..9c56608427f 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -68,8 +68,9 @@ False ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index 0ae8bf4e707..a18137cbbf4 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -8,5 +8,5 @@ - + \ No newline at end of file From e331da2277a7a52deceeee17baa79ea4c7feefe8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 11:05:39 -0700 Subject: [PATCH 05/24] make Grpc.Core.Tests work with NUnit3 --- src/csharp/Grpc.Core.Tests/ChannelTest.cs | 4 ++-- src/csharp/Grpc.Core.Tests/ClientServerTest.cs | 10 +++++----- src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs | 2 +- src/csharp/Grpc.Core.Tests/HalfcloseTest.cs | 2 +- src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs | 2 +- src/csharp/Grpc.Core.Tests/MarshallingErrorsTest.cs | 8 ++++---- src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/ChannelTest.cs b/src/csharp/Grpc.Core.Tests/ChannelTest.cs index ed0ec14df5c..6330f50faed 100644 --- a/src/csharp/Grpc.Core.Tests/ChannelTest.cs +++ b/src/csharp/Grpc.Core.Tests/ChannelTest.cs @@ -70,7 +70,7 @@ namespace Grpc.Core.Tests public void WaitForStateChangedAsync_InvalidArgument() { var channel = new Channel("localhost", ChannelCredentials.Insecure); - Assert.Throws(typeof(ArgumentException), () => channel.WaitForStateChangedAsync(ChannelState.FatalFailure)); + Assert.ThrowsAsync(typeof(ArgumentException), async () => await channel.WaitForStateChangedAsync(ChannelState.FatalFailure)); channel.ShutdownAsync().Wait(); } @@ -87,7 +87,7 @@ namespace Grpc.Core.Tests { var channel = new Channel("localhost", ChannelCredentials.Insecure); channel.ShutdownAsync().Wait(); - Assert.Throws(typeof(InvalidOperationException), () => channel.ShutdownAsync().GetAwaiter().GetResult()); + Assert.ThrowsAsync(typeof(InvalidOperationException), async () => await channel.ShutdownAsync()); } } } diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 77f6a63156b..6c13a4fa483 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -93,7 +93,7 @@ namespace Grpc.Core.Tests var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unknown, ex.Status.StatusCode); - var ex2 = Assert.Throws(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); + var ex2 = Assert.ThrowsAsync(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unknown, ex2.Status.StatusCode); } @@ -108,7 +108,7 @@ namespace Grpc.Core.Tests var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode); - var ex2 = Assert.Throws(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); + var ex2 = Assert.ThrowsAsync(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex2.Status.StatusCode); } @@ -124,7 +124,7 @@ namespace Grpc.Core.Tests var ex = Assert.Throws(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode); - var ex2 = Assert.Throws(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); + var ex2 = Assert.ThrowsAsync(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc")); Assert.AreEqual(StatusCode.Unauthenticated, ex2.Status.StatusCode); } @@ -204,7 +204,7 @@ namespace Grpc.Core.Tests await barrier.Task; // make sure the handler has started. cts.Cancel(); - var ex = Assert.Throws(async () => await call.ResponseAsync); + var ex = Assert.ThrowsAsync(async () => await call.ResponseAsync); Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode); } @@ -290,7 +290,7 @@ namespace Grpc.Core.Tests return request; }); - Assert.Throws(typeof(TaskCanceledException), + Assert.ThrowsAsync(typeof(TaskCanceledException), async () => await channel.WaitForStateChangedAsync(channel.State, DateTime.UtcNow.AddMilliseconds(10))); var stateChangedTask = channel.WaitForStateChangedAsync(channel.State); diff --git a/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs b/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs index 90c510ec61f..cec8c7ce6bb 100644 --- a/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs +++ b/src/csharp/Grpc.Core.Tests/ContextPropagationTest.cs @@ -105,7 +105,7 @@ namespace Grpc.Core.Tests var parentCall = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall(new CallOptions(cancellationToken: cts.Token))); await readyToCancelTcs.Task; cts.Cancel(); - Assert.Throws(typeof(RpcException), async () => await parentCall); + Assert.ThrowsAsync(typeof(RpcException), async () => await parentCall); Assert.AreEqual("CHILD_CALL_CANCELLED", await successTcs.Task); } diff --git a/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs b/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs index fe6edb858bb..b4cb451d944 100644 --- a/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs +++ b/src/csharp/Grpc.Core.Tests/HalfcloseTest.cs @@ -91,7 +91,7 @@ namespace Grpc.Core.Tests await call.RequestStream.CompleteAsync(); // Second attempt to close from client is not allowed. - Assert.Throws(typeof(InvalidOperationException), async () => await call.RequestStream.CompleteAsync()); + Assert.ThrowsAsync(typeof(InvalidOperationException), async () => await call.RequestStream.CompleteAsync()); } } } diff --git a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs index 543f6375df1..60530d32508 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs @@ -84,7 +84,7 @@ namespace Grpc.Core.Internal.Tests Assert.AreEqual(StatusCode.Internal, asyncCall.GetStatus().StatusCode); Assert.IsNull(asyncCall.GetTrailers()); - var ex = Assert.Throws(() => resultTask.GetAwaiter().GetResult()); + var ex = Assert.ThrowsAsync(async () => await resultTask); Assert.AreEqual(StatusCode.Internal, ex.Status.StatusCode); } diff --git a/src/csharp/Grpc.Core.Tests/MarshallingErrorsTest.cs b/src/csharp/Grpc.Core.Tests/MarshallingErrorsTest.cs index 37fb36946af..0663e77d1ea 100644 --- a/src/csharp/Grpc.Core.Tests/MarshallingErrorsTest.cs +++ b/src/csharp/Grpc.Core.Tests/MarshallingErrorsTest.cs @@ -112,7 +112,7 @@ namespace Grpc.Core.Tests }); var call = Calls.AsyncServerStreamingCall(helper.CreateServerStreamingCall(), "REQUEST"); - var ex = Assert.Throws(async () => await call.ResponseStream.MoveNext()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.Internal, ex.Status.StatusCode); } @@ -134,7 +134,7 @@ namespace Grpc.Core.Tests { helper.ClientStreamingHandler = new ClientStreamingServerMethod(async (requestStream, context) => { - Assert.Throws(async () => await requestStream.MoveNext()); + Assert.ThrowsAsync(async () => await requestStream.MoveNext()); return "RESPONSE"; }); @@ -153,7 +153,7 @@ namespace Grpc.Core.Tests [Test] public void RequestSerializationError_AsyncUnary() { - Assert.Throws(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "UNSERIALIZABLE_VALUE")); + Assert.ThrowsAsync(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "UNSERIALIZABLE_VALUE")); } [Test] @@ -166,7 +166,7 @@ namespace Grpc.Core.Tests }); var call = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall()); await call.RequestStream.WriteAsync("A"); - Assert.Throws(async () => await call.RequestStream.WriteAsync("UNSERIALIZABLE_VALUE")); + Assert.ThrowsAsync(async () => await call.RequestStream.WriteAsync("UNSERIALIZABLE_VALUE")); await call.RequestStream.WriteAsync("B"); await call.RequestStream.CompleteAsync(); diff --git a/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs b/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs index a1648f36712..772beadd4a3 100644 --- a/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs +++ b/src/csharp/Grpc.Core.Tests/ResponseHeadersTest.cs @@ -155,7 +155,7 @@ namespace Grpc.Core.Tests { helper.UnaryHandler = new UnaryServerMethod(async (request, context) => { - Assert.Throws(typeof(ArgumentNullException), async () => await context.WriteResponseHeadersAsync(null)); + Assert.ThrowsAsync(typeof(ArgumentNullException), async () => await context.WriteResponseHeadersAsync(null)); return "PASS"; }); From 6c0dee8b0de56613f9988f0dbfac2e46d9024653 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 12:14:09 -0700 Subject: [PATCH 06/24] migrate Grpc.Examples.Tests to NUnit3 --- src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 290d42808e7..875202b9509 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -149,7 +149,7 @@ namespace Math.Tests using (var call = client.Fib(new FibArgs { Limit = 0 }, deadline: DateTime.UtcNow.AddMilliseconds(500))) { - var ex = Assert.Throws(async () => await call.ResponseStream.ToListAsync()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.ToListAsync()); // We can't guarantee the status code always DeadlineExceeded. See issue #2685. Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); From 9f19bd3eb1c01fbde43375db2f51dfdb0f9504ec Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 13:32:30 -0700 Subject: [PATCH 07/24] migrate Grpc.IntegrationTesting to NUnit3 --- .../Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs | 6 +++--- src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs index 99aa7290301..5fd0e14e78d 100644 --- a/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs @@ -84,7 +84,7 @@ namespace Grpc.IntegrationTesting { var call = client.StreamingInputCall(); - var ex = Assert.Throws(async () => await call); + var ex = Assert.ThrowsAsync(async () => await call); Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode); } @@ -93,7 +93,7 @@ namespace Grpc.IntegrationTesting { var call = client.StreamingOutputCall(new StreamingOutputCallRequest()); - var ex = Assert.Throws(async () => await call.ResponseStream.MoveNext()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode); } @@ -102,7 +102,7 @@ namespace Grpc.IntegrationTesting { var call = client.FullDuplexCall(); - var ex = Assert.Throws(async () => await call.ResponseStream.MoveNext()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode); } diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 7ca52219360..54365179603 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -445,7 +445,7 @@ namespace Grpc.IntegrationTesting await Task.Delay(1000); cts.Cancel(); - var ex = Assert.Throws(async () => await call.ResponseAsync); + var ex = Assert.ThrowsAsync(async () => await call.ResponseAsync); Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode); } Console.WriteLine("Passed!"); @@ -471,7 +471,7 @@ namespace Grpc.IntegrationTesting cts.Cancel(); - var ex = Assert.Throws(async () => await call.ResponseStream.MoveNext()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode); } Console.WriteLine("Passed!"); @@ -493,7 +493,7 @@ namespace Grpc.IntegrationTesting // Deadline was reached before write has started. Eat the exception and continue. } - var ex = Assert.Throws(async () => await call.ResponseStream.MoveNext()); + var ex = Assert.ThrowsAsync(async () => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); } Console.WriteLine("Passed!"); @@ -572,7 +572,7 @@ namespace Grpc.IntegrationTesting await call.RequestStream.WriteAsync(request); await call.RequestStream.CompleteAsync(); - var e = Assert.Throws(async () => await call.ResponseStream.ToListAsync()); + var e = Assert.ThrowsAsync(async () => await call.ResponseStream.ToListAsync()); Assert.AreEqual(StatusCode.Unknown, e.Status.StatusCode); Assert.AreEqual(echoStatus.Message, e.Status.Detail); } From fd8d2735266bf9f8d481973956ea823aaadbb853 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 15:11:07 -0700 Subject: [PATCH 08/24] cleanup of C# interop dockerimage --- tools/dockerfile/grpc_interop_csharp/Dockerfile | 10 +++------- tools/dockerfile/grpc_interop_csharp/build_interop.sh | 4 +--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tools/dockerfile/grpc_interop_csharp/Dockerfile b/tools/dockerfile/grpc_interop_csharp/Dockerfile index 3789cd32038..93cd25010ef 100644 --- a/tools/dockerfile/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/grpc_interop_csharp/Dockerfile @@ -80,13 +80,9 @@ RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat # Install dependencies RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ mono-devel \ - nunit \ - nunit-console \ - monodevelop - -# Download NuGet -RUN cd /var/local && wget www.nuget.org/NuGet.exe -ENV NUGET mono /var/local/NuGet.exe + ca-certificates-mono \ + nuget \ + && apt-get clean # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/grpc_interop_csharp/build_interop.sh index dc1f7a331ab..fd5436c44ff 100755 --- a/tools/dockerfile/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/grpc_interop_csharp/build_interop.sh @@ -40,6 +40,4 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc # build C# interop client & server -make CONFIG=dbg grpc_csharp_ext -(cd src/csharp && mono /var/local/NuGet.exe restore Grpc.sln) -(cd src/csharp && xbuild Grpc.sln) +tools/run_tests/run_tests.py -l csharp -c dbg --build_only From b323608b2717ed617edcebfca9ffb1249045e141 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 17:08:57 -0700 Subject: [PATCH 09/24] fix test credentials for nunit3 --- .../TestCredentials.cs | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs index ce108d808b6..aa54cd38a1d 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs @@ -50,9 +50,29 @@ namespace Grpc.IntegrationTesting { public const string DefaultHostOverride = "foo.test.google.fr"; - public const string ClientCertAuthorityPath = "data/ca.pem"; - public const string ServerCertChainPath = "data/server1.pem"; - public const string ServerPrivateKeyPath = "data/server1.key"; + public static string ClientCertAuthorityPath + { + get + { + return GetPath("data/ca.pem"); + } + } + + public static string ServerCertChainPath + { + get + { + return GetPath("data/server1.pem"); + } + } + + public static string ServerPrivateKeyPath + { + get + { + return GetPath("data/server1.key"); + } + } public static SslCredentials CreateSslCredentials() { @@ -66,5 +86,10 @@ namespace Grpc.IntegrationTesting File.ReadAllText(ServerPrivateKeyPath)); return new SslServerCredentials(new[] { keyCertPair }); } + + private static string GetPath(string relativePath) + { + return Path.Combine(TestContext.CurrentContext.TestDirectory, relativePath); + } } } From f6824c2685af5a3c55868dc23293d663b5bcb403 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 17:18:44 -0700 Subject: [PATCH 10/24] fix run_tests scripts --- tools/run_tests/run_csharp.bat | 7 +++++-- tools/run_tests/run_csharp.sh | 5 ++++- tools/run_tests/run_tests.py | 15 ++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/run_tests/run_csharp.bat b/tools/run_tests/run_csharp.bat index 29c879e23be..025ec034723 100644 --- a/tools/run_tests/run_csharp.bat +++ b/tools/run_tests/run_csharp.bat @@ -5,12 +5,15 @@ setlocal @rem enter src/csharp directory cd /d %~dp0\..\..\src\csharp +rem nunit3-console fails if nunit.framework.dll is not found. +copy packages\NUnit.3.2.0\lib\net45\nunit.framework.dll packages\NUnit.ConsoleRunner.3.2.0\tools\nunit.framework.dll + if not "%CONFIG%" == "gcov" ( - packages\NUnit.Runners.2.6.4\tools\nunit-console-x86.exe %* || goto :error + packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe %* || goto :error ) else ( @rem Run all tests with code coverage - packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"packages\NUnit.Runners.2.6.4\tools\nunit-console-x86.exe" -targetdir:"." -targetargs:"%*" -filter:"+[Grpc.Core]*" -register:user -output:coverage_results.xml || goto :error + packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe" -targetdir:"." -targetargs:"%*" -filter:"+[Grpc.Core]*" -register:user -output:coverage_results.xml || goto :error packages\ReportGenerator.2.4.4.0\tools\ReportGenerator.exe -reports:"coverage_results.xml" -targetdir:"..\..\reports\csharp_coverage" -reporttypes:"Html;TextSummary" || goto :error diff --git a/tools/run_tests/run_csharp.sh b/tools/run_tests/run_csharp.sh index dad44c4e4f6..71cd87411f5 100755 --- a/tools/run_tests/run_csharp.sh +++ b/tools/run_tests/run_csharp.sh @@ -31,7 +31,10 @@ set -ex CONFIG=${CONFIG:-opt} -NUNIT_CONSOLE="mono packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" +NUNIT_CONSOLE="mono packages/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe" + +# nunit3-console fails if nunit.framework.dll is not found. +cp -u src/csharp/packages/NUnit.3.2.0/lib/net45/nunit.framework.dll src/csharp/packages/NUnit.ConsoleRunner.3.2.0/tools/ # change to gRPC repo root cd $(dirname $0)/../.. diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index dfac94660b6..4f3aaca7ecd 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -494,11 +494,16 @@ class CSharpLanguage(object): assembly_files = ['%s/bin/%s/%s.dll' % (a, msbuild_config, a) for a in assemblies] - extra_args = ['-labels'] + assembly_files + # TODO(jtattermusch): use --x86 when needed + + extra_args = ['--labels=All', + '--noresult', + '--workers=1', + '--inprocess'] + assembly_files if self.platform == 'windows': script_name = 'tools\\run_tests\\run_csharp.bat' - extra_args += ['-domain=None'] + extra_args += ['--domain=None'] else: script_name = 'tools/run_tests/run_csharp.sh' @@ -512,11 +517,7 @@ class CSharpLanguage(object): else: specs = [] for test in tests: - cmdline = [script_name, '-run=%s' % test] + extra_args - if self.platform == 'windows': - # use different output directory for each test to prevent - # TestResult.xml clash between parallel test runs. - cmdline += ['-work=test-result/%s' % uuid.uuid4()] + cmdline = [script_name, '--test=%s' % test] + extra_args specs.append(self.config.job_spec(cmdline, None, shortname='csharp.%s' % test, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) From a8ef9c39254c4b37f9b7bdf9c4d03766f1d8818e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 17:48:40 -0700 Subject: [PATCH 11/24] use correct non-overwrite flag for cp --- tools/run_tests/run_csharp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_csharp.sh b/tools/run_tests/run_csharp.sh index 71cd87411f5..7ba21d460ef 100755 --- a/tools/run_tests/run_csharp.sh +++ b/tools/run_tests/run_csharp.sh @@ -34,7 +34,7 @@ CONFIG=${CONFIG:-opt} NUNIT_CONSOLE="mono packages/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe" # nunit3-console fails if nunit.framework.dll is not found. -cp -u src/csharp/packages/NUnit.3.2.0/lib/net45/nunit.framework.dll src/csharp/packages/NUnit.ConsoleRunner.3.2.0/tools/ +cp -n src/csharp/packages/NUnit.3.2.0/lib/net45/nunit.framework.dll src/csharp/packages/NUnit.ConsoleRunner.3.2.0/tools/ # change to gRPC repo root cd $(dirname $0)/../.. From 21451b7af67bebb3510040e1dbc54c63f91941c7 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 8 Apr 2016 20:59:34 -0700 Subject: [PATCH 12/24] add NUnitMain to test projects --- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 3 +- src/csharp/Grpc.Core.Tests/NUnitMain.cs | 55 +++++++++++++++++++ .../Grpc.Examples.Tests.csproj | 3 +- src/csharp/Grpc.Examples.Tests/NUnitMain.cs | 55 +++++++++++++++++++ .../Grpc.HealthCheck.Tests.csproj | 3 +- .../Grpc.HealthCheck.Tests/NUnitMain.cs | 55 +++++++++++++++++++ .../Grpc.IntegrationTesting.csproj | 3 +- .../Grpc.IntegrationTesting/NUnitMain.cs | 55 +++++++++++++++++++ 8 files changed, 228 insertions(+), 4 deletions(-) create mode 100644 src/csharp/Grpc.Core.Tests/NUnitMain.cs create mode 100644 src/csharp/Grpc.Examples.Tests/NUnitMain.cs create mode 100644 src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs create mode 100644 src/csharp/Grpc.IntegrationTesting/NUnitMain.cs diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 5f0efb48890..d5f21b09d29 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -4,7 +4,7 @@ Debug AnyCPU {86EC5CB4-4EA2-40A2-8057-86542A0353BB} - Library + Exe Grpc.Core.Tests Grpc.Core.Tests v4.5 @@ -79,6 +79,7 @@ + diff --git a/src/csharp/Grpc.Core.Tests/NUnitMain.cs b/src/csharp/Grpc.Core.Tests/NUnitMain.cs new file mode 100644 index 00000000000..494bb0a33ff --- /dev/null +++ b/src/csharp/Grpc.Core.Tests/NUnitMain.cs @@ -0,0 +1,55 @@ +#region Copyright notice and license + +// Copyright 2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using NUnit.Common; +using NUnitLite; + +namespace Grpc.Core.Tests +{ + /// + /// Provides entry point for NUnitLite + /// + public class NUnitMain + { + public static void Main(string[] args) + { +#if DOTNET5_4 + new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); +#else + new AutoRun().Execute(args); +#endif + } + } +} diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index baf25770900..4923a96545e 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -6,7 +6,7 @@ 10.0.0 2.0 {143B1C29-C442-4BE0-BF3F-A8F92288AC9F} - Library + Exe Grpc.Examples.Tests Grpc.Examples.Tests v4.5 @@ -57,6 +57,7 @@ + diff --git a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs new file mode 100644 index 00000000000..0f234086d8c --- /dev/null +++ b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs @@ -0,0 +1,55 @@ +#region Copyright notice and license + +// Copyright 2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using NUnit.Common; +using NUnitLite; + +namespace Grpc.Examples.Tests +{ + /// + /// Provides entry point for NUnitLite + /// + public class NUnitMain + { + public static void Main(string[] args) + { +#if DOTNET5_4 + new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); +#else + new AutoRun().Execute(args); +#endif + } + } +} diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 62474b46911..3698dbc4090 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -5,7 +5,7 @@ Debug AnyCPU {F8C6D937-C44B-4EE3-A431-B0FBAEACE47D} - Library + Exe Properties Grpc.HealthCheck.Tests Grpc.HealthCheck.Tests @@ -60,6 +60,7 @@ + diff --git a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs new file mode 100644 index 00000000000..8d5182155ee --- /dev/null +++ b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs @@ -0,0 +1,55 @@ +#region Copyright notice and license + +// Copyright 2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using NUnit.Common; +using NUnitLite; + +namespace Grpc.HealthCheck.Tests +{ + /// + /// Provides entry point for NUnitLite + /// + public class NUnitMain + { + public static void Main(string[] args) + { +#if DOTNET5_4 + new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); +#else + new AutoRun().Execute(args); +#endif + } + } +} diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index 9c56608427f..e454c3e5c8f 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -4,7 +4,7 @@ Debug AnyCPU {C61154BA-DD4A-4838-8420-0162A28925E0} - Library + Exe Grpc.IntegrationTesting Grpc.IntegrationTesting v4.5 @@ -117,6 +117,7 @@ + diff --git a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs new file mode 100644 index 00000000000..45fa0e5d0cb --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs @@ -0,0 +1,55 @@ +#region Copyright notice and license + +// Copyright 2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Reflection; +using NUnit.Common; +using NUnitLite; + +namespace Grpc.IntegrationTesting +{ + /// + /// Provides entry point for NUnitLite + /// + public class NUnitMain + { + public static void Main(string[] args) + { +#if DOTNET5_4 + new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); +#else + new AutoRun().Execute(args); +#endif + } + } +} From a49a72dc0dfb59295a3ba0ae59febbcfe8257ff0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 12:50:35 -0700 Subject: [PATCH 13/24] use NUnitLite to run nunit tests --- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 11 ++--- src/csharp/Grpc.Core.Tests/packages.config | 1 + .../Grpc.Examples.Tests.csproj | 16 +++---- .../Grpc.Examples.Tests/packages.config | 11 ++--- .../Grpc.HealthCheck.Tests.csproj | 23 +++++----- .../Grpc.HealthCheck.Tests/packages.config | 1 + .../Grpc.IntegrationTesting.csproj | 45 +++++++++---------- .../Grpc.IntegrationTesting/packages.config | 1 + 8 files changed, 54 insertions(+), 55 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index d5f21b09d29..d9b93e9eb59 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -35,15 +35,16 @@ ..\keys\Grpc.snk - - False + + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - False + ..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll + + ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + diff --git a/src/csharp/Grpc.Core.Tests/packages.config b/src/csharp/Grpc.Core.Tests/packages.config index e019bcbd7e0..c5cfde2ab73 100644 --- a/src/csharp/Grpc.Core.Tests/packages.config +++ b/src/csharp/Grpc.Core.Tests/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 4923a96545e..cfe668b6bed 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -3,8 +3,6 @@ Debug AnyCPU - 10.0.0 - 2.0 {143B1C29-C442-4BE0-BF3F-A8F92288AC9F} Exe Grpc.Examples.Tests @@ -37,19 +35,19 @@ ..\keys\Grpc.snk - - False + + ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - - False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - False + ..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll + + ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index 28010f412f8..ce030f9d777 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,6 +1,7 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 3698dbc4090..0bea9c03e7a 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -1,5 +1,5 @@  - + Debug @@ -37,14 +37,6 @@ ..\keys\Grpc.snk - - False - ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - - - False - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - @@ -52,6 +44,15 @@ + + ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll + + + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll + + + ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + @@ -64,11 +65,11 @@ - {ccc4440e-49f7-4790-b0af-feabb0837ae7} + {CCC4440E-49F7-4790-B0AF-FEABB0837AE7} Grpc.Core - {aa5e328a-8835-49d7-98ed-c29f2b3049f0} + {AA5E328A-8835-49D7-98ED-C29F2B3049F0} Grpc.HealthCheck diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index caf99ecfdbe..8066d8fcebd 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index e454c3e5c8f..c16d0e5c5d0 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -38,48 +38,43 @@ ..\keys\Grpc.snk - - False - ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - ..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll - - False + + ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll + + + + + + + ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll + + ..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll - - False + ..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll - - False + ..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll - - False + ..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - - ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - - False + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - False + ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - False + ..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll - - - + + ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index a18137cbbf4..3fef67dca4f 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -9,4 +9,5 @@ + \ No newline at end of file From 10e85f1ef7c0f6df55eaa4eee6804c9f0ec3d5eb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 13:16:37 -0700 Subject: [PATCH 14/24] fix interop tests --- src/csharp/Grpc.IntegrationTesting/TestCredentials.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs index aa54cd38a1d..774563d752f 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestCredentials.cs @@ -35,6 +35,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Reflection; using System.Text.RegularExpressions; using System.Threading.Tasks; using Grpc.Core; @@ -89,7 +90,8 @@ namespace Grpc.IntegrationTesting private static string GetPath(string relativePath) { - return Path.Combine(TestContext.CurrentContext.TestDirectory, relativePath); + var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + return Path.Combine(assemblyDir, relativePath); } } } From 04743d7a0b4e6a27bdab75cccab3201b2d81f95f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 13:23:47 -0700 Subject: [PATCH 15/24] add Newtonsoft.Json to Grpc.Core.Tests --- src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj | 3 +++ src/csharp/Grpc.Core.Tests/packages.config | 1 + 2 files changed, 4 insertions(+) diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index d9b93e9eb59..0cd059c2327 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -45,6 +45,9 @@ ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + diff --git a/src/csharp/Grpc.Core.Tests/packages.config b/src/csharp/Grpc.Core.Tests/packages.config index c5cfde2ab73..aa7d951fdc7 100644 --- a/src/csharp/Grpc.Core.Tests/packages.config +++ b/src/csharp/Grpc.Core.Tests/packages.config @@ -1,6 +1,7 @@  + \ No newline at end of file From 31b8316ab9ac69f5d870a74330ccd9dfd1e4ba76 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 14:44:22 -0700 Subject: [PATCH 16/24] make NUnitMain fail on failure --- src/csharp/Grpc.Core.Tests/NUnitMain.cs | 6 +++--- src/csharp/Grpc.Examples.Tests/NUnitMain.cs | 6 +++--- src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs | 6 +++--- src/csharp/Grpc.IntegrationTesting/NUnitMain.cs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/NUnitMain.cs b/src/csharp/Grpc.Core.Tests/NUnitMain.cs index 494bb0a33ff..13e5b27f7bd 100644 --- a/src/csharp/Grpc.Core.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Core.Tests/NUnitMain.cs @@ -43,12 +43,12 @@ namespace Grpc.Core.Tests /// public class NUnitMain { - public static void Main(string[] args) + public static int Main(string[] args) { #if DOTNET5_4 - new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else - new AutoRun().Execute(args); + return new AutoRun().Execute(args); #endif } } diff --git a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs index 0f234086d8c..e6b76bcf3ba 100644 --- a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs @@ -43,12 +43,12 @@ namespace Grpc.Examples.Tests /// public class NUnitMain { - public static void Main(string[] args) + public static int Main(string[] args) { #if DOTNET5_4 - new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else - new AutoRun().Execute(args); + return new AutoRun().Execute(args); #endif } } diff --git a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs index 8d5182155ee..6d77b12fef9 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs @@ -43,12 +43,12 @@ namespace Grpc.HealthCheck.Tests /// public class NUnitMain { - public static void Main(string[] args) + public static int Main(string[] args) { #if DOTNET5_4 - new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else - new AutoRun().Execute(args); + return new AutoRun().Execute(args); #endif } } diff --git a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs index 45fa0e5d0cb..4db8e158d3c 100644 --- a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs +++ b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs @@ -43,12 +43,12 @@ namespace Grpc.IntegrationTesting /// public class NUnitMain { - public static void Main(string[] args) + public static int Main(string[] args) { #if DOTNET5_4 - new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); + return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else - new AutoRun().Execute(args); + return new AutoRun().Execute(args); #endif } } From 38ed2cfdb588d2f04a9ce7c4bc352f26c534935d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 16:24:16 -0700 Subject: [PATCH 17/24] teach run_tests how to run C# tests with NUnitLite --- tools/run_tests/post_tests_csharp.bat | 21 ++++++ .../{run_csharp.sh => post_tests_csharp.sh} | 27 +++----- tools/run_tests/run_csharp.bat | 30 -------- tools/run_tests/run_tests.py | 69 ++++++++++--------- 4 files changed, 67 insertions(+), 80 deletions(-) create mode 100644 tools/run_tests/post_tests_csharp.bat rename tools/run_tests/{run_csharp.sh => post_tests_csharp.sh} (68%) delete mode 100644 tools/run_tests/run_csharp.bat diff --git a/tools/run_tests/post_tests_csharp.bat b/tools/run_tests/post_tests_csharp.bat new file mode 100644 index 00000000000..a3137aafa1f --- /dev/null +++ b/tools/run_tests/post_tests_csharp.bat @@ -0,0 +1,21 @@ +@rem Runs C# tests for given assembly from command line. The Grpc.sln solution needs to be built before running the tests. + +setlocal + +@rem enter src/csharp directory +cd /d %~dp0\..\..\src\csharp + +@rem Generate code coverage report +@rem TODO(jtattermusch): currently the report list is hardcoded +packages\ReportGenerator.2.4.4.0\tools\ReportGenerator.exe -reports:"coverage_csharp_*.xml" -targetdir:"..\..\reports\csharp_coverage" -reporttypes:"Html;TextSummary" || goto :error + +@rem Generate the index.html file +echo ^^^^^csharp coverage^^
^
^
>..\..\reports\index.html + +endlocal + +goto :EOF + +:error +echo Failed! +exit /b %errorlevel% diff --git a/tools/run_tests/run_csharp.sh b/tools/run_tests/post_tests_csharp.sh similarity index 68% rename from tools/run_tests/run_csharp.sh rename to tools/run_tests/post_tests_csharp.sh index 7ba21d460ef..bb6f5c6e188 100755 --- a/tools/run_tests/run_csharp.sh +++ b/tools/run_tests/post_tests_csharp.sh @@ -30,26 +30,15 @@ set -ex -CONFIG=${CONFIG:-opt} -NUNIT_CONSOLE="mono packages/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe" - -# nunit3-console fails if nunit.framework.dll is not found. -cp -n src/csharp/packages/NUnit.3.2.0/lib/net45/nunit.framework.dll src/csharp/packages/NUnit.ConsoleRunner.3.2.0/tools/ +if [ "$CONFIG" != "gcov" ] ; then exit ; fi # change to gRPC repo root cd $(dirname $0)/../.. -(cd src/csharp; $NUNIT_CONSOLE $@) - -if [ "$CONFIG" = "gcov" ] -then - # Generate the csharp extension coverage report - gcov objs/gcov/src/csharp/ext/*.o - lcov --base-directory . --directory . -c -o coverage.info - lcov -e coverage.info '**/src/csharp/ext/*' -o coverage.info - genhtml -o reports/csharp_ext_coverage --num-spaces 2 \ - -t 'gRPC C# native extension test coverage' coverage.info \ - --rc genhtml_hi_limit=95 --rc genhtml_med_limit=80 --no-prefix -fi - - +# Generate the csharp extension coverage report +gcov objs/gcov/src/csharp/ext/*.o +lcov --base-directory . --directory . -c -o coverage.info +lcov -e coverage.info '**/src/csharp/ext/*' -o coverage.info +genhtml -o reports/csharp_ext_coverage --num-spaces 2 \ + -t 'gRPC C# native extension test coverage' coverage.info \ + --rc genhtml_hi_limit=95 --rc genhtml_med_limit=80 --no-prefix diff --git a/tools/run_tests/run_csharp.bat b/tools/run_tests/run_csharp.bat deleted file mode 100644 index 025ec034723..00000000000 --- a/tools/run_tests/run_csharp.bat +++ /dev/null @@ -1,30 +0,0 @@ -@rem Runs C# tests for given assembly from command line. The Grpc.sln solution needs to be built before running the tests. - -setlocal - -@rem enter src/csharp directory -cd /d %~dp0\..\..\src\csharp - -rem nunit3-console fails if nunit.framework.dll is not found. -copy packages\NUnit.3.2.0\lib\net45\nunit.framework.dll packages\NUnit.ConsoleRunner.3.2.0\tools\nunit.framework.dll - -if not "%CONFIG%" == "gcov" ( - packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe %* || goto :error -) else ( - @rem Run all tests with code coverage - - packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe" -targetdir:"." -targetargs:"%*" -filter:"+[Grpc.Core]*" -register:user -output:coverage_results.xml || goto :error - - packages\ReportGenerator.2.4.4.0\tools\ReportGenerator.exe -reports:"coverage_results.xml" -targetdir:"..\..\reports\csharp_coverage" -reporttypes:"Html;TextSummary" || goto :error - - @rem Generate the index.html file - echo ^^^^^csharp coverage^^
^^ >..\..\reports\index.html -) - -endlocal - -goto :EOF - -:error -echo Failed! -exit /b %errorlevel% diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4f3aaca7ecd..e2cc3bdfffb 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -486,42 +486,46 @@ class CSharpLanguage(object): def test_specs(self): with open('src/csharp/tests.json') as f: - tests_json = json.load(f) - assemblies = tests_json['assemblies'] - tests = tests_json['tests'] + tests_by_assembly = json.load(f) msbuild_config = _MSBUILD_CONFIG[self.config.build_config] - assembly_files = ['%s/bin/%s/%s.dll' % (a, msbuild_config, a) - for a in assemblies] - - # TODO(jtattermusch): use --x86 when needed - - extra_args = ['--labels=All', + nunit_args = ['--labels=All', '--noresult', - '--workers=1', - '--inprocess'] + assembly_files - + '--workers=1'] if self.platform == 'windows': - script_name = 'tools\\run_tests\\run_csharp.bat' - extra_args += ['--domain=None'] + runtime_cmd = [] else: - script_name = 'tools/run_tests/run_csharp.sh' - - if self.config.build_config == 'gcov': - # On Windows, we only collect C# code coverage. - # On Linux, we only collect coverage for native extension. - # For code coverage all tests need to run as one suite. - return [self.config.job_spec([script_name] + extra_args, None, - shortname='csharp.coverage', - environ=_FORCE_ENVIRON_FOR_WRAPPERS)] - else: - specs = [] - for test in tests: - cmdline = [script_name, '--test=%s' % test] + extra_args - specs.append(self.config.job_spec(cmdline, None, - shortname='csharp.%s' % test, + runtime_cmd = ['mono'] + + specs = [] + for assembly in tests_by_assembly.iterkeys(): + assembly_file = 'src/csharp/%s/bin/%s/%s.exe' % (assembly, msbuild_config, assembly) + if self.config.build_config != 'gcov': + # normally, run each test as a separate process + for test in tests_by_assembly[assembly]: + cmdline = runtime_cmd + [assembly_file, '--test=%s' % test] + nunit_args + specs.append(self.config.job_spec(cmdline, + None, + shortname='csharp.%s' % test, + environ=_FORCE_ENVIRON_FOR_WRAPPERS)) + else: + # for test coverage, run all tests from the same assembly at once + # on Windows, things get more complicated as we need to run the code coverage tool + if self.platform == 'windows': + cmdline = ['packages\OpenCover.4.6.519\tools\OpenCover.Console.exe', + '-target:%s' % assembly_file, + '-targetdir:src\\csharp', + '-targetargs:%s' % ' '.join(nunit_args), + '-filter:+[Grpc.Core]*', + '-register:user', + '-output:coverage_csharp_%s.xml' % assembly] + else: + cmdline = runtime_cmd + [assembly_file] + nunit_args + + specs.append(self.config.job_spec([script_name] + extra_args, None, + shortname='csharp.coverage.%s' % assembly, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) - return specs + return specs def pre_build_steps(self): if self.platform == 'windows': @@ -544,7 +548,10 @@ class CSharpLanguage(object): return [['tools/run_tests/build_csharp.sh']] def post_tests_steps(self): - return [] + if self.platform == 'windows': + return [['tools\\run_tests\\post_tests_csharp.bat']] + else: + return [['tools/run_tests/post_tests_csharp.sh']] def makefile_name(self): return 'Makefile' From 9c3f15c43b3e2b68a239639ef13f50391b98a184 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 16:25:01 -0700 Subject: [PATCH 18/24] improve C# sanity test --- src/csharp/Grpc.Core.Tests/SanityTest.cs | 28 ++++++++++++------------ src/csharp/tests.json | 22 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/SanityTest.cs b/src/csharp/Grpc.Core.Tests/SanityTest.cs index 343ab1e85a1..3830f0cbacf 100644 --- a/src/csharp/Grpc.Core.Tests/SanityTest.cs +++ b/src/csharp/Grpc.Core.Tests/SanityTest.cs @@ -38,6 +38,7 @@ using System.Reflection; using Grpc.Core; using Grpc.Core.Internal; using Grpc.Core.Utils; +using Newtonsoft.Json; using NUnit.Framework; namespace Grpc.Core.Tests @@ -55,27 +56,23 @@ namespace Grpc.Core.Tests [Test] public void TestsJsonUpToDate() { - var testClasses = DiscoverAllTestClasses(); - string testsJson = GetTestsJson(); + var discoveredTests = DiscoverAllTestClasses(); + string discoveredTestsJson = JsonConvert.SerializeObject(discoveredTests, Formatting.Indented); - // we don't have a JSON parser at hand, but check that the test class - // name is contained in the file instead. - foreach (var className in testClasses) { - Assert.IsTrue(testsJson.Contains(className), - string.Format("Test class \"{0}\" is missing in C# tests.json file", className)); - } + Assert.AreEqual(discoveredTestsJson, ReadTestsJson()); } /// /// Gets list of all test classes obtained by inspecting all the test assemblies. /// - private List DiscoverAllTestClasses() + private Dictionary> DiscoverAllTestClasses() { var assemblies = GetTestAssemblies(); - var testClasses = new List(); + var testsByAssembly = new Dictionary>(); foreach (var assembly in assemblies) { + var testClasses = new List(); foreach (var t in assembly.GetTypes()) { foreach (var m in t.GetMethods()) @@ -89,16 +86,19 @@ namespace Grpc.Core.Tests } } + testClasses.Sort(); + testsByAssembly.Add(assembly.GetName().Name, testClasses); } - testClasses.Sort(); - return testClasses; + return testsByAssembly; } - private string GetTestsJson() + /// + /// Reads contents of tests.json file. + /// + private string ReadTestsJson() { var assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var testsJsonFile = Path.Combine(assemblyDir, "..", "..", "..", "tests.json"); - return File.ReadAllText(testsJsonFile); } diff --git a/src/csharp/tests.json b/src/csharp/tests.json index 718bfa3287b..f733352a310 100644 --- a/src/csharp/tests.json +++ b/src/csharp/tests.json @@ -1,11 +1,5 @@ { - "assemblies": [ - "Grpc.Core.Tests", - "Grpc.Examples.Tests", - "Grpc.HealthCheck.Tests", - "Grpc.IntegrationTesting" - ], - "tests": [ + "Grpc.Core.Tests": [ "Grpc.Core.Internal.Tests.AsyncCallTest", "Grpc.Core.Internal.Tests.ChannelArgsSafeHandleTest", "Grpc.Core.Internal.Tests.CompletionQueueEventTest", @@ -32,13 +26,19 @@ "Grpc.Core.Tests.ServerTest", "Grpc.Core.Tests.ShutdownTest", "Grpc.Core.Tests.TimeoutsTest", - "Grpc.Core.Tests.UserAgentStringTest", - "Math.Tests.MathClientServerTest", + "Grpc.Core.Tests.UserAgentStringTest" + ], + "Grpc.Examples.Tests": [ + "Math.Tests.MathClientServerTest" + ], + "Grpc.HealthCheck.Tests": [ "Grpc.HealthCheck.Tests.HealthClientServerTest", - "Grpc.HealthCheck.Tests.HealthServiceImplTest", - "Grpc.IntegrationTesting.HistogramTest", + "Grpc.HealthCheck.Tests.HealthServiceImplTest" + ], + "Grpc.IntegrationTesting": [ "Grpc.IntegrationTesting.GeneratedClientTest", "Grpc.IntegrationTesting.GeneratedServiceBaseTest", + "Grpc.IntegrationTesting.HistogramTest", "Grpc.IntegrationTesting.InteropClientServerTest", "Grpc.IntegrationTesting.MetadataCredentialsTest", "Grpc.IntegrationTesting.RunnerClientServerTest", From 35e608fb8f203fcff668e9b915521beece49906e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 16:35:06 -0700 Subject: [PATCH 19/24] run_tests.py script fixup --- tools/run_tests/run_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index e2cc3bdfffb..52244977035 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -522,7 +522,8 @@ class CSharpLanguage(object): else: cmdline = runtime_cmd + [assembly_file] + nunit_args - specs.append(self.config.job_spec([script_name] + extra_args, None, + specs.append(self.config.job_spec(cmdline, + None, shortname='csharp.coverage.%s' % assembly, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) return specs From 67306daaa20fc1fda9c91ffc4573d69749ca80c1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 16:52:38 -0700 Subject: [PATCH 20/24] fix .bat script --- tools/run_tests/post_tests_csharp.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/run_tests/post_tests_csharp.bat b/tools/run_tests/post_tests_csharp.bat index a3137aafa1f..7851b9137ac 100644 --- a/tools/run_tests/post_tests_csharp.bat +++ b/tools/run_tests/post_tests_csharp.bat @@ -2,6 +2,10 @@ setlocal +if not "%CONFIG%" == "gcov" ( + goto :EOF +) + @rem enter src/csharp directory cd /d %~dp0\..\..\src\csharp From bd58f6f76bedbf3ef4e875ab5fcebbcea71412de Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sat, 9 Apr 2016 16:57:55 -0700 Subject: [PATCH 21/24] fix C# coverage on windows --- tools/run_tests/run_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 52244977035..d1beaa3e50d 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -512,13 +512,13 @@ class CSharpLanguage(object): # for test coverage, run all tests from the same assembly at once # on Windows, things get more complicated as we need to run the code coverage tool if self.platform == 'windows': - cmdline = ['packages\OpenCover.4.6.519\tools\OpenCover.Console.exe', + cmdline = ['src\\csharp\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe', '-target:%s' % assembly_file, '-targetdir:src\\csharp', '-targetargs:%s' % ' '.join(nunit_args), '-filter:+[Grpc.Core]*', '-register:user', - '-output:coverage_csharp_%s.xml' % assembly] + '-output:src\\csharp\\coverage_csharp_%s.xml' % assembly] else: cmdline = runtime_cmd + [assembly_file] + nunit_args From a5f1f120aad8964bbcc198025bbaa4f2dd2094fd Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 11 Apr 2016 15:49:56 -0700 Subject: [PATCH 22/24] make sure OpenCover.Console runs exclusively --- tools/run_tests/run_tests.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index d1beaa3e50d..9dff686bbf6 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -500,7 +500,7 @@ class CSharpLanguage(object): specs = [] for assembly in tests_by_assembly.iterkeys(): assembly_file = 'src/csharp/%s/bin/%s/%s.exe' % (assembly, msbuild_config, assembly) - if self.config.build_config != 'gcov': + if self.config.build_config != 'gcov' or self.platform != 'windows': # normally, run each test as a separate process for test in tests_by_assembly[assembly]: cmdline = runtime_cmd + [assembly_file, '--test=%s' % test] + nunit_args @@ -509,22 +509,23 @@ class CSharpLanguage(object): shortname='csharp.%s' % test, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) else: - # for test coverage, run all tests from the same assembly at once - # on Windows, things get more complicated as we need to run the code coverage tool - if self.platform == 'windows': - cmdline = ['src\\csharp\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe', - '-target:%s' % assembly_file, - '-targetdir:src\\csharp', - '-targetargs:%s' % ' '.join(nunit_args), - '-filter:+[Grpc.Core]*', - '-register:user', - '-output:src\\csharp\\coverage_csharp_%s.xml' % assembly] - else: - cmdline = runtime_cmd + [assembly_file] + nunit_args - + # For C# test coverage, run all tests from the same assembly at once + # using OpenCover.Console (only works on Windows). + cmdline = ['src\\csharp\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe', + '-target:%s' % assembly_file, + '-targetdir:src\\csharp', + '-targetargs:%s' % ' '.join(nunit_args), + '-filter:+[Grpc.Core]*', + '-register:user', + '-output:src\\csharp\\coverage_csharp_%s.xml' % assembly] + + # set really high cpu_cost to make sure instances of OpenCover.Console run exclusively + # to prevent problems with registering the profiler. + run_exclusive = 1000000 specs.append(self.config.job_spec(cmdline, None, shortname='csharp.coverage.%s' % assembly, + cpu_cost=run_exclusive, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) return specs From d550ad1f7cd9cbd704a126873b2530e16fc7f3d9 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 11 Apr 2016 17:43:47 -0700 Subject: [PATCH 23/24] Add TextWriterLogger --- src/csharp/Grpc.Core/Grpc.Core.csproj | 5 +- src/csharp/Grpc.Core/Logging/ConsoleLogger.cs | 97 +--------- .../Grpc.Core/Logging/TextWriterLogger.cs | 176 ++++++++++++++++++ 3 files changed, 182 insertions(+), 96 deletions(-) create mode 100644 src/csharp/Grpc.Core/Logging/TextWriterLogger.cs diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 251a6889464..95077a6ca5a 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -58,6 +58,7 @@ + @@ -140,9 +141,7 @@
- - - + Resources\roots.pem diff --git a/src/csharp/Grpc.Core/Logging/ConsoleLogger.cs b/src/csharp/Grpc.Core/Logging/ConsoleLogger.cs index da74e55a95f..5e8dced6414 100644 --- a/src/csharp/Grpc.Core/Logging/ConsoleLogger.cs +++ b/src/csharp/Grpc.Core/Logging/ConsoleLogger.cs @@ -38,117 +38,28 @@ using System.Globalization; namespace Grpc.Core.Logging { /// Logger that logs to System.Console. - public class ConsoleLogger : ILogger + public class ConsoleLogger : TextWriterLogger { - // Format similar enough to C core log format except nanosecond precision is not supported. - const string DateTimeFormatString = "MMdd HH:mm:ss.ffffff"; - - readonly Type forType; - readonly string forTypeString; - /// Creates a console logger not associated to any specific type. public ConsoleLogger() : this(null) { } /// Creates a console logger that logs messsage specific for given type. - private ConsoleLogger(Type forType) + private ConsoleLogger(Type forType) : base(() => Console.Error, forType) { - this.forType = forType; - if (forType != null) - { - var namespaceStr = forType.Namespace ?? ""; - if (namespaceStr.Length > 0) - { - namespaceStr += "."; - } - this.forTypeString = namespaceStr + forType.Name + " "; - } - else - { - this.forTypeString = ""; - } } /// /// Returns a logger associated with the specified type. /// - public ILogger ForType() + public override ILogger ForType() { - if (typeof(T) == forType) + if (typeof(T) == AssociatedType) { return this; } return new ConsoleLogger(typeof(T)); } - - /// Logs a message with severity Debug. - public void Debug(string message) - { - Log("D", message); - } - - /// Logs a formatted message with severity Debug. - public void Debug(string format, params object[] formatArgs) - { - Debug(string.Format(format, formatArgs)); - } - - /// Logs a message with severity Info. - public void Info(string message) - { - Log("I", message); - } - - /// Logs a formatted message with severity Info. - public void Info(string format, params object[] formatArgs) - { - Info(string.Format(format, formatArgs)); - } - - /// Logs a message with severity Warning. - public void Warning(string message) - { - Log("W", message); - } - - /// Logs a formatted message with severity Warning. - public void Warning(string format, params object[] formatArgs) - { - Warning(string.Format(format, formatArgs)); - } - - /// Logs a message and an associated exception with severity Warning. - public void Warning(Exception exception, string message) - { - Warning(message + " " + exception); - } - - /// Logs a message with severity Error. - public void Error(string message) - { - Log("E", message); - } - - /// Logs a formatted message with severity Error. - public void Error(string format, params object[] formatArgs) - { - Error(string.Format(format, formatArgs)); - } - - /// Logs a message and an associated exception with severity Error. - public void Error(Exception exception, string message) - { - Error(message + " " + exception); - } - - private void Log(string severityString, string message) - { - Console.Error.WriteLine("{0}{1} {2}{3}", - severityString, - DateTime.Now.ToString(DateTimeFormatString, CultureInfo.InvariantCulture), - forTypeString, - message); - } } } diff --git a/src/csharp/Grpc.Core/Logging/TextWriterLogger.cs b/src/csharp/Grpc.Core/Logging/TextWriterLogger.cs new file mode 100644 index 00000000000..397320ddffa --- /dev/null +++ b/src/csharp/Grpc.Core/Logging/TextWriterLogger.cs @@ -0,0 +1,176 @@ +#region Copyright notice and license + +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using Grpc.Core.Utils; + +namespace Grpc.Core.Logging +{ + /// Logger that logs to an arbitrary System.IO.TextWriter. + public class TextWriterLogger : ILogger + { + // Format similar enough to C core log format except nanosecond precision is not supported. + const string DateTimeFormatString = "MMdd HH:mm:ss.ffffff"; + + readonly Func textWriterProvider; + readonly Type forType; + readonly string forTypeString; + + /// + /// Creates a console logger not associated to any specific type and writes to given System.IO.TextWriter. + /// User is responsible for providing an instance of TextWriter that is thread-safe. + /// + public TextWriterLogger(TextWriter textWriter) : this(() => textWriter) + { + GrpcPreconditions.CheckNotNull(textWriter); + } + + /// + /// Creates a console logger not associated to any specific type and writes to a System.IO.TextWriter obtained from given provider. + /// User is responsible for providing an instance of TextWriter that is thread-safe. + /// + public TextWriterLogger(Func textWriterProvider) : this(textWriterProvider, null) + { + } + + /// Creates a console logger that logs messsage specific for given type. + protected TextWriterLogger(Func textWriterProvider, Type forType) + { + this.textWriterProvider = GrpcPreconditions.CheckNotNull(textWriterProvider); + this.forType = forType; + if (forType != null) + { + var namespaceStr = forType.Namespace ?? ""; + if (namespaceStr.Length > 0) + { + namespaceStr += "."; + } + this.forTypeString = namespaceStr + forType.Name + " "; + } + else + { + this.forTypeString = ""; + } + } + + /// + /// Returns a logger associated with the specified type. + /// + public virtual ILogger ForType() + { + if (typeof(T) == forType) + { + return this; + } + return new TextWriterLogger(this.textWriterProvider, typeof(T)); + } + + /// Logs a message with severity Debug. + public void Debug(string message) + { + Log("D", message); + } + + /// Logs a formatted message with severity Debug. + public void Debug(string format, params object[] formatArgs) + { + Debug(string.Format(format, formatArgs)); + } + + /// Logs a message with severity Info. + public void Info(string message) + { + Log("I", message); + } + + /// Logs a formatted message with severity Info. + public void Info(string format, params object[] formatArgs) + { + Info(string.Format(format, formatArgs)); + } + + /// Logs a message with severity Warning. + public void Warning(string message) + { + Log("W", message); + } + + /// Logs a formatted message with severity Warning. + public void Warning(string format, params object[] formatArgs) + { + Warning(string.Format(format, formatArgs)); + } + + /// Logs a message and an associated exception with severity Warning. + public void Warning(Exception exception, string message) + { + Warning(message + " " + exception); + } + + /// Logs a message with severity Error. + public void Error(string message) + { + Log("E", message); + } + + /// Logs a formatted message with severity Error. + public void Error(string format, params object[] formatArgs) + { + Error(string.Format(format, formatArgs)); + } + + /// Logs a message and an associated exception with severity Error. + public void Error(Exception exception, string message) + { + Error(message + " " + exception); + } + + /// Gets the type associated with this logger. + protected Type AssociatedType + { + get { return forType; } + } + + private void Log(string severityString, string message) + { + textWriterProvider().WriteLine("{0}{1} {2}{3}", + severityString, + DateTime.Now.ToString(DateTimeFormatString, CultureInfo.InvariantCulture), + forTypeString, + message); + } + } +} From 2f0519e9be3a280483a93d297811882e1e4232b0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 11 Apr 2016 17:52:43 -0700 Subject: [PATCH 24/24] work around nunit issue #1406 --- src/csharp/Grpc.Core.Tests/NUnitMain.cs | 4 ++++ src/csharp/Grpc.Examples.Tests/NUnitMain.cs | 4 ++++ src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs | 4 ++++ src/csharp/Grpc.IntegrationTesting/NUnitMain.cs | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/csharp/Grpc.Core.Tests/NUnitMain.cs b/src/csharp/Grpc.Core.Tests/NUnitMain.cs index 13e5b27f7bd..9c1d7bf3c8a 100644 --- a/src/csharp/Grpc.Core.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Core.Tests/NUnitMain.cs @@ -33,6 +33,8 @@ using System; using System.Reflection; +using Grpc.Core; +using Grpc.Core.Logging; using NUnit.Common; using NUnitLite; @@ -45,6 +47,8 @@ namespace Grpc.Core.Tests { public static int Main(string[] args) { + // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. + GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error)); #if DOTNET5_4 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else diff --git a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs index e6b76bcf3ba..ea87802766b 100644 --- a/src/csharp/Grpc.Examples.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.Examples.Tests/NUnitMain.cs @@ -33,6 +33,8 @@ using System; using System.Reflection; +using Grpc.Core; +using Grpc.Core.Logging; using NUnit.Common; using NUnitLite; @@ -45,6 +47,8 @@ namespace Grpc.Examples.Tests { public static int Main(string[] args) { + // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. + GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error)); #if DOTNET5_4 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else diff --git a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs index 6d77b12fef9..0820523f35c 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs @@ -33,6 +33,8 @@ using System; using System.Reflection; +using Grpc.Core; +using Grpc.Core.Logging; using NUnit.Common; using NUnitLite; @@ -45,6 +47,8 @@ namespace Grpc.HealthCheck.Tests { public static int Main(string[] args) { + // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. + GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error)); #if DOTNET5_4 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else diff --git a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs index 4db8e158d3c..d8902de08f5 100644 --- a/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs +++ b/src/csharp/Grpc.IntegrationTesting/NUnitMain.cs @@ -33,6 +33,8 @@ using System; using System.Reflection; +using Grpc.Core; +using Grpc.Core.Logging; using NUnit.Common; using NUnitLite; @@ -45,6 +47,8 @@ namespace Grpc.IntegrationTesting { public static int Main(string[] args) { + // Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406. + GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error)); #if DOTNET5_4 return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #else