19146: Remove unneeded special case checks, explain the needed one.
[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 //go:build docker
10 // +build docker
11
12 package install
13
14 import (
15         "os"
16         "testing"
17
18         "gopkg.in/check.v1"
19 )
20
21 func Test(t *testing.T) {
22         check.TestingT(t)
23 }
24
25 var _ = check.Suite(&Suite{})
26
27 type Suite struct{}
28
29 func (*Suite) TestInstallDeps(c *check.C) {
30         tmp := c.MkDir()
31         script := `
32 set -x
33 tmp="` + tmp + `"
34 sourcepath="$(realpath ../..)"
35 (cd ${sourcepath} && go build -o ${tmp} ./cmd/arvados-server)
36 docker run -i --rm --workdir /arvados \
37        -v ${tmp}/arvados-server:/arvados-server:ro \
38        -v ${sourcepath}:/arvados:ro \
39        -v /arvados/apps/workbench/.bundle \
40        -v /arvados/services/api/.bundle \
41        -v /arvados/services/api/tmp \
42        --env http_proxy \
43        --env https_proxy \
44        debian:10 \
45        bash -c "/arvados-server install -type test && /arvados-server boot -type test -config doc/examples/config/zzzzz.yml -own-temporary-database -shutdown -timeout 9m"
46 `
47         c.Check(runBash(script, os.Stdout, os.Stderr), check.IsNil)
48 }