Merge branch '16053-install-deps'
[arvados.git] / lib / install / deps_test.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 // Skip this slow test unless invoked as "go test -tags docker".
6 // Depending on host/network speed, Go's default 10m test timeout
7 // might be too short; recommend "go test -timeout 20m -tags docker".
8 //
9 // +build docker
10
11 package install
12
13 import (
14         "os"
15         "testing"
16
17         "gopkg.in/check.v1"
18 )
19
20 func Test(t *testing.T) {
21         check.TestingT(t)
22 }
23
24 var _ = check.Suite(&Suite{})
25
26 type Suite struct{}
27
28 func (*Suite) TestInstallDeps(c *check.C) {
29         tmp := c.MkDir()
30         script := `
31 set -x
32 tmp="` + tmp + `"
33 sourcepath="$(realpath ../..)"
34 (cd ${sourcepath} && go build -o ${tmp} ./cmd/arvados-server)
35 docker run -i --rm --workdir /arvados \
36        -v ${tmp}/arvados-server:/arvados-server:ro \
37        -v ${sourcepath}:/arvados:ro \
38        -v /arvados/apps/workbench/.bundle \
39        -v /arvados/services/api/.bundle \
40        -v /arvados/services/api/tmp \
41        --env http_proxy \
42        --env https_proxy \
43        debian:10 \
44        bash -c "/arvados-server install -type test && /arvados-server boot -type test -config doc/examples/config/zzzzz.yml -own-temporary-database -shutdown -timeout 9m"
45 `
46         c.Check(runBash(script, os.Stdout, os.Stderr), check.IsNil)
47 }