Skip to content

Commit

Permalink
cleanup tools/run_tests directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed Dec 22, 2016
1 parent d7c923d commit 5c79a31
Show file tree
Hide file tree
Showing 71 changed files with 157 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ DerivedData
Pods/

# Artifacts directory
artifacts/
/artifacts/

# Git generated files for conflicting
*.orig
Expand Down
2 changes: 1 addition & 1 deletion tools/buildgen/generate_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import sys
import tempfile
import multiprocessing
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests'))
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests', 'python_utils'))

assert sys.argv[1:], 'run generate_projects.sh instead of this directly'

Expand Down
41 changes: 1 addition & 40 deletions tools/run_tests/prepare_travis.sh → tools/run_tests/artifacts/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
# Copyright 2015, Google Inc.
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -27,41 +26,3 @@
# 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.

cd `dirname $0`/../..
grpc_dir=`pwd`

distrib=`md5sum /etc/issue | cut -f1 -d\ `
echo "Configuring for distribution $distrib"
git submodule | while read sha path extra ; do
cd /tmp
name=`basename $path`
file=$name-$sha-$CONFIG-prebuilt-$distrib.tar.gz
echo -n "Looking for $file ..."
url=http:https://storage.googleapis.com/grpc-prebuilt-packages/$file
wget -q $url && (
echo " Found."
tar xfz $file
) || echo " Not found."
done

mkdir -p bins/$CONFIG/protobuf
mkdir -p libs/$CONFIG/protobuf
mkdir -p libs/$CONFIG/openssl

function cpt {
cp /tmp/prebuilt/$1 $2/$CONFIG/$3
touch $2/$CONFIG/$3/`basename $1`
}

if [ -e /tmp/prebuilt/bin/protoc ] ; then
touch third_party/protobuf/configure
cpt bin/protoc bins protobuf
cpt lib/libprotoc.a libs protobuf
cpt lib/libprotobuf.a libs protobuf
fi

if [ -e /tmp/prebuilt/lib/libssl.a ] ; then
cpt lib/libcrypto.a libs openssl
cpt lib/libssl.a libs openssl
fi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
import string
import sys

import jobset
sys.path.insert(0, os.path.abspath('..'))
import python_utils.jobset as jobset


def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
Expand Down Expand Up @@ -113,7 +114,7 @@ def build_jobspec(self):
environ['GRPC_BUILD_MANYLINUX_WHEEL'] = 'TRUE'
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_python_manylinux_%s' % self.arch,
'tools/run_tests/build_artifact_python.sh',
'tools/run_tests/artifacts/build_artifact_python.sh',
environ=environ,
timeout_seconds=60*60)
elif self.platform == 'windows':
Expand All @@ -125,7 +126,7 @@ def build_jobspec(self):
# seed. We create a random temp-dir here
dir = ''.join(random.choice(string.ascii_uppercase) for _ in range(10))
return create_jobspec(self.name,
['tools\\run_tests\\build_artifact_python.bat',
['tools\\run_tests\\artifacts\\build_artifact_python.bat',
self.py_version,
'32' if self.arch == 'x86' else '64',
dir
Expand All @@ -136,7 +137,7 @@ def build_jobspec(self):
environ['PYTHON'] = self.py_version
environ['SKIP_PIP_INSTALL'] = 'TRUE'
return create_jobspec(self.name,
['tools/run_tests/build_artifact_python.sh'],
['tools/run_tests/artifacts/build_artifact_python.sh'],
environ=environ)

def __str__(self):
Expand Down Expand Up @@ -165,11 +166,11 @@ def build_jobspec(self):
environ['SETARCH_CMD'] = 'linux32'
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_linux_%s' % self.arch,
'tools/run_tests/build_artifact_ruby.sh',
'tools/run_tests/artifacts/build_artifact_ruby.sh',
environ=environ)
else:
return create_jobspec(self.name,
['tools/run_tests/build_artifact_ruby.sh'])
['tools/run_tests/artifacts/build_artifact_ruby.sh'])


class CSharpExtArtifact:
Expand All @@ -184,7 +185,7 @@ def __init__(self, platform, arch):
def pre_build_jobspecs(self):
if self.platform == 'windows':
return [create_jobspec('prebuild_%s' % self.name,
['tools\\run_tests\\pre_build_c.bat'],
['tools\\run_tests\\helper_scripts\\pre_build_c.bat'],
shell=True,
flake_retries=5,
timeout_retries=2)]
Expand All @@ -195,7 +196,7 @@ def build_jobspec(self):
if self.platform == 'windows':
msbuild_platform = 'Win32' if self.arch == 'x86' else self.arch
return create_jobspec(self.name,
['tools\\run_tests\\build_artifact_csharp.bat',
['tools\\run_tests\\artifacts\\build_artifact_csharp.bat',
'vsprojects\\grpc_csharp_ext.sln',
'/p:Configuration=Release',
'/p:PlatformToolset=v120',
Expand All @@ -210,14 +211,14 @@ def build_jobspec(self):
if self.platform == 'linux':
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_linux_%s' % self.arch,
'tools/run_tests/build_artifact_csharp.sh',
'tools/run_tests/artifacts/build_artifact_csharp.sh',
environ=environ)
else:
archflag = _ARCH_FLAG_MAP[self.arch]
environ['CFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG)
environ['LDFLAGS'] += ' %s' % archflag
return create_jobspec(self.name,
['tools/run_tests/build_artifact_csharp.sh'],
['tools/run_tests/artifacts/build_artifact_csharp.sh'],
environ=environ)

def __str__(self):
Expand Down Expand Up @@ -245,18 +246,18 @@ def pre_build_jobspecs(self):
def build_jobspec(self):
if self.platform == 'windows':
return create_jobspec(self.name,
['tools\\run_tests\\build_artifact_node.bat',
['tools\\run_tests\\artifacts\\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))
'tools/run_tests/artifacts/build_artifact_node.sh {}'.format(self.gyp_arch))
else:
return create_jobspec(self.name,
['tools/run_tests/build_artifact_node.sh',
['tools/run_tests/artifacts/build_artifact_node.sh',
self.gyp_arch])

class PHPArtifact:
Expand All @@ -276,10 +277,10 @@ def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
'tools/run_tests/build_artifact_php.sh')
'tools/run_tests/artifacts/build_artifact_php.sh')
else:
return create_jobspec(self.name,
['tools/run_tests/build_artifact_php.sh'])
['tools/run_tests/artifacts/build_artifact_php.sh'])

class ProtocArtifact:
"""Builds protoc and protoc-plugin artifacts"""
Expand All @@ -306,18 +307,18 @@ def build_jobspec(self):
if self.platform == 'linux':
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_protoc',
'tools/run_tests/build_artifact_protoc.sh',
'tools/run_tests/artifacts/build_artifact_protoc.sh',
environ=environ)
else:
environ['CXXFLAGS'] += ' -std=c++11 -stdlib=libc++ %s' % _MACOS_COMPAT_FLAG
return create_jobspec(self.name,
['tools/run_tests/build_artifact_protoc.sh'],
['tools/run_tests/artifacts/build_artifact_protoc.sh'],
environ=environ)
else:
generator = 'Visual Studio 12 Win64' if self.arch == 'x64' else 'Visual Studio 12'
vcplatform = 'x64' if self.arch == 'x64' else 'Win32'
return create_jobspec(self.name,
['tools\\run_tests\\build_artifact_protoc.bat'],
['tools\\run_tests\\artifacts\\build_artifact_protoc.bat'],
environ={'generator': generator,
'Platform': vcplatform})

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

make grpc_csharp_ext

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source ~/.nvm/nvm.sh
nvm use 4
set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

rm -rf build || true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
PHP_TARGET_ARCH=$1
set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

mkdir -p artifacts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cd third_party/protobuf/cmake

mkdir build & cd build
mkdir solution & cd solution
cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF ../.. || goto :error
cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF ../../.. || goto :error
endlocal

call vsprojects/build_plugins.bat || goto :error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ source scl_source enable devtoolset-1.1

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

make plugins

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

export GRPC_PYTHON_USE_CUSTOM_BDIST=0
export GRPC_PYTHON_BUILD_WITH_CYTHON=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set -ex

SYSTEM=`uname | cut -f 1 -d_`

cd $(dirname $0)/../..
cd $(dirname $0)/../../..
set +ex
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ source ~/.nvm/nvm.sh
nvm use 4
set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

base=$(pwd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

mkdir -p artifacts/
cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=php,platform={windows,linux,macos}/artifacts/* artifacts/ || true
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

mkdir -p artifacts/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../..
cd $(dirname $0)/../../..

base=$(pwd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@

"""Definition of targets run distribution package tests."""

import jobset
import os.path
import sys

sys.path.insert(0, os.path.abspath('..'))
import python_utils.jobset as jobset


def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@

"""Definition of targets to build distribution packages."""

import jobset
import os.path
import sys

sys.path.insert(0, os.path.abspath('..'))
import python_utils.jobset as jobset


def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
flake_retries=0, timeout_retries=0):
Expand Down Expand Up @@ -114,7 +119,7 @@ def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
'tools/run_tests/build_package_node.sh')
'tools/run_tests/artifacts/build_package_node.sh')


class RubyPackage:
Expand All @@ -131,7 +136,7 @@ def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
'tools/run_tests/build_package_ruby.sh')
'tools/run_tests/artifacts/build_package_ruby.sh')


class PythonPackage:
Expand All @@ -148,7 +153,7 @@ def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
'tools/run_tests/build_package_python.sh')
'tools/run_tests/artifacts/build_package_python.sh')


class PHPPackage:
Expand All @@ -165,7 +170,7 @@ def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
'tools/run_tests/build_package_php.sh')
'tools/run_tests/artifacts/build_package_php.sh')


def targets():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../../src/csharp
cd $(dirname $0)/../../../src/csharp

# overriding NativeDependenciesConfigurationUnix is needed to make gcov code coverage work.
xbuild /p:Configuration=$MSBUILD_CONFIG /p:NativeDependenciesConfigurationUnix=$CONFIG Grpc.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

setlocal

cd /d %~dp0\..\..\src\csharp
cd /d %~dp0\..\..\..\src\csharp

dotnet restore . || goto :error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

set -ex

cd $(dirname $0)/../../src/csharp
cd $(dirname $0)/../../../src/csharp

# TODO(jtattermusch): introduce caching
dotnet restore .
Expand Down
File renamed without changes.
Loading

0 comments on commit 5c79a31

Please sign in to comment.