Skip to content

Commit

Permalink
Merge pull request grpc#2800 from ctiller/reduce-mac-load
Browse files Browse the repository at this point in the history
Reduce mac load on Jenkins
  • Loading branch information
nicolasnoble committed Aug 6, 2015
2 parents 6f576a9 + cf0e796 commit 2db1783
Show file tree
Hide file tree
Showing 5 changed files with 2,477 additions and 1,298 deletions.
42 changes: 42 additions & 0 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1002,6 +1004,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1019,6 +1023,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -1066,6 +1072,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1083,6 +1091,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -1556,6 +1566,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -1752,6 +1764,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1769,6 +1783,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1786,6 +1802,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -1906,6 +1924,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -1926,6 +1946,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -1987,6 +2009,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -2228,6 +2252,8 @@
"grpc++_test_config"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -2249,6 +2275,8 @@
"grpc++_test_config"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -2266,6 +2294,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -2373,6 +2403,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -2394,6 +2426,8 @@
"grpc++_test_config"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -2415,6 +2449,8 @@
"grpc++_test_config"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -2512,6 +2548,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down Expand Up @@ -2564,6 +2602,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand All @@ -2584,6 +2624,8 @@
"gpr"
],
"platforms": [
"mac",
"linux",
"posix"
]
},
Expand Down
12 changes: 6 additions & 6 deletions test/core/end2end/gen_build_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@


FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack includes_proxy dns_resolver secure platforms')
default_unsecure_fixture_options = FixtureOptions(True, False, True, False, ['windows', 'posix'])
default_unsecure_fixture_options = FixtureOptions(True, False, True, False, ['windows', 'linux', 'mac', 'posix'])
socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace(fullstack=False, dns_resolver=False)
default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True)
uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['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
END2END_FIXTURES = {
'chttp2_fake_security': default_secure_fixture_options,
'chttp2_fullstack': default_unsecure_fixture_options,
'chttp2_fullstack_compression': default_unsecure_fixture_options,
'chttp2_fullstack_uds_posix': uds_fixture_options,
'chttp2_fullstack_uds_posix_with_poll': uds_fixture_options,
'chttp2_fullstack_with_poll': default_unsecure_fixture_options._replace(platforms=['posix']),
'chttp2_fullstack_uds_posix_with_poll': uds_fixture_options._replace(platforms=['linux']),
'chttp2_fullstack_with_poll': default_unsecure_fixture_options._replace(platforms=['linux']),
'chttp2_fullstack_with_proxy': default_unsecure_fixture_options._replace(includes_proxy=True),
'chttp2_simple_ssl_fullstack': default_secure_fixture_options,
'chttp2_simple_ssl_fullstack_with_poll': default_secure_fixture_options._replace(platforms=['posix']),
'chttp2_simple_ssl_fullstack_with_poll': default_secure_fixture_options._replace(platforms=['linux']),
'chttp2_simple_ssl_fullstack_with_proxy': default_secure_fixture_options._replace(includes_proxy=True),
'chttp2_simple_ssl_with_oauth2_fullstack': default_secure_fixture_options,
'chttp2_socket_pair': socketpair_unsecure_fixture_options,
Expand Down Expand Up @@ -138,7 +138,7 @@ def main():
'language': 'c',
'secure': 'check' if END2END_FIXTURES[f].secure else 'no',
'src': ['test/core/end2end/fixtures/%s.c' % f],
'platforms': [ '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,
'headers': ['test/core/end2end/end2end_tests.h'],
}
Expand Down
2 changes: 1 addition & 1 deletion tools/buildgen/plugins/expand_bin_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def mako_plugin(dictionary):

for tgt in targets:
tgt['flaky'] = tgt.get('flaky', False)
tgt['platforms'] = tgt.get('platforms', ['windows', 'posix'])
tgt['platforms'] = sorted(tgt.get('platforms', ['windows', 'posix']))

27 changes: 15 additions & 12 deletions tools/run_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
_FORCE_ENVIRON_FOR_WRAPPERS = {}


def platform_string():
if platform.system() == 'Windows':
return 'windows'
elif platform.system() == 'Darwin':
return 'mac'
elif platform.system() == 'Linux':
return 'linux'
else:
return 'posix'


# SimpleConfig: just compile with CONFIG=config, and run the binary to test
class SimpleConfig(object):

Expand Down Expand Up @@ -109,17 +120,13 @@ class CLanguage(object):

def __init__(self, make_target, test_lang):
self.make_target = make_target
if platform.system() == 'Windows':
plat = 'windows'
else:
plat = 'posix'
self.platform = plat
self.platform = platform_string()
with open('tools/run_tests/tests.json') as f:
js = json.load(f)
self.binaries = [tgt
for tgt in js
if tgt['language'] == test_lang and
plat in tgt['platforms']]
platform_string() in tgt['platforms']]

def test_specs(self, config, travis):
out = []
Expand Down Expand Up @@ -245,11 +252,7 @@ def __str__(self):

class CSharpLanguage(object):
def __init__(self):
if platform.system() == 'Windows':
plat = 'windows'
else:
plat = 'posix'
self.platform = plat
self.platform = platform_string()

def test_specs(self, config, travis):
assemblies = ['Grpc.Core.Tests',
Expand All @@ -263,7 +266,7 @@ def test_specs(self, config, travis):
return [config.job_spec([cmd, assembly],
None, shortname=assembly,
environ=_FORCE_ENVIRON_FOR_WRAPPERS)
for assembly in assemblies ]
for assembly in assemblies]

def make_targets(self):
# For Windows, this target doesn't really build anything,
Expand Down
Loading

0 comments on commit 2db1783

Please sign in to comment.