Skip to content

Commit 18e7a57

Browse files
authored
Improve integration tests. (letsencrypt#4847)
Add passthrough for certain environment variables to docker-compose.yml, making it easier to set them: RUN=unit docker-compose run --use-aliases boulder ./test.sh Use 4001 instead of 4443 to monitor boulder-wfe2's health. This avoids a spurious error log about a failed TLS handshake. Remove unused code around running Certbot in integation tests.
1 parent d0d22cb commit 18e7a57

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

docker-compose.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ services:
44
# To minimize fetching this should be the same version used below
55
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.14.1}:2020-06-01
66
environment:
7-
FAKE_DNS: 10.77.77.77
8-
BOULDER_CONFIG_DIR: test/config
9-
GO111MODULE: "on"
10-
GOFLAGS: "-mod=vendor"
7+
- FAKE_DNS=10.77.77.77
8+
- BOULDER_CONFIG_DIR=test/config
9+
- GOFLAGS=-mod=vendor
1110
# This is required so Python doesn't throw an error when printing
1211
# non-ASCII to stdout.
13-
PYTHONIOENCODING: "utf-8"
12+
- PYTHONIOENCODING=utf-8
13+
# These are variables you can set to affect what tests get run or
14+
# how they are run. Including them here with no value means they are
15+
# passed through from the environment.
16+
- RUN
17+
- INT_FILTER
18+
- RACE
1419
volumes:
1520
- .:/go/src/github.com/letsencrypt/boulder:cached
1621
- ./.gocache:/root/.cache/go-build:cached

test/integration-test.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@
3838
if os.environ.get('RACE', 'true') != 'true':
3939
race_detection = False
4040

41-
def run_client_tests():
42-
root = os.environ.get("CERTBOT_PATH")
43-
assert root is not None, (
44-
"Please set CERTBOT_PATH env variable to point at "
45-
"initialized (virtualenv) client repo root")
46-
cmd = os.path.join(root, 'tests', 'boulder-integration.sh')
47-
run(cmd, cwd=root)
48-
4941
def run_go_tests(filterPattern=None):
5042
"""
5143
run_go_tests launches the Go integration tests. The go test command must
@@ -243,8 +235,6 @@ def expect_stat(port, stat):
243235

244236
def main():
245237
parser = argparse.ArgumentParser(description='Run integration tests')
246-
parser.add_argument('--certbot', dest='run_certbot', action='store_true',
247-
help="run the certbot integration tests")
248238
parser.add_argument('--chisel', dest="run_chisel", action="store_true",
249239
help="run integration tests using chisel")
250240
parser.add_argument('--gotest', dest="run_go", action="store_true",
@@ -254,12 +244,11 @@ def main():
254244
# allow any ACME client to run custom command for integration
255245
# testing (without having to implement its own busy-wait loop)
256246
parser.add_argument('--custom', metavar="CMD", help="run custom command")
257-
parser.set_defaults(run_certbot=False, run_chisel=False,
258-
test_case_filter="", skip_setup=False)
247+
parser.set_defaults(run_chisel=False, test_case_filter="", skip_setup=False)
259248
args = parser.parse_args()
260249

261-
if not (args.run_certbot or args.run_chisel or args.custom or args.run_go is not None):
262-
raise(Exception("must run at least one of the letsencrypt or chisel tests with --certbot, --chisel, --gotest, or --custom"))
250+
if not (args.run_chisel or args.custom or args.run_go is not None):
251+
raise(Exception("must run at least one of the letsencrypt or chisel tests with --chisel, --gotest, or --custom"))
263252

264253
# Setup issuance hierarchy
265254
startservers.setupHierarchy()
@@ -286,9 +275,6 @@ def main():
286275
if args.run_chisel:
287276
run_chisel(args.test_case_filter)
288277

289-
if args.run_certbot:
290-
run_client_tests()
291-
292278
if args.run_go:
293279
run_go_tests(args.test_case_filter)
294280

test/startservers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def start(race_detection, fakeclock):
9191
[8102, './bin/boulder-ra --config %s --addr ra2.boulder:9094 --debug-addr :8102' % os.path.join(config_dir, "ra.json")],
9292
[8111, './bin/nonce-service --config %s --addr nonce1.boulder:9101 --debug-addr :8111 --prefix taro' % os.path.join(config_dir, "nonce.json")],
9393
[8112, './bin/nonce-service --config %s --addr nonce2.boulder:9101 --debug-addr :8112 --prefix zinc' % os.path.join(config_dir, "nonce.json")],
94-
[4431, './bin/boulder-wfe2 --config %s' % os.path.join(config_dir, "wfe2.json")],
94+
[4001, './bin/boulder-wfe2 --config %s' % os.path.join(config_dir, "wfe2.json")],
9595
[4000, './bin/boulder-wfe --config %s' % os.path.join(config_dir, "wfe.json")],
9696
[8016, './bin/log-validator --config %s' % os.path.join(config_dir, "log-validator.json")],
9797
])

0 commit comments

Comments
 (0)