X Tutup
Skip to content

Commit b954dcc

Browse files
committed
Revert "Run Travis tests in Docker (letsencrypt#1830)" (letsencrypt#1834)
This reverts commit 92d94f2 and commit 0b4623f to unbreak the Certbot build.
1 parent 0b4623f commit b954dcc

File tree

20 files changed

+99
-238
lines changed

20 files changed

+99
-238
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
bin
22
tags
3+
.git
4+
test/js

.travis.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@ addons:
99
- boulder
1010
- boulder-mysql
1111
- boulder-rabbitmq
12+
apt:
13+
packages:
14+
- lsb-release
15+
- python-dev
16+
- python-virtualenv
17+
- gcc
18+
- libaugeas0
19+
- libssl-dev
20+
- libffi-dev
21+
- ca-certificates
22+
- rsyslog
23+
mariadb: "10.0"
1224

13-
sudo: required
25+
sudo: false
1426

1527
services:
16-
- docker
28+
- rabbitmq
1729

1830
matrix:
1931
fast_finish: true
@@ -31,6 +43,13 @@ branches:
3143
- release
3244
- /^test-.*$/
3345

46+
# By providing our own install command we avoid Travis' default Go install
47+
# command, which runs `go get`. We specifically want to avoid that because we
48+
# want to ensure all our dependencies are vendored.
49+
install:
50+
- travis_retry test/travis-before-install.sh
51+
- cd $GOPATH/src/github.com/letsencrypt/boulder
52+
3453
env:
3554
global:
3655
- PATH=$HOME/bin:$PATH # protoc gets installed here
@@ -42,10 +61,6 @@ env:
4261
- RUN="integration" BOULDER_CONFIG="test/boulder-config-next.json"
4362
- RUN="unit"
4463

45-
install:
46-
- docker-compose pull
47-
- docker pull letsencrypt/boulder-tools
48-
- docker-compose build
49-
5064
script:
51-
- docker-compose run -e RUN="${RUN}" -e TRAVIS="${TRAVIS}" -e TRAVIS_COMMIT="${TRAVIS_COMMIT}" -e TRAVIS_PULL_REQUEST="${TRAVIS_PULL_REQUEST}" boulder ./test.sh
65+
- bash test.sh
66+

Dockerfile

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
FROM letsencrypt/boulder-tools:latest
1+
FROM golang:1.5
2+
3+
MAINTAINER J.C. Jones "jjones@letsencrypt.org"
4+
MAINTAINER William Budington "bill@eff.org"
5+
6+
# Install dependencies packages
7+
RUN apt-get update && apt-get install -y \
8+
libltdl-dev \
9+
mariadb-client-core-10.0 \
10+
nodejs \
11+
rsyslog \
12+
softhsm \
13+
--no-install-recommends \
14+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15+
16+
# Install port forwarder, database migration tool and go lint
17+
RUN go get -v \
18+
github.com/jsha/listenbuddy \
19+
bitbucket.org/liamstask/goose/cmd/goose \
20+
github.com/golang/lint/golint
221

322
# Boulder exposes its web application at port TCP 4000
423
EXPOSE 4000 4002 4003 8053 8055
524

625
ENV GO15VENDOREXPERIMENT 1
7-
ENV GOBIN /go/src/github.com/letsencrypt/boulder/bin
8-
ENV PATH /go/bin:/go/src/github.com/letsencrypt/boulder/bin:/usr/local/go/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/
9-
ENV GOPATH /go
10-
11-
RUN adduser --disabled-password --gecos "" --home /go/src/github.com/letsencrypt/boulder -q buser
12-
RUN chown -R buser /go/
1326

1427
WORKDIR /go/src/github.com/letsencrypt/boulder
1528

16-
# Copy in the Boulder sources
17-
COPY . .
18-
RUN mkdir bin
19-
RUN go install ./cmd/rabbitmq-setup
20-
COPY ./test/certbot /go/bin/
29+
ENTRYPOINT [ "./test/entrypoint.sh" ]
2130

22-
RUN chown -R buser /go/
31+
# Copy in the Boulder sources
32+
COPY . /go/src/github.com/letsencrypt/boulder
2333

24-
ENTRYPOINT [ "./test/entrypoint.sh" ]
34+
RUN GOBIN=/go/src/github.com/letsencrypt/boulder/bin go install ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ setting](https://groups.google.com/forum/#!topic/binary-transparency/f-BI4o8HZW0
2727
for better integrity guarantees when getting updates.
2828

2929
Boulder requires an installation of RabbitMQ, libtool-ltdl, goose, and
30-
MariaDB 10.1 to work correctly. On Ubuntu and CentOS, you may have to
30+
MariaDB 10 to work correctly. On Ubuntu and CentOS, you may have to
3131
install RabbitMQ from https://rabbitmq.com/download.html to get a
3232
recent version.
3333

docker-compose.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,27 @@
11
boulder:
22
build: .
33
dockerfile: Dockerfile
4-
volumes:
5-
# Cache built .a files for faster repeat runs
6-
- /go/pkg/
7-
- /tmp:/tmp
84
net: bridge
9-
extra_hosts:
10-
- le.wtf:127.0.0.1
11-
- boulder:127.0.0.1
125
ports:
13-
- 4000:4000 # ACME
14-
- 4002:4002 # OCSP
15-
- 4003:4003 # OCSP
16-
- 4500:4500 # ct-test-srv
17-
- 8000:8000 # debug ports
18-
- 8001:8001
19-
- 8002:8002
20-
- 8003:8003
21-
- 8004:8004
22-
- 8055:8055 # dns-test-srv updates
23-
- 9380:9380 # mail-test-srv
24-
- 9381:9381 # mail-test-srv
6+
- 4000:4000
7+
- 4002:4002
8+
- 4003:4003
259
links:
2610
- bmysql:boulder-mysql
2711
- brabbitmq:boulder-rabbitmq
12+
extra_hosts:
13+
- boulder:127.0.0.1
2814
bmysql:
29-
image: mariadb:10.1
15+
container_name: boulder-mysql
16+
image: mariadb:10.0
3017
net: bridge
3118
environment:
3219
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
3320
command: mysqld --bind-address=0.0.0.0
34-
log_driver: none
3521
brabbitmq:
22+
container_name: boulder-rabbitmq
3623
image: rabbitmq:3
3724
net: bridge
3825
environment:
3926
RABBITMQ_NODE_IP_ADDRESS: "0.0.0.0"
40-
log_driver: none
27+
log_driver: "none"

reloader/reloader.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ func (r *Reloader) Stop() {
2323
r.stopChan <- struct{}{}
2424
}
2525

26-
// A pointer we can override for testing.
27-
var readFile = ioutil.ReadFile
28-
2926
// New loads the filename provided, and calls the callback. It then spawns a
3027
// goroutine to check for updates to that file, calling the callback again with
3128
// any new contents. The first load, and the first call to callback, are run
@@ -40,7 +37,7 @@ func New(filename string, dataCallback func([]byte) error, errorCallback func(er
4037
if err != nil {
4138
return nil, err
4239
}
43-
b, err := readFile(filename)
40+
b, err := ioutil.ReadFile(filename)
4441
if err != nil {
4542
return nil, err
4643
}
@@ -61,7 +58,7 @@ func New(filename string, dataCallback func([]byte) error, errorCallback func(er
6158
if !currentFileInfo.ModTime().After(fileInfo.ModTime()) {
6259
continue
6360
}
64-
b, err := readFile(filename)
61+
b, err := ioutil.ReadFile(filename)
6562
if err != nil {
6663
errorCallback(err)
6764
continue

reloader/reloader_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,14 @@ func TestNoStat(t *testing.T) {
3636
func TestNoRead(t *testing.T) {
3737
f, _ := ioutil.TempFile("", "test-no-read.txt")
3838
defer os.Remove(f.Name())
39-
oldReadFile := readFile
40-
readFile = func(string) ([]byte, error) {
41-
return nil, fmt.Errorf("read failed")
39+
err := f.Chmod(0)
40+
if err != nil {
41+
t.Fatalf("failed to chmod file: %s", err)
4242
}
43-
_, err := New(f.Name(), noop, testErrCb(t))
43+
_, err = New(f.Name(), noop, testErrCb(t))
4444
if err == nil {
4545
t.Fatalf("Expected New to return error when permission denied.")
46-
readFile = oldReadFile
4746
}
48-
readFile = oldReadFile
4947
}
5048

5149
func TestFirstError(t *testing.T) {
@@ -184,11 +182,10 @@ func TestReloadFailure(t *testing.T) {
184182

185183
time.Sleep(15 * time.Millisecond)
186184
// Create a file with no permissions
187-
oldReadFile := readFile
188-
readFile = func(string) ([]byte, error) {
189-
return nil, fmt.Errorf("permisssion denied")
185+
err = ioutil.WriteFile(filename, []byte("second body"), 0)
186+
if err != nil {
187+
t.Fatal(err)
190188
}
191-
192189
fakeTick <- time.Now()
193190
select {
194191
case r := <-reloads:
@@ -198,8 +195,11 @@ func TestReloadFailure(t *testing.T) {
198195
case <-time.After(5 * time.Second):
199196
t.Fatalf("timed out waiting for reload")
200197
}
201-
readFile = oldReadFile
202198

199+
err = os.Remove(filename)
200+
if err != nil {
201+
t.Fatal(err)
202+
}
203203
err = ioutil.WriteFile(filename, []byte("third body"), 0644)
204204
if err != nil {
205205
t.Fatal(err)

test.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ function die() {
7272
exit 1
7373
}
7474

75+
function build_certbot() {
76+
run git clone \
77+
https://www.github.com/certbot/certbot.git \
78+
$CERTBOT_PATH || exit 1
79+
cd $CERTBOT_PATH
80+
run ./tools/venv.sh
81+
cd -
82+
}
83+
7584
function run_unit_tests() {
7685
if [ "${TRAVIS}" == "true" ]; then
7786

@@ -179,20 +188,18 @@ if [[ "$RUN" =~ "integration" ]] ; then
179188
start_context "integration"
180189

181190
if [ -z "$CERTBOT_PATH" ]; then
182-
export CERTBOT_PATH=$(mktemp -d -t cbpXXXX)
191+
export CERTBOT_PATH=$(mktemp -d -t leXXXX)
183192
echo "------------------------------------------------"
184193
echo "--- Checking out letsencrypt client is slow. ---"
185194
echo "--- Recommend setting \$CERTBOT_PATH to ---"
186195
echo "--- client repo with initialized virtualenv ---"
187196
echo "------------------------------------------------"
188-
run git clone \
189-
https://www.github.com/certbot/certbot.git \
190-
$CERTBOT_PATH || exit 1
197+
build_certbot
198+
elif [ ! -d "${CERTBOT_PATH}" ]; then
199+
build_certbot
191200
fi
192201

193-
if ! type certbot >/dev/null 2>/dev/null; then
194-
source ${CERTBOT_PATH}/${VENV_NAME:-venv}/bin/activate
195-
fi
202+
source ${CERTBOT_PATH}/venv/bin/activate
196203

197204
python test/integration-test.py --all
198205
if [ "$?" != 0 ]; then

test/boulder-tools/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/boulder-tools/build.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)
X Tutup