|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 | +# contributor license agreements. See the NOTICE file distributed with |
| 5 | +# this work for additional information regarding copyright ownership. |
| 6 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 7 | +# (the "License"); you may not use this file except in compliance with |
| 8 | +# the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | + |
| 18 | +### This script is used by Kubernetes Test Infrastructure to run integration tests. |
| 19 | +### See documenation at https://github.com/kubernetes/test-infra/tree/master/prow |
| 20 | + |
| 21 | +set -ex |
| 22 | + |
| 23 | +# Include requisite scripts |
| 24 | +source ./include/util.sh |
| 25 | + |
| 26 | +TEST_ROOT_DIR=$(git rev-parse --show-toplevel) |
| 27 | +BRANCH="master" |
| 28 | +SPARK_REPO="https://github.com/apache/spark" |
| 29 | +SPARK_REPO_LOCAL_DIR="$TEST_ROOT_DIR/target/spark" |
| 30 | + |
| 31 | +## Install basic dependencies |
| 32 | +## These are for the kubekins-e2e environment in https://github.com/kubernetes/test-infra/tree/master/images/kubekins-e2e |
| 33 | +echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list |
| 34 | +apt-get update && apt-get install -y curl wget git tar uuid-runtime |
| 35 | +apt-get install -t jessie-backports -y openjdk-8-jdk |
| 36 | + |
| 37 | +# Set up config. |
| 38 | +MASTER=$(kubectl cluster-info | head -n 1 | grep -oE "https?://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]+)?") |
| 39 | + |
| 40 | +# Special GCP project for publishing docker images built by test. |
| 41 | +IMAGE_REPO="gcr.io/spark-testing-191023" |
| 42 | + |
| 43 | +# Cloning the spark distribution |
| 44 | +echo "Cloning $SPARK_REPO into $SPARK_REPO_LOCAL_DIR and checking out $BRANCH." |
| 45 | +clone_build_spark $SPARK_REPO $SPARK_REPO_LOCAL_DIR $BRANCH |
| 46 | + |
| 47 | +# Spark distribution |
| 48 | +properties=( |
| 49 | + -Dspark.kubernetes.test.master=k8s://$MASTER \ |
| 50 | + -Dspark.kubernetes.test.imageRepo=$IMAGE_REPO \ |
| 51 | + -Dspark.kubernetes.test.sparkTgz="$SPARK_TGZ" \ |
| 52 | + -Dspark.kubernetes.test.deployMode=cloud \ |
| 53 | + -Dspark.kubernetes.test.namespace=default \ |
| 54 | + -Dspark.kubernetes.test.serviceAccountName=default |
| 55 | +) |
| 56 | + |
| 57 | +# Run tests. |
| 58 | +echo "Starting test with ${properties[@]}" |
| 59 | +build/mvn integration-test "${properties[@]}" |
| 60 | + |
| 61 | +# Copy out the junit xml files for consumption by k8s test-infra. |
| 62 | +ls -1 ./integration-test/target/surefire-reports/*.xml | cat -n | while read n f; do cp "$f" "/workspace/_artifacts/junit_0$n.xml"; done |
0 commit comments