21700: Install Bundler system-wide in Rails postinst
[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
17         "gopkg.in/check.v1"
18 )
19
20 func (*Suite) TestInstallDeps(c *check.C) {
21         tmp := c.MkDir()
22         script := `
23 set -x
24 tmp="` + tmp + `"
25 sourcepath="$(realpath ../..)"
26 (cd ${sourcepath} && go build -o ${tmp} ./cmd/arvados-server)
27 docker run -i --rm --workdir /arvados \
28        -v ${tmp}/arvados-server:/arvados-server:ro \
29        -v ${sourcepath}:/arvados:ro \
30        -v /arvados/services/api/.bundle \
31        -v /arvados/services/api/tmp \
32        --env http_proxy \
33        --env https_proxy \
34        debian:11 \
35        bash -c "/arvados-server install -type test &&
36            git config --global --add safe.directory /arvados &&
37            /arvados-server boot -type test -config doc/examples/config/zzzzz.yml -own-temporary-database -shutdown -timeout 9m"
38 `
39         c.Check((&installCommand{}).runBash(script, os.Stdout, os.Stderr), check.IsNil)
40 }