Preseed the run-tests.sh cache to make test runs faster.
[arvados-dev.git] / jenkins / packer-images / jenkins-image-arvados-tests.sh
1 #!/bin/bash
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 set -eo pipefail
8
9 # Install the dependencies for arvados-server
10 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y libpam0g-dev wget build-essential"
11
12 # Get Go 1.16.3
13 cd /usr/src
14 sudo wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
15 sudo tar xzf go1.16.3.linux-amd64.tar.gz
16 sudo ln -s /usr/src/go/bin/go /usr/local/bin/go-1.16.3
17 sudo ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-1.16.3
18 sudo ln -s /usr/local/bin/go-1.16.3 /usr/local/bin/go
19 sudo ln -s /usr/local/bin/gofmt-1.16.3 /usr/local/bin/gofmt
20
21 # Check out a local copy of the arvados repo so we can use it to install the dependencies
22 cd /usr/src
23 sudo git clone arvados.git
24 cd arvados
25 sudo go mod download
26 sudo go run ./cmd/arvados-server install -type test
27
28 # Our Jenkins jobs use this directory to store the temporary files for the tests
29 mkdir /home/jenkins/tmp
30
31 # Preseed the run-tests.sh cache. This is a little bit silly (a lot of this
32 # stuff was already done by the call to `./cmd/arvados-server install -type
33 # test` above, but they do not share a cache.
34 sudo ./build/run-tests.sh WORKSPACE=/usr/src/arvados --temp /home/jenkins/tmp --only install
35 sudo chown jenkins:jenkins /home/jenkins -R