THRIFT-3452 .travis.yml: Migrating from legacy to container-based infrastructure
Client: Build
Patch: Nobuaki Sukegawa
Use "services: docker"
This closes #730
diff --git a/.travis.yml b/.travis.yml
index 1197fe7..65fbb12 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,146 +19,123 @@
# build Apache Thrift on Travis CI - https://travis-ci.org/
-language: cpp
-
sudo: required
-cache:
- - apt
- - npm
- - maven
+services:
+ - docker
-compiler:
- - clang
- - gcc
-
-before_install:
- - sh build/travis/installCXXDependencies.sh
- - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi
- - if [ "$BUILD_HASKELL" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi
- - if [ "$BUILD_HASKELL" != "no" ] ; then cabal update ; fi
- # Disabling any cabal concurrent jobs to workaround GHC crashes due to out of memory.
- # We can safely remove this to speed up cabal install, once Travis infrastructure is upgraded.
- - if [ "$BUILD_HASKELL" != "no" ] ; then sed -i 's/^\s*jobs\s*:\s*\$ncpus\s*$/jobs:1/g' $HOME/.cabal/config && cat $HOME/.cabal/config | grep jobs ; fi
-
-before_script:
- - sudo /etc/init.d/mysql stop
- - sudo /etc/init.d/postgresql stop
+install:
+ # TODO: Once merged, remove experimental tag and use latest
+ - docker pull thrift/$DISTRO:experiment || true
+ - cp -r ./build/docker/scripts/*.sh ./build/docker/$DISTRO/scripts/
+ - docker build -q -t thrift-build build/docker/$DISTRO
script:
- - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then mkdir cmake_build && cd cmake_build && cmake -GNinja -DQT_MOC_EXECUTABLE="moq-qt5" $CMAKE_CONFIG $TRAVIS_BUILD_DIR ; fi
- - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ninja -j $CONCURRENT_JOBS ; fi
- - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then cpack ; fi
- - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ctest -VV -E "(concurrency_test|processor_test|Haskell)" ; fi
- - if [ "x$CONFIG" != "xnone" ] ; then sh bootstrap.sh ; fi
- - if [ "x$CONFIG" != "xnone" ] ; then sh configure $CONFIG ; fi
- - if [ "x$CONFIG" != "xnone" ] ; then make $MAKE_TARGET -j $CONCURRENT_JOBS ; fi
-
-after_failure:
- - if [ "x$ERROR_LOG" != "xnone" ] ; then cat $ERROR_LOG ; fi
+ - docker run $BUILD_ENV -v $(pwd):/thrift/src -it thrift-build $BUILD_CMD $BUILD_ARG
env:
global:
- TEST_NAME=""
- - CMAKE_CONFIG="none"
- - CONFIG="none"
- - MAKE_TARGET="check"
- - ALL_DEPS="no"
- # Invoke cabal only when necessary because it is flaky due to network and package updates.
- - BUILD_HASKELL="no"
- - GHCVER=7.8.3
- - ERROR_LOG="none"
- - CONCURRENT_JOBS=2
+ - BUILD_CMD="none"
+ - BUILD_ARG=""
+ - BUILD_ENV="-e CC=clang -e CXX=clang++"
+ - DISTRO=ubuntu
matrix:
- # Put it here because it's most time consuming
- - TEST_NAME="make cross (automake)"
- THRIFT_CROSSTEST_CONCURRENCY=6
- CONFIG="--enable-tutorial=no --without-lua --without-haxe --without-d"
- ALL_DEPS="yes"
- BUILD_HASKELL="yes"
- MAKE_TARGET="cross"
- ERROR_LOG="test/log/unexpected_failures.log"
+ # TODO: Break up by protocol types to avoid 50min limit
+ - TEST_NAME="Cross Language Tests"
+ BUILD_CMD="../cross-test.sh"
+ BUILD_ARG="--enable-tutorial=no"
+ BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
- # CMake builds
- - TEST_NAME="compiler (CMake + CPack)"
- CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
- - TEST_NAME="all (CMake + CPack)"
- CMAKE_CONFIG=""
- ALL_DEPS="yes"
- BUILD_HASKELL="yes"
- - TEST_NAME="C++/boost-threads (CMake + CPack)"
- CMAKE_CONFIG="-DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_BOOSTTHREADS=ON"
- - TEST_NAME="C++/std-threads (CMake + CPack)"
- CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF -DWITH_STDTHREADS=ON"
- - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)"
- CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
+ # TODO: Remove them once migrated to CMake
+ # Autotools builds
+ - TEST_NAME="C C++ C# D Erlang Go Haxe (automake)"
+ BUILD_CMD="../autotools.sh"
+ BUILD_ARG="--without-dart --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
- # Autotool builds
- # TODO: Remove them as migration is made
- - TEST_NAME="compiler (automake)"
- CONFIG="--disable-libs"
+ - TEST_NAME="C C++ - GCC (automake)"
+ BUILD_CMD="../autotools.sh"
+ BUILD_ARG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-dart --without-ruby --without-haskell --without-go --without-haxe --without-d"
- # TODO: Enable tutorial once "make check -C tutorial/go" is fixed
- - TEST_NAME="C C# D Dart Erlang Go Haxe (automake)"
- CONFIG="--without-cpp --without-haskell --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --enable-tutorial=no"
- ALL_DEPS="yes"
+ - TEST_NAME="Java Lua Perl PHP Python Ruby (automake)"
+ BUILD_CMD="../autotools.sh"
+ BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe"
- - TEST_NAME="Java Lua Node.js Perl PHP Python Ruby (automake)"
- CONFIG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe"
- ALL_DEPS="yes"
+ # Tutorial build is unstable
+ - TEST_NAME="Dart (automake)"
+ BUILD_CMD="../autotools.sh"
+ BUILD_ARG="--without-cpp --without-haskell --without-c_glib --without-csharp --without-d --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby --enable-tutorial=no"
- # Isolate unstable builds from others
- - TEST_NAME="C++ (automake)"
- CONFIG="--without-haskell --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
+ # These are flaky and also have lengthy output
+ - TEST_NAME="Haskell Node.js (automake)"
+ BUILD_CMD="../autotools.sh"
+ BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-perl --without-php --without-php_extension --without-python --without-ruby"
- - TEST_NAME="Haskell (automake)"
- CONFIG="--without-cpp --without-c_glib --without-csharp --without-d --without-dart --without-erlang --without-go --without-haxe --without-java --without-lua --without-nodejs --without-perl --without-php --without-php_extension --without-python --without-ruby"
- ALL_DEPS="yes"
- BUILD_HASKELL="yes"
+ # CMake build
+ - TEST_NAME="All"
+ BUILD_CMD="../cmake.sh"
- - TEST_NAME="dist (automake)"
- CONFIG=""
- ALL_DEPS="yes"
- BUILD_HASKELL="yes"
- MAKE_TARGET="dist"
+ - TEST_NAME="C C++ - GCC"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
+ - TEST_NAME="C++ (Boost Thread)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+
+ - TEST_NAME="C++ (Boost Thread - GCC)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
+
+ - TEST_NAME="C++ (Std Thread)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+
+ - TEST_NAME="C++ (Std Thread - GCC)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
+
+ - TEST_NAME="Compiler (mingw)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
+ BUILD_ENV=""
+
+ - TEST_NAME="All (CentOS)"
+ BUILD_CMD="../cmake.sh"
+ DISTRO=centos
+
+ - TEST_NAME="C C++ - GCC (CentOS)"
+ BUILD_CMD="../cmake.sh"
+ BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
+ DISTRO=centos
+
+ # Distribution
+ - TEST_NAME="make dist"
+ BUILD_CMD="../make-dist.sh"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
+
+ - TEST_NAME="Debian Packages"
+ BUILD_CMD="../dpkg.sh"
+ BUILD_ENV="-e CC=gcc -e CXX=g++"
matrix:
allow_failures:
- # gcc fails on travis seemingly due to out of memory
- - compiler: gcc
-
- exclude:
- # This one takes very long
- - compiler: gcc
- env: TEST_NAME="make cross (automake)" CONFIG="--without-python" ALL_DEPS="yes" MAKE_TARGET="cross"
-
- # Does not use native compiler, no need to do it twice
- - compiler: gcc
- env: TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
- - compiler: gcc
- env: TEST_NAME="dist (automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist"
+ - env: TEST_NAME="All (CentOS)" BUILD_CMD="../cmake.sh" DISTRO=centos
include:
- - env:
- - TEST_NAME="Debian Packages"
- compiler: clang
- before_install:
- - sh build/travis/installCXXDependencies.sh;
- - sh build/travis/installDependencies.sh 1> /dev/null;
- - sudo apt-get install build-essential mono-gmcs mono-devel libmono-system-web2.0-cil erlang-base ruby1.8-dev python-all python-all-dev python-all-dbg php5 php5-dev
- script:
- - dpkg-buildpackage -tc -us -uc
- - ls -al ..
-
-
# QA jobs for code analytics and metrics
-
+ #
# static code analysis with cppcheck
# add --error-exitcode=1 to --enable=all as soon as everything is fixed
- - env: TEST_NAME="cppcheck"
- before_install: sudo apt-get install cppcheck
+ - env: TEST_NAME="cppcheck"
+ install:
+ - sudo apt-get update
+ - sudo apt-get install cppcheck
script:
# Compiler cppcheck (All)
- cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
@@ -171,16 +148,13 @@
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
- cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
- # TODO use findbugs for Java
- # TODO use fxcop for C#
-
- # TODO do style checks
-
# search for TODO etc within source tree
# some statistics about the code base
# some info about the build machine
- env: TEST_NAME="TODO FIXME HACK, LoC and system info"
- before_install: sudo apt-get install sloccount
+ install:
+ - sudo apt-get update
+ - sudo apt-get install sloccount
script:
- grep -r TODO *
- grep -r FIXME *
@@ -190,6 +164,3 @@
# System Info
- dpkg -l
- uname -a
-
-# TODO make it perfect ;-r
-#
diff --git a/build/docker/README.md b/build/docker/README.md
index 3712653..85cb3b2 100644
--- a/build/docker/README.md
+++ b/build/docker/README.md
@@ -23,5 +23,5 @@
* Run
- docker run -v $(pwd):/thrift -it thrift /bin/bash
+ docker run -v $(pwd):/thrift/src -it thrift /bin/bash
diff --git a/build/docker/centos/Dockerfile b/build/docker/centos/Dockerfile
index 95601db..4ce4f42 100644
--- a/build/docker/centos/Dockerfile
+++ b/build/docker/centos/Dockerfile
@@ -21,37 +21,83 @@
FROM centos:7
MAINTAINER Apache Thrift <dev@thrift.apache.org>
-ENV HOME /root
+RUN yum install -y epel-release
# General dependencies
-RUN yum install -y tar m4 perl gcc gcc-c++ git libtool zlib-devel openssl-devel autoconf make bison bison-devel flex epel-release
+RUN yum install -y \
+ tar \
+ m4 \
+ perl \
+ clang \
+ gcc \
+ gcc-c++ \
+ git \
+ libtool \
+ autoconf \
+ make \
+ bison \
+ bison-devel \
+ flex
# C++ dependencies
-RUN yum install -y boost-devel-static libevent-devel
+RUN yum install -y \
+ boost-devel-static \
+ zlib-devel \
+ openssl-devel \
+ libevent-devel
# Java Dependencies
-RUN yum install -y ant junit ant-junit java-1.7.0-openjdk-devel
+RUN yum install -y \
+ ant \
+ junit \
+ ant-junit \
+ java-1.7.0-openjdk-devel
# Python Dependencies
-RUN yum install -y python-devel python-setuptools python-twisted-web python-six
+RUN yum install -y \
+ python-devel \
+ python-setuptools \
+ python-twisted-web \
+ python-six
# Ruby Dependencies
-RUN yum install -y ruby ruby-devel rubygems && \
+RUN yum install -y \
+ ruby \
+ ruby-devel \
+ rubygems && \
gem install bundler rake
# Perl Dependencies
-RUN yum install -y perl-Bit-Vector perl-Class-Accessor perl-ExtUtils-MakeMaker perl-Test-Simple \
- perl-IO-Socket-SSL perl-Net-SSLeay perl-Crypt-SSLeay
+RUN yum install -y \
+ perl-Bit-Vector \
+ perl-Class-Accessor \
+ perl-ExtUtils-MakeMaker \
+ perl-Test-Simple \
+ perl-IO-Socket-SSL \
+ perl-Net-SSLeay \
+ perl-Crypt-SSLeay
# PHP Dependencies
-RUN yum install -y php php-devel php-pear re2c php-phpunit-PHPUnit bzip2
+RUN yum install -y \
+ php \
+ php-devel \
+ php-pear \
+ re2c \
+ php-phpunit-PHPUnit \
+ bzip2
# GLibC Dependencies
RUN yum install -y glib2-devel
# Erlang Dependencies
RUN curl -sSL http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo -o /etc/yum.repos.d/erlang_solutions.repo && \
- yum install -y erlang-kernel erlang-erts erlang-stdlib erlang-eunit erlang-rebar erlang-tools
+ yum install -y \
+ erlang-kernel \
+ erlang-erts \
+ erlang-stdlib \
+ erlang-eunit \
+ erlang-rebar \
+ erlang-tools
# Go Dependencies
RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
@@ -61,13 +107,33 @@
RUN yum -y install haskell-platform
# Node.js Dependencies
-RUN yum install -y nodejs nodejs-devel npm
+RUN yum install -y \
+ nodejs \
+ nodejs-devel \
+ npm
# C# Dependencies
-RUN yum install -y mono-core mono-devel mono-web-devel mono-extras mingw32-binutils mingw32-crt mingw32-nsis
+RUN yum install -y \
+ mono-core \
+ mono-devel \
+ mono-web-devel \
+ mono-extras \
+
+# MinGW Dependencies
+RUN yum install -y \
+ mingw32-binutils \
+ mingw32-crt \
+ mingw32-nsis
+
+# CMake
+RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.0.tar.gz | tar -xz && \
+ cd cmake-3.4.0 && ./bootstrap && make -j4 && make install
# Clean up
RUN rm -rf /tmp/* && \
yum clean all
-WORKDIR $HOME
+ENV THRIFT_ROOT /thrift
+RUN mkdir -p $THRIFT_ROOT/src
+COPY scripts $THRIFT_ROOT
+WORKDIR $THRIFT_ROOT/src
diff --git a/build/docker/centos/scripts/keepit b/build/docker/centos/scripts/keepit
new file mode 100644
index 0000000..cb885df
--- /dev/null
+++ b/build/docker/centos/scripts/keepit
@@ -0,0 +1 @@
+keep it
diff --git a/build/docker/scripts/autotools.sh b/build/docker/scripts/autotools.sh
new file mode 100755
index 0000000..4c111e6
--- /dev/null
+++ b/build/docker/scripts/autotools.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -ev
+
+./bootstrap.sh
+./configure $*
+make check -j4
diff --git a/build/docker/scripts/cmake.sh b/build/docker/scripts/cmake.sh
new file mode 100755
index 0000000..8204a1d
--- /dev/null
+++ b/build/docker/scripts/cmake.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -ev
+
+mkdir -p cmake_build && cd cmake_build
+cmake $* ..
+make -j4
+cpack
+ctest -VV -E "(concurrency_test|processor_test)"
diff --git a/build/docker/scripts/cross-test.sh b/build/docker/scripts/cross-test.sh
new file mode 100755
index 0000000..d9562ab
--- /dev/null
+++ b/build/docker/scripts/cross-test.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -ev
+
+./bootstrap.sh
+./configure --enable-tutorial=no
+make -j4 precross
+
+set +e
+make cross
+
+RET=$?
+if [ $RET -ne 0 ]; then
+ cat test/log/unexpected_failures.log
+fi
+
+exit $RET
diff --git a/build/docker/scripts/make-dist.sh b/build/docker/scripts/make-dist.sh
new file mode 100755
index 0000000..c728130
--- /dev/null
+++ b/build/docker/scripts/make-dist.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -ev
+
+./bootstrap.sh
+./configure $*
+make dist
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index d8bac0c..55c6a02 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -18,62 +18,112 @@
FROM ubuntu:trusty
MAINTAINER Apache Thrift <dev@thrift.apache.org>
-ENV HOME /root
ENV DEBIAN_FRONTEND noninteractive
-RUN apt-get update -y && apt-get dist-upgrade -y
-
# General dependencies
-RUN apt-get install -y automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git \
- debhelper cmake
+RUN apt-get update && apt-get install -y \
+ apt-transport-https \
+ automake \
+ bison \
+ clang \
+ cmake \
+ debhelper \
+ flex \
+ g++ \
+ git \
+ libtool \
+ make \
+ pkg-config
# C++ dependencies
-RUN apt-get install -y libboost-dev libboost-test-dev libboost-program-options-dev \
- libboost-filesystem-dev libboost-system-dev libboost-thread-dev libevent-dev
+RUN apt-get update && apt-get install -y \
+ libboost-dev \
+ libboost-filesystem-dev \
+ libboost-program-options-dev \
+ libboost-system-dev \
+ libboost-test-dev \
+ libboost-thread-dev \
+ libevent-dev \
+ libqt4-dev \
+ libssl-dev
# Java dependencies
-RUN apt-get install -y ant openjdk-7-jdk maven && \
- update-java-alternatives -s java-1.7.0-openjdk-amd64
+RUN apt-get update && apt-get install -y \
+ ant \
+ openjdk-7-jdk \
+ maven \
+ && update-java-alternatives -s java-1.7.0-openjdk-amd64
# Python dependencies
-RUN apt-get install -y python-all python-all-dev python-all-dbg python-setuptools python-support \
- python-twisted python-zope.interface python-six python3-six
+RUN apt-get update && apt-get install -y \
+ python-all \
+ python-all-dev \
+ python-all-dbg \
+ python-setuptools \
+ python-support \
+ python-twisted \
+ python-zope.interface \
+ python-six \
+ python3-six
# Ruby dependencies
-RUN apt-get install -y ruby ruby-dev && \
- gem install bundler rake
+RUN apt-get update && apt-get install -y \
+ ruby \
+ ruby-dev \
+ && gem install bundler rake
# Perl dependencies
-RUN apt-get install -y libbit-vector-perl libclass-accessor-class-perl
+RUN apt-get update && apt-get install -y \
+ libbit-vector-perl \
+ libclass-accessor-class-perl \
+ libcrypt-ssleay-perl \
+ libio-socket-ssl-perl \
+ libnet-ssleay-perl
# Php dependencies
-RUN apt-get install -y php5 php5-dev php5-cli php-pear re2c phpunit
+RUN apt-get update && apt-get install -y \
+ php5 \
+ php5-dev \
+ php5-cli \
+ php-pear \
+ re2c \
+ phpunit
# GlibC dependencies
-RUN apt-get install -y libglib2.0-dev
+RUN apt-get update && apt-get install -y libglib2.0-dev
# Erlang dependencies
RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
- curl -sSL http://packages.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add - && \
- apt-get update && \
- apt-get install -y erlang-base erlang-eunit erlang-dev erlang-tools
+ curl -sSL http://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add - && \
+ apt-get update && apt-get install -y \
+ erlang-base \
+ erlang-eunit \
+ erlang-dev \
+ erlang-tools \
+ rebar
-# GO dependencies
-RUN curl -sSL https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C /usr/lib/ -xz && \
- mkdir -p /usr/share/go
+# Go dependencies
+RUN curl -sSL https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz | tar -C /usr/local/ -xz
+ENV PATH /usr/local/go/bin:$PATH
-ENV GOROOT /usr/lib/go
-ENV GOPATH /usr/share/go
-ENV PATH ${GOROOT}/bin:${GOPATH}/bin:$PATH
# Haskell dependencies
-RUN apt-get install -y ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev \
- libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev && \
- cabal update
+RUN apt-get update && apt-get install -y \
+ ghc \
+ cabal-install \
+ libghc-binary-dev \
+ libghc-network-dev \
+ libghc-http-dev \
+ libghc-hashable-dev \
+ libghc-unordered-containers-dev \
+ libghc-vector-dev
# Haxe
-RUN apt-get install -y neko neko-dev libneko0 && \
- mkdir -p /tmp/haxe /usr/lib/haxe && \
+RUN apt-get update && apt-get install -y \
+ neko \
+ neko-dev \
+ libneko0 \
+ && mkdir -p /tmp/haxe /usr/lib/haxe && \
curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz -o /tmp/haxe/haxe-3.2.0-linux64.tar.gz && \
tar -xvzf /tmp/haxe/haxe-3.2.0-linux64.tar.gz -C /usr/lib/haxe --strip-components=1 && \
ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
@@ -81,26 +131,53 @@
mkdir -p /usr/lib/haxe/lib && \
chmod -R 777 /usr/lib/haxe/lib && \
haxelib setup /usr/lib/haxe/lib && \
- haxelib install hxcpp
+ haxelib install hxcpp && \
+ rm -rf /tmp/haxe
-# Lua dependencies
-RUN apt-get install -y lua5.2 lua5.2-dev
# Node.js dependencies
-RUN apt-get install -y nodejs nodejs-dev nodejs-legacy npm
+RUN apt-get update && apt-get install -y \
+ nodejs \
+ nodejs-dev \
+ nodejs-legacy \
+ npm
-# CSharp
-RUN apt-get install -y mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil \
- mingw32 mingw32-binutils mingw32-runtime nsis
+# CSharp dependencies
+RUN apt-get update && apt-get install -y \
+ libmono-system-web2.0-cil \
+ mono-complete \
+ mono-devel \
+ mono-gmcs \
+ mono-xbuild
# D dependencies
# THRIFT-2916: DMD pinned to 2.065.0-0 due to regression in 2.066
# THRIFT-3253: DMD pinned to 2.065.0-0 due to deprecations 2.067.1
-RUN apt-get install -y gcc-multilib xdg-utils && \
- curl -sSL http://downloads.dlang.org/releases/2.x/2.065.0/dmd_2.065.0-0_amd64.deb -o /tmp/dmd_2.065.0-0_amd64.deb && \
+RUN apt-get update && apt-get install -y \
+ gcc-multilib \
+ xdg-utils \
+ && curl -sSL http://downloads.dlang.org/releases/2.x/2.065.0/dmd_2.065.0-0_amd64.deb -o /tmp/dmd_2.065.0-0_amd64.deb && \
dpkg -i /tmp/dmd_2.065.0-0_amd64.deb && \
rm /tmp/dmd_2.065.0-0_amd64.deb
+# Dart dependencies
+RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
+ curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
+ apt-get update && apt-get install -y dart
+ENV PATH /usr/lib/dart/bin:$PATH
+
+# Lua dependencies
+RUN apt-get update && apt-get install -y \
+ lua5.2 \
+ lua5.2-dev
+
+# MinGW dependencies
+RUN apt-get update && apt-get install -y \
+ mingw32 \
+ mingw32-binutils \
+ mingw32-runtime \
+ nsis
+
# Clean up
RUN apt-get clean && \
rm -rf /var/cache/apt/* && \
@@ -108,4 +185,7 @@
rm -rf /tmp/* && \
rm -rf /var/tmp/*
-WORKDIR $HOME
+ENV THRIFT_ROOT /thrift
+RUN mkdir -p $THRIFT_ROOT/src
+COPY scripts $THRIFT_ROOT
+WORKDIR $THRIFT_ROOT/src
diff --git a/build/docker/ubuntu/scripts/dpkg.sh b/build/docker/ubuntu/scripts/dpkg.sh
new file mode 100755
index 0000000..3ba0cd4
--- /dev/null
+++ b/build/docker/ubuntu/scripts/dpkg.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -ev
+
+dpkg-buildpackage -tc -us -uc
+ls -al ..
diff --git a/debian/control b/debian/control
index 39d57f9..7f997b2 100644
--- a/debian/control
+++ b/debian/control
@@ -2,10 +2,10 @@
Section: devel
Priority: extra
Build-Depends: debhelper (>= 5), build-essential, mono-gmcs, python-dev, ant,
- mono-devel, libmono-system-web2.0-cil, erlang-base, ruby1.8-dev, autoconf, automake,
- pkg-config, libtool, bison, flex, libboost-dev | libboost1.40-dev, python-all,
+ mono-devel, libmono-system-web2.0-cil, erlang-base, ruby-dev | ruby1.9.1-dev, autoconf, automake,
+ pkg-config, libtool, bison, flex, libboost-dev | libboost1.53-dev, python-all,
python-all-dev, python-all-dbg, openjdk-6-jdk | java-sdk,
- libboost-test-dev | libboost-test1.40-dev, libevent-dev, perl (>= 5.8.0-7),
+ libboost-test-dev | libboost-test1.53-dev, libevent-dev, perl (>= 5.8.0-7),
php5, php5-dev, libglib2.0-dev, libqt4-dev
Maintainer: Thrift Developer's <dev@thrift.apache.org>
Homepage: http://thrift.apache.org/
@@ -29,8 +29,8 @@
Package: python-thrift
Architecture: any
Section: python
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Recommends: python-twisted-core
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-six
+Recommends: python-twisted-web
Provides: ${python:Provides}
Description: Python bindings for Thrift
Thrift is a software framework for scalable cross-language services
diff --git a/debian/rules b/debian/rules
index d8462d1..c94de2e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -107,11 +107,6 @@
$(CURDIR)/debian/libthrift-java/usr/share/java/
# Ruby
- mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8 && \
- cp $(CURDIR)/lib/rb/lib/thrift.rb \
- $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8
- cp -r $(CURDIR)/lib/rb/lib/thrift \
- $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8
mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \
cp $(CURDIR)/lib/rb/lib/thrift.rb \
$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
diff --git a/test/crossrunner/__init__.py b/test/crossrunner/__init__.py
index 06de2d0..584cc07 100644
--- a/test/crossrunner/__init__.py
+++ b/test/crossrunner/__init__.py
@@ -17,9 +17,8 @@
# under the License.
#
-from crossrunner.test import test_name
-from crossrunner.collect import collect_tests
-from crossrunner.run import TestDispatcher
-from crossrunner.report import generate_known_failures
-from crossrunner.report import load_known_failures
-from crossrunner.prepare import prepare
+from .test import test_name
+from .collect import collect_tests
+from .run import TestDispatcher
+from .report import generate_known_failures, load_known_failures
+from .prepare import prepare
diff --git a/test/crossrunner/collect.py b/test/crossrunner/collect.py
index 145afef..c6e33e9 100644
--- a/test/crossrunner/collect.py
+++ b/test/crossrunner/collect.py
@@ -20,7 +20,7 @@
import platform
from itertools import product
-from crossrunner.util import merge_dict
+from .util import merge_dict
# Those keys are passed to execution as is.
# Note that there are keys other than these, namely:
diff --git a/test/crossrunner/compat.py b/test/crossrunner/compat.py
index 70992f6..6ab9d71 100644
--- a/test/crossrunner/compat.py
+++ b/test/crossrunner/compat.py
@@ -13,9 +13,12 @@
b = s.decode(_ENCODE)
return b.join(bin_args).encode(_ENCODE)
+ logfile_open = open
+
else:
path_join = os.path.join
+ str_join = str.join
- def str_join(s, l):
- return s.join(l)
+ def logfile_open(*args):
+ return open(*args, errors='replace')
diff --git a/test/crossrunner/prepare.py b/test/crossrunner/prepare.py
index 6e4f6ee..c6784af 100644
--- a/test/crossrunner/prepare.py
+++ b/test/crossrunner/prepare.py
@@ -20,7 +20,7 @@
import os
import subprocess
-from crossrunner.collect import collect_testlibs
+from .collect import collect_testlibs
def prepare(config_dict, testdir, server_match, client_match):
diff --git a/test/crossrunner/report.py b/test/crossrunner/report.py
index bcfe181..defc486 100644
--- a/test/crossrunner/report.py
+++ b/test/crossrunner/report.py
@@ -17,6 +17,7 @@
# under the License.
#
+from __future__ import print_function
import datetime
import json
import multiprocessing
@@ -28,7 +29,7 @@
import time
import traceback
-from .compat import path_join, str_join
+from .compat import logfile_open, path_join, str_join
from .test import TestEntry
LOG_DIR = 'log'
@@ -44,7 +45,7 @@
if not r[success_index]:
yield TestEntry.get_name(*r)
try:
- with open(os.path.join(testdir, RESULT_JSON), 'r') as fp:
+ with logfile_open(os.path.join(testdir, RESULT_JSON), 'r') as fp:
results = json.load(fp)
except IOError:
sys.stderr.write('Unable to load last result. Did you run tests ?\n')
@@ -67,7 +68,7 @@
def load_known_failures(testdir):
try:
- with open(os.path.join(testdir, FAIL_JSON % platform.system()), 'r') as fp:
+ with logfile_open(os.path.join(testdir, FAIL_JSON % platform.system()), 'r') as fp:
return json.load(fp)
except IOError:
return []
@@ -138,16 +139,7 @@
self._lock.release()
def killed(self):
- self._lock.acquire()
- try:
- if self.out and not self.out.closed:
- self._print_footer()
- self._close()
- self.out = None
- else:
- self._log.debug('Output stream is not available.')
- finally:
- self._lock.release()
+ self.end(None)
_init_failure_exprs = {
'server': list(map(re.compile, [
@@ -177,8 +169,7 @@
server_logfile = self.logpath
# need to handle unicode errors on Python 3
- kwargs = {} if sys.version_info[0] < 3 else {'errors': 'replace'}
- with open(server_logfile, 'r', **kwargs) as fp:
+ with logfile_open(server_logfile, 'r') as fp:
if any(map(match, fp)):
return True
except (KeyboardInterrupt, SystemExit):
@@ -345,12 +336,12 @@
def _assemble_log(self, title, indexes):
if len(indexes) > 0:
def add_prog_log(fp, test, prog_kind):
- fp.write('*************************** %s message ***************************\n'
- % prog_kind)
+ print('*************************** %s message ***************************' % prog_kind,
+ file=fp)
path = self.test_logfile(test.name, prog_kind, self.testdir)
- kwargs = {} if sys.version_info[0] < 3 else {'errors': 'replace'}
- with open(path, 'r', **kwargs) as prog_fp:
- fp.write(prog_fp.read())
+ if os.path.exists(path):
+ with logfile_open(path, 'r') as prog_fp:
+ print(prog_fp.read(), file=fp)
filename = title.replace(' ', '_') + '.log'
with open(os.path.join(self.logdir, filename), 'w+') as fp:
for test in map(self._tests.__getitem__, indexes):
@@ -358,7 +349,7 @@
add_prog_log(fp, test, test.server.kind)
add_prog_log(fp, test, test.client.kind)
fp.write('**********************************************************************\n\n')
- self.out.write('%s are logged to test/%s/%s\n' % (title.capitalize(), LOG_DIR, filename))
+ print('%s are logged to test/%s/%s' % (title.capitalize(), LOG_DIR, filename))
def end(self):
self._print_footer()
diff --git a/test/crossrunner/run.py b/test/crossrunner/run.py
index 129016c..acba335 100644
--- a/test/crossrunner/run.py
+++ b/test/crossrunner/run.py
@@ -21,15 +21,14 @@
import multiprocessing
import multiprocessing.managers
import os
-import sys
import platform
import random
-import socket
import signal
+import socket
import subprocess
+import sys
import threading
import time
-import traceback
from .compat import str_join
from .test import TestEntry, domain_socket_path
@@ -165,10 +164,10 @@
stop.set()
return None
except Exception as ex:
- logger.warn('Error while executing test : %s' % str(ex))
+ logger.warn('%s', ex)
if not async:
raise
- logger.info(traceback.print_exc())
+ logger.debug('Error executing [%s]', test.name, exc_info=sys.exc_info())
return RESULT_ERROR
diff --git a/test/crossrunner/test.py b/test/crossrunner/test.py
index 63219e1..49ba7d3 100644
--- a/test/crossrunner/test.py
+++ b/test/crossrunner/test.py
@@ -22,8 +22,7 @@
import os
import sys
from .compat import path_join
-
-from crossrunner.util import merge_dict
+from .util import merge_dict
def domain_socket_path(port):
diff --git a/test/dart/test_client/bin/main.dart b/test/dart/test_client/bin/main.dart
index 48c6b3c..5ad3cde 100644
--- a/test/dart/test_client/bin/main.dart
+++ b/test/dart/test_client/bin/main.dart
@@ -104,7 +104,7 @@
parser.addOption('port', defaultsTo: '9090', help: 'The port to connect to');
parser.addOption('transport',
defaultsTo: 'buffered',
- allowed: ['buffered', 'framed'],
+ allowed: ['buffered', 'framed', 'http'],
help: 'The transport name',
allowedHelp: {
'buffered': 'TBufferedTransport',
diff --git a/test/known_failures_Linux.json b/test/known_failures_Linux.json
index b05f61c..2293c5c 100644
--- a/test/known_failures_Linux.json
+++ b/test/known_failures_Linux.json
@@ -1,14 +1,12 @@
[
- "c_glib-rb_binary-accel_buffered-ip",
- "c_glib-rb_binary-accel_framed-ip",
- "c_glib-rb_binary_buffered-ip",
- "c_glib-rb_binary_framed-ip",
"cpp-cpp_binary_http-domain",
"cpp-cpp_binary_http-ip",
"cpp-cpp_compact_http-domain",
"cpp-cpp_header_http-domain",
"cpp-cpp_header_http-ip",
"cpp-cpp_json_http-ip",
+ "cpp-dart_binary_http-ip",
+ "cpp-dart_json_http-ip",
"cpp-hs_json_buffered-ip",
"cpp-hs_json_framed-ip",
"cpp-hs_json_http-ip",
@@ -18,8 +16,8 @@
"cpp-java_compact_http-ip-ssl",
"cpp-java_json_http-ip",
"cpp-java_json_http-ip-ssl",
- "cpp-nodejs_json_buffered-ip-ssl",
- "cpp-rb_json_buffered-ip",
+ "cpp-perl_binary_buffered-ip-ssl",
+ "cpp-perl_binary_framed-ip-ssl",
"csharp-cpp_binary_buffered-ip-ssl",
"csharp-cpp_binary_framed-ip-ssl",
"csharp-cpp_compact_buffered-ip-ssl",
@@ -42,19 +40,18 @@
"csharp-nodejs_binary_framed-ip-ssl",
"csharp-nodejs_compact_buffered-ip-ssl",
"csharp-nodejs_compact_framed-ip-ssl",
- "csharp-nodejs_json_buffered-ip",
"csharp-nodejs_json_buffered-ip-ssl",
"csharp-nodejs_json_framed-ip-ssl",
+ "csharp-perl_binary_buffered-ip-ssl",
+ "csharp-perl_binary_framed-ip-ssl",
"erl-cpp_compact_buffered-ip",
"erl-cpp_compact_buffered-ip-ssl",
"erl-cpp_compact_framed-ip",
"erl-cpp_compact_framed-ip-ssl",
- "erl-go_binary_buffered-ip-ssl",
- "erl-go_binary_framed-ip-ssl",
- "erl-go_compact_buffered-ip-ssl",
- "erl-go_compact_framed-ip-ssl",
"erl-nodejs_binary_buffered-ip",
"erl-nodejs_compact_buffered-ip",
+ "erl-perl_binary_buffered-ip-ssl",
+ "erl-perl_binary_framed-ip-ssl",
"erl-rb_binary-accel_buffered-ip",
"erl-rb_binary-accel_framed-ip",
"erl-rb_binary_buffered-ip",
@@ -92,24 +89,30 @@
"java-hs_json_buffered-ip",
"java-hs_json_fastframed-framed-ip",
"java-hs_json_framed-ip",
- "nodejs-csharp_compact_buffered-ip-ssl",
- "nodejs-csharp_compact_framed-ip-ssl",
- "nodejs-csharp_json_buffered-ip",
- "nodejs-csharp_json_buffered-ip-ssl",
- "nodejs-csharp_json_framed-ip",
- "nodejs-csharp_json_framed-ip-ssl",
+ "java-perl_binary_buffered-ip-ssl",
+ "java-perl_binary_fastframed-framed-ip-ssl",
+ "java-perl_binary_framed-ip-ssl",
"nodejs-hs_binary_buffered-ip",
"nodejs-hs_binary_framed-ip",
"nodejs-hs_compact_buffered-ip",
"nodejs-hs_compact_framed-ip",
"nodejs-hs_json_buffered-ip",
"nodejs-hs_json_framed-ip",
- "nodejs-rb_json_buffered-ip",
+ "nodejs-perl_binary_buffered-ip-ssl",
+ "nodejs-perl_binary_framed-ip-ssl",
+ "perl-perl_binary_buffered-ip-ssl",
+ "perl-perl_binary_framed-ip-ssl",
"perl-php_binary_framed-ip",
"py-hs_json_buffered-ip",
"py-hs_json_framed-ip",
+ "py-perl_accel-binary_buffered-ip-ssl",
+ "py-perl_accel-binary_framed-ip-ssl",
+ "py-perl_binary_buffered-ip-ssl",
+ "py-perl_binary_framed-ip-ssl",
"py3-hs_json_buffered-ip",
"py3-hs_json_framed-ip",
+ "py3-perl_binary_buffered-ip-ssl",
+ "py3-perl_binary_framed-ip-ssl",
"rb-hs_json_buffered-ip",
"rb-hs_json_framed-ip"
-]
\ No newline at end of file
+]
diff --git a/test/rb/integration/TestClient.rb b/test/rb/integration/TestClient.rb
index 6aec596..15dcbfd 100755
--- a/test/rb/integration/TestClient.rb
+++ b/test/rb/integration/TestClient.rb
@@ -318,9 +318,9 @@
def test_oneway
p 'test_oneway'
time1 = Time.now.to_f
- @client.testOneway(3)
+ @client.testOneway(1)
time2 = Time.now.to_f
- assert_equal((time2-time1)*1000000<400, true)
+ assert_operator (time2-time1), :<, 0.1
end
end
diff --git a/test/tests.json b/test/tests.json
index 2c1aa70..be7d52b 100644
--- a/test/tests.json
+++ b/test/tests.json
@@ -325,6 +325,7 @@
"server": {
"delay": 3,
"command": [
+ "mono",
"TestClientServer.exe",
"server"
]
@@ -332,6 +333,7 @@
"client": {
"timeout": 9,
"command": [
+ "mono",
"TestClientServer.exe",
"client"
]
@@ -451,6 +453,7 @@
]
},
"server": {
+ "delay": 5,
"command": [
"erl",
"+K",