forked from freedomofpress/securedrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (49 loc) · 2.15 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
# Use Ubuntu 14.04 LTS images, and explicitly require sudo.
# Relevant docs: https://docs.travis-ci.com/user/trusty-ci-environment/
sudo: required
dist: trusty
# Pin older version of Firefox, for Selenium compatibility. Must match version
# specified in app-test role vars!
addons:
firefox: 46.0.1
# Setting language=generic to prevent Travis from setting up a virtualenv.
# Using a virtualenv conflicts with the global pip installation currently
# used for configuring SecureDrop, both in development and staging.
language: generic
before_install:
- 'for e in /.packer-env/*; do echo -n "${e}: "; cat "${e}"; done'
# Removes Travis-specific PATH customizations that affect Python.
- export PATH="$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")"
- printenv | sort # dump Travis environment for debugging
- pip freeze -l
install:
# Installing Python dependencies globally, to match SecureDrop deployment.
- sudo -H pip install -r securedrop/requirements/develop-requirements.txt
# Run linting early, to fail fast.
- make --keep-going lint
# Using YAML folding operator '>' to aid in readability and avoid
# extremely long lines.
- >
printf
"[development]\nlocalhost ansible_connection=local\n[travis]\nlocalhost"
> inventory
- >
ansible-playbook -i inventory -vv --syntax-check
install_files/ansible-base/securedrop-development.yml
- >
ansible-playbook -i inventory -vv --connection=local
install_files/ansible-base/securedrop-development.yml
script:
# For some reason, redis-server does not start automatically when installed
# on Travis. I believe Travis' service machinery may be interfering. See
# http://docs.travis-ci.com/user/database-setup/#Redis
- sudo service redis-server start
# The `cd securedrop` is necessary for coverage support. Swap in the line
# below once #2246 is resolved.
# - DISPLAY=:1 pytest -v securedrop/tests --page-layout
- sh -c "export DISPLAY=:1 ; cd securedrop && pytest -v tests --page-layout"
- pip freeze -l
- SECUREDROP_TESTINFRA_TARGET_HOST=travis testinfra -v testinfra/development/
after_success:
cd securedrop/ && coveralls