Properly report C++ build time.

pull/1295/head
Josh Haberman 9 years ago
parent 1ee0fda556
commit 2bda98f79c
  1. 12
      tools/jenkins/build_and_run_docker.sh
  2. 4
      tools/jenkins/make_test_output.py
  3. 7
      tools/run_tests/jenkins.sh

@ -46,16 +46,18 @@ cd -
# Use image name based on Dockerfile location checksum
DOCKER_IMAGE_NAME=$(basename $DOCKERFILE_DIR)_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ )
# Ensure existence of ccache directory
CCACHE_DIR=/tmp/protobuf-ccache
mkdir -p $CCACHE_DIR
# Make sure docker image has been built. Should be instantaneous if so.
docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR
docker build \
-v $CCACHE_DIR:$CCACHE_DIR \
-t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR
# Choose random name for docker container
CONTAINER_NAME="build_and_run_docker_$(uuidgen)"
# Ensure existence of ccache directory
CCACHE_DIR=/tmp/protobuf-ccache
mkdir -p $CCACHE_DIR
# Run command inside docker
docker run \
"$@" \

@ -58,8 +58,8 @@ def readtests(basedir):
# up in the job log.
tests["cpp"]["name"] = "cpp"
# TODO
tests["cpp"]["time"] = "0"
with open(basedir + '/logs/1/cpp/build_time', 'r') as f:
tests["cpp"]["time"] = f.read().strip()
tests["cpp"]["failure"] = False
ret = tests.values()

@ -34,7 +34,12 @@ mkdir -p $LOG_OUTPUT_DIR/1/cpp
# $DIR/logs/1/java_jdk7/stderr
CPP_STDOUT=$LOG_OUTPUT_DIR/1/cpp/stdout
CPP_STDERR=$LOG_OUTPUT_DIR/1/cpp/stderr
$TEST_SCRIPT cpp > >(tee $CPP_STDOUT) 2> >(tee $CPP_STDERR >&2)
# It's important that we get /usr/bin/time (which supports -f and -o) and not
# the bash builtin "time" which doesn't.
TIME_CMD="/usr/bin/time -f %e -o $LOG_OUTPUT_DIR/1/cpp/build_time"
$TIME_CMD $TEST_SCRIPT cpp > >(tee $CPP_STDOUT) 2> >(tee $CPP_STDERR >&2)
# Other tests are run in parallel. The overall run fails if any one of them
# fails.

Loading…
Cancel
Save