aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/artifact_targets.py
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-02-01 11:19:07 -0800
committerGravatar murgatroid99 <mlumish@google.com>2016-02-03 09:36:39 -0800
commit673f65be1430c609a29a9310d71929f79184d97e (patch)
tree19c0bb6536b7318ad790177b55b38d78a3274bd6 /tools/run_tests/artifact_targets.py
parented00b0366d9022bdfe47bbf4c0b4bff1bf03d195 (diff)
Add working Node artifact builder for all platforms
Diffstat (limited to 'tools/run_tests/artifact_targets.py')
-rw-r--r--tools/run_tests/artifact_targets.py47
1 files changed, 40 insertions, 7 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py
index a34fa8e4fa..1061dccc9c 100644
--- a/tools/run_tests/artifact_targets.py
+++ b/tools/run_tests/artifact_targets.py
@@ -62,7 +62,7 @@ def create_jobspec(name, cmdline, environ=None, shell=False,
cmdline=cmdline,
environ=environ,
shortname='build_artifact.%s' % (name),
- timeout_seconds=5*60,
+ timeout_seconds=10*60,
flake_retries=flake_retries,
timeout_retries=timeout_retries,
shell=shell)
@@ -126,12 +126,45 @@ class CSharpExtArtifact:
def __str__(self):
return self.name
+node_gyp_arch_map = {
+ 'x86': 'ia32',
+ 'x64': 'x64'
+}
+
+class NodeExtArtifact:
+ """Builds Node native extension"""
+
+ def __init__(self, platform, arch):
+ self.name = 'node_ext_{0}_{1}'.format(platform, arch)
+ self.platform = platform
+ self.arch = arch
+ self.gyp_arch = node_gyp_arch_map[arch]
+ self.labels = ['artifact', 'node', platform, arch]
+
+ def pre_build_jobspecs(self):
+ return []
+
+ def build_jobspec(self):
+ if self.platform == 'windows':
+ return create_jobspec(self.name,
+ ['tools\\run_tests\\build_artifact_node.bat',
+ self.gyp_arch],
+ shell=True)
+ else:
+ if self.platform == 'linux':
+ return create_docker_jobspec(
+ self.name,
+ 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
+ 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch))
+ else:
+ return create_jobspec(self.name,
+ ['tools/run_tests/build_artifact_node.sh',
+ self.gyp_arch])
+
def targets():
"""Gets list of supported targets"""
- return [CSharpExtArtifact('linux', 'x86'),
- CSharpExtArtifact('linux', 'x64'),
- CSharpExtArtifact('macos', 'x86'),
- CSharpExtArtifact('macos', 'x64'),
- CSharpExtArtifact('windows', 'x86'),
- CSharpExtArtifact('windows', 'x64')]
+ return [Cls(platform, arch)
+ for Cls in (CSharpExtArtifact, NodeExtArtifact)
+ for platform in ('linux', 'macos', 'windows')
+ for arch in ('x86', 'x64')]