@ -32,8 +32,9 @@
""" Generates the appropriate build.json data for all the end2end tests. """
""" Generates the appropriate build.json data for all the end2end tests. """
import simplejson
import yaml
import collections
import collections
import hashlib
FixtureOptions = collections . namedtuple ( ' FixtureOptions ' , ' fullstack includes_proxy dns_resolver secure platforms ci_mac ' )
FixtureOptions = collections . namedtuple ( ' FixtureOptions ' , ' fullstack includes_proxy dns_resolver secure platforms ci_mac ' )
@ -42,22 +43,23 @@ socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace(
default_secure_fixture_options = default_unsecure_fixture_options . _replace ( secure = True )
default_secure_fixture_options = default_unsecure_fixture_options . _replace ( secure = True )
uds_fixture_options = default_unsecure_fixture_options . _replace ( dns_resolver = False , platforms = [ ' linux ' , ' mac ' , ' posix ' ] )
uds_fixture_options = default_unsecure_fixture_options . _replace ( dns_resolver = False , platforms = [ ' linux ' , ' mac ' , ' posix ' ] )
# maps fixture name to whether it requires the security library
# maps fixture name to whether it requires the security library
END2END_FIXTURES = {
END2END_FIXTURES = {
' c http 2_fake_ security ' : default_secure_fixture_options . _replace ( ci_mac = False ) ,
' h2_fakesec ' : default_secure_fixture_options . _replace ( ci_mac = False ) ,
' c http 2_fullstack ' : default_unsecure_fixture_options ,
' h2_full ' : default_unsecure_fixture_options ,
' c http 2_fullstack_ compression ' : default_unsecure_fixture_options ,
' h2_compress ' : default_unsecure_fixture_options ,
' c http 2_fullstack_ uds_posix ' : uds_fixture_options ,
' h2_uds ' : uds_fixture_options ,
' chttp2_fullstack_uds_posix_with_ poll' : uds_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' h2_uds+ poll' : uds_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' chttp2_fullstack_with_ poll' : default_unsecure_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' h2_full+ poll' : default_unsecure_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' c http 2_fullstack_with _proxy' : default_unsecure_fixture_options . _replace ( includes_proxy = True , ci_mac = False ) ,
' h2_proxy ' : default_unsecure_fixture_options . _replace ( includes_proxy = True , ci_mac = False ) ,
' c http 2_simple _ssl_fullstack ' : default_secure_fixture_options ,
' h2_ssl ' : default_secure_fixture_options ,
' chttp2_simple_ssl_fullstack_with_ poll' : default_secure_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' h2_ssl+ poll' : default_secure_fixture_options . _replace ( platforms = [ ' linux ' ] ) ,
' c http 2_simple_s sl_fullstack_with _proxy' : default_secure_fixture_options . _replace ( includes_proxy = True , ci_mac = False ) ,
' h2_ssl_proxy ' : default_secure_fixture_options . _replace ( includes_proxy = True , ci_mac = False ) ,
' c http 2_simple_ssl_with_ oauth2_fullstack ' : default_secure_fixture_options . _replace ( ci_mac = False ) ,
' h2_oauth2 ' : default_secure_fixture_options . _replace ( ci_mac = False ) ,
' c http 2_socket_ pair' : socketpair_unsecure_fixture_options . _replace ( ci_mac = False ) ,
' h2_sockpair ' : socketpair_unsecure_fixture_options . _replace ( ci_mac = False ) ,
' chttp2_socket_pair_one_byte_at_a_tim e' : socketpair_unsecure_fixture_options . _replace ( ci_mac = False ) ,
' h2_sockpair_1byt e' : socketpair_unsecure_fixture_options . _replace ( ci_mac = False ) ,
' chttp2_socket_pair_with_grpc_ trace' : socketpair_unsecure_fixture_options ,
' h2_sockpair+ trace' : socketpair_unsecure_fixture_options ,
}
}
TestOptions = collections . namedtuple ( ' TestOptions ' , ' needs_fullstack needs_dns proxyable flaky secure ' )
TestOptions = collections . namedtuple ( ' TestOptions ' , ' needs_fullstack needs_dns proxyable flaky secure ' )
@ -67,7 +69,7 @@ connectivity_test_options = default_test_options._replace(needs_fullstack=True)
# maps test names to options
# maps test names to options
END2END_TESTS = {
END2END_TESTS = {
' bad_hostname ' : default_test_options ,
' bad_hostname ' : default_test_options ,
' cancel_after_accept_and_writes_closed ' : default_test_options ,
' cancel_after_client_done ' : default_test_options ,
' cancel_after_accept ' : default_test_options ,
' cancel_after_accept ' : default_test_options ,
' cancel_after_invoke ' : default_test_options ,
' cancel_after_invoke ' : default_test_options ,
' cancel_before_invoke ' : default_test_options ,
' cancel_before_invoke ' : default_test_options ,
@ -76,8 +78,8 @@ END2END_TESTS = {
' channel_connectivity ' : connectivity_test_options . _replace ( proxyable = False ) ,
' channel_connectivity ' : connectivity_test_options . _replace ( proxyable = False ) ,
' default_host ' : default_test_options . _replace ( needs_fullstack = True , needs_dns = True ) ,
' default_host ' : default_test_options . _replace ( needs_fullstack = True , needs_dns = True ) ,
' disappearing_server ' : connectivity_test_options ,
' disappearing_server ' : connectivity_test_options ,
' early_server_ shutdown_finishes_inflight _calls' : default_test_options ,
' shutdown_finishes_calls ' : default_test_options ,
' early_server_ shutdown_finishes_tags' : default_test_options ,
' shutdown_finishes_tags ' : default_test_options ,
' empty_batch ' : default_test_options ,
' empty_batch ' : default_test_options ,
' graceful_server_shutdown ' : default_test_options ,
' graceful_server_shutdown ' : default_test_options ,
' invoke_large_request ' : default_test_options ,
' invoke_large_request ' : default_test_options ,
@ -86,19 +88,19 @@ END2END_TESTS = {
' no_op ' : default_test_options ,
' no_op ' : default_test_options ,
' ping_pong_streaming ' : default_test_options ,
' ping_pong_streaming ' : default_test_options ,
' registered_call ' : default_test_options ,
' registered_call ' : default_test_options ,
' request_response_with_ binary_metadata_and_payload ' : default_test_options ,
' binary_metadata ' : default_test_options ,
' request_response_with_ metadata_and_payload ' : default_test_options ,
' metadata ' : default_test_options ,
' request_response_with_payload_and_ call_creds' : default_test_options . _replace ( secure = True ) ,
' call_creds ' : default_test_options . _replace ( secure = True ) ,
' request_response_with_ payload' : default_test_options ,
' payload ' : default_test_options ,
' request_response_with_ trailing_metadata_and_payload ' : default_test_options ,
' trailing_metadata ' : default_test_options ,
' request_with_ compressed_payload' : default_test_options . _replace ( proxyable = False ) ,
' compressed_payload ' : default_test_options . _replace ( proxyable = False ) ,
' request_with_flags ' : default_test_options . _replace ( proxyable = False ) ,
' request_with_flags ' : default_test_options . _replace ( proxyable = False ) ,
' request_with_ large_metadata' : default_test_options ,
' large_metadata ' : default_test_options ,
' request_with_payload ' : default_test_options ,
' request_with_payload ' : default_test_options ,
' server_finishes_request ' : default_test_options ,
' server_finishes_request ' : default_test_options ,
' simple_delayed_request ' : connectivity_test_options ,
' simple_delayed_request ' : connectivity_test_options ,
' simple_request ' : default_test_options ,
' simple_request ' : default_test_options ,
' simple_request_with_high_initial_sequence_number ' : default_test_options ,
' high_initial_seqno ' : default_test_options ,
}
}
@ -147,6 +149,7 @@ def main():
' platforms ' : [ ' linux ' , ' mac ' , ' posix ' ] if f . endswith ( ' _posix ' ) else END2END_FIXTURES [ f ] . platforms ,
' platforms ' : [ ' linux ' , ' mac ' , ' posix ' ] if f . endswith ( ' _posix ' ) else END2END_FIXTURES [ f ] . platforms ,
' deps ' : sec_deps if END2END_FIXTURES [ f ] . secure else unsec_deps ,
' deps ' : sec_deps if END2END_FIXTURES [ f ] . secure else unsec_deps ,
' headers ' : [ ' test/core/end2end/end2end_tests.h ' ] ,
' headers ' : [ ' test/core/end2end/end2end_tests.h ' ] ,
' vs_proj_dir ' : ' test ' ,
}
}
for f in sorted ( END2END_FIXTURES . keys ( ) ) ] + [
for f in sorted ( END2END_FIXTURES . keys ( ) ) ] + [
{
{
@ -157,7 +160,8 @@ def main():
' src ' : [ ' test/core/end2end/tests/ %s .c ' % t ] ,
' src ' : [ ' test/core/end2end/tests/ %s .c ' % t ] ,
' headers ' : [ ' test/core/end2end/tests/cancel_test_helpers.h ' ,
' headers ' : [ ' test/core/end2end/tests/cancel_test_helpers.h ' ,
' test/core/end2end/end2end_tests.h ' ] ,
' test/core/end2end/end2end_tests.h ' ] ,
' deps ' : sec_deps if END2END_TESTS [ t ] . secure else unsec_deps
' deps ' : sec_deps if END2END_TESTS [ t ] . secure else unsec_deps ,
' vs_proj_dir ' : ' test ' ,
}
}
for t in sorted ( END2END_TESTS . keys ( ) ) ] + [
for t in sorted ( END2END_TESTS . keys ( ) ) ] + [
{
{
@ -168,7 +172,8 @@ def main():
" test/core/end2end/data/test_root_cert.c " ,
" test/core/end2end/data/test_root_cert.c " ,
" test/core/end2end/data/server1_cert.c " ,
" test/core/end2end/data/server1_cert.c " ,
" test/core/end2end/data/server1_key.c "
" test/core/end2end/data/server1_key.c "
]
] ,
' vs_proj_dir ' : ' test ' ,
}
}
] ,
] ,
' targets ' : [
' targets ' : [
@ -184,13 +189,14 @@ def main():
else without ( END2END_FIXTURES [ f ] . platforms , ' mac ' ) ) ,
else without ( END2END_FIXTURES [ f ] . platforms , ' mac ' ) ) ,
' deps ' : [
' deps ' : [
' end2end_fixture_ %s ' % f ,
' end2end_fixture_ %s ' % f ,
' end2end_test_ %s ' % t ] + sec_deps
' end2end_test_ %s ' % t ] + sec_deps ,
' vs_proj_dir ' : ' test ' ,
}
}
for f in sorted ( END2END_FIXTURES . keys ( ) )
for f in sorted ( END2END_FIXTURES . keys ( ) )
for t in sorted ( END2END_TESTS . keys ( ) )
for t in sorted ( END2END_TESTS . keys ( ) )
if compatible ( f , t ) ] + [
if compatible ( f , t ) ] + [
{
{
' name ' : ' %s _ %s _u nsecure _test ' % ( f , t ) ,
' name ' : ' %s _ %s _no sec_test ' % ( f , t ) ,
' build ' : ' test ' ,
' build ' : ' test ' ,
' language ' : ' c ' ,
' language ' : ' c ' ,
' secure ' : ' no ' ,
' secure ' : ' no ' ,
@ -202,11 +208,12 @@ def main():
else without ( END2END_FIXTURES [ f ] . platforms , ' mac ' ) ) ,
else without ( END2END_FIXTURES [ f ] . platforms , ' mac ' ) ) ,
' deps ' : [
' deps ' : [
' end2end_fixture_ %s ' % f ,
' end2end_fixture_ %s ' % f ,
' end2end_test_ %s ' % t ] + unsec_deps
' end2end_test_ %s ' % t ] + unsec_deps ,
' vs_proj_dir ' : ' test ' ,
}
}
for f in sorted ( END2END_FIXTURES . keys ( ) ) if not END2END_FIXTURES [ f ] . secure
for f in sorted ( END2END_FIXTURES . keys ( ) ) if not END2END_FIXTURES [ f ] . secure
for t in sorted ( END2END_TESTS . keys ( ) ) if compatible ( f , t ) and not END2END_TESTS [ t ] . secure ] }
for t in sorted ( END2END_TESTS . keys ( ) ) if compatible ( f , t ) and not END2END_TESTS [ t ] . secure ] }
print simplejson . dumps ( json , sort_keys = True , indent = 2 * ' ' )
print yaml . dump ( json )
if __name__ == ' __main__ ' :
if __name__ == ' __main__ ' :