forked from ledgersmb/LedgerSMB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
224 lines (207 loc) · 7.94 KB
/
.travis.yml
File metadata and controls
224 lines (207 loc) · 7.94 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# On your fork, you can configure build logs to be written to an
# AWS S3 bucket by making sure the following variables have been
# set in your Travis CI repository settings page:
#
# - AWS_ACCESS_KEY_ID (display value in build log: No)
# - AWS_SECRET_ACCESS_KEY (display value in build log: No)
# - AWS_DEFAULT_REGION (display value in build log: Yes)
# - LSMB_AWS_UPLOAD_BUCKET (display value in build log: Yes)
#
# AWS_DEFAULT_REGION should be the region hosting your S3 bucket
# LSMB_AWS_UPLOAD_BUCKET should contain the name of the bucket to upload into
dist: trusty
language: perl
notifications:
webhooks: https://ledgersmb.org/webhook/travis_ci_notifications
env:
global:
- RELEASE_TESTING=1
- PGUSER=postgres
- PGPASSWORD=test
- LSMB_TEST_DB=1
- LSMB_NEW_DB=lsmbinstalltest
- LSMB_BASE_URL="http://127.0.0.1:5000"
- PSGI_BASE_URL="http://127.0.0.1:5762"
- HARNESS_RULESFILE="t/testrules.yml"
- PATH=$HOME/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- PATH="$HOME/locallib/bin:$PATH"
- PERL_LOCAL_LIB_ROOT="$HOME/locallib${PERL_LOCAL_LIB_ROOT+:}$PERL_LOCAL_LIB_ROOT"
- PERL5LIB="$HOME/locallib/lib/perl5${PERL5LIB+:}$PERL5LIB"
- PERL_MM_OPT="INSTALL_BASE=$HOME/locallib"
- PERL_MB_OPT="--install_base=$HOME/locallib"
- QT_QPA_PLATFORM=phantom
- DEVEL_COVER_OPTIONS="+ignore,\"\.lttc\$\""
addons:
apt:
packages: &default_packages
# Install awscli dependencies from the package repo
- python3-pip
- python3-pyasn1
- python3-urllib3
- python3-yaml
- python3-dateutil
- python3-six
- python3-jmespath
- python3-botocore
- python3-rsa
- python3-docutils
- python3-colorama
- nginx
- texlive-latex-recommended
- texlive-xetex
matrix:
include:
- perl: '5.28'
addons:
postgresql: '9.6'
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- perl: '5.26'
addons:
postgresql: '9.6'
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- perl: '5.24'
addons:
postgresql: '9.6'
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- perl: '5.22'
addons:
postgresql: "9.6"
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- perl: '5.20'
addons:
postgresql: "9.6"
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- COA_TESTING=1
- perl: '5.18'
addons:
postgresql: "9.6"
apt:
packages:
- *default_packages
- postgresql-9.6-pgtap
env:
- DB_TESTING=1
before_cache:
- mkdir -p $HOME/dojo_archive
cache:
directories:
- $HOME/locallib
- $HOME/dojo_archive
before_install:
# list all the running services before we start. Perhaps we can stop some of them to save resources.
- service --status-all
# display the available resources
- utils/diagnostics/t/01-system-resources.t
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init
- build-perl 2>/dev/null
- perl -V
- npm install uglify-js@">=2.0 <3.0"
- pip3 install awscli --upgrade --user
install:
# Suppress warnings in Perl 5.28 about Locale::* being moved out of 'core'
# Further more is there a warning regarding redifinition of JSON::PP::Boolean
# which is fixed in 4.03 (so, reinstall, in order to get to newest)
- cpanm --reinstall --notest Locale::Country Locale::Codes Locale::Language JSON::PP
- cpanm --quiet --notest Cpanel::JSON::XS~3.0206
- cpanm --quiet --notest Starlet
- cpanm --quiet --notest --installdeps --with-develop --with-feature=edi --with-feature=latex-pdf-ps --with-feature=openoffice --with-feature=starman --with-feature=xls .
- cpan-install --coverage
before_script:
- make dist DIST_VER=travis DIST_DIR=${HOME}/built-dist/tar-output
- cd ${HOME}/built-dist
- tar xzf tar-output/ledgersmb-travis.tar.gz
- cd ledgersmb
- cp doc/conf/ledgersmb.conf.default ledgersmb.conf
- cp t/.proverc ./
- coverage-setup
- sed -e "s#{ROOT}#$PWD#" doc/conf/nginx-travis.conf >/tmp/nginx.conf
- ((phantomjs --webdriver=4422 2>/dev/null >/dev/null &) && echo "PhantomJS started succesfully") || (echo "Failed to start PhantomJS!" ; exit 1)
- PERL5OPT="$PERL5OPT $HARNESS_PERL_SWITCHES" plackup -s Starlet --max-workers 2 -Ilib -Iold/lib --port 5762 bin/ledgersmb-server.psgi --access-log /tmp/plackup-access.log 2> /tmp/plackup-error.log &
- nginx -c /tmp/nginx.conf
# display the available resources
- utils/diagnostics/t/01-system-resources.t
- |
mkdir screens logs
sed -i -e 's/post-step: 0/post-step: 1/' t/.pherkin.yaml
sed -i -e 's/# logging_dir:/logging_dir:/' t/.pherkin.yaml
script:
- prove --jobs $(test-jobs) --recurse
--pgtap-option dbname=lsmbinstalltest
--pgtap-option username=postgres
--feature-option tags=~@wip
t/ xt/
after_script:
# display the available resources
- utils/diagnostics/t/01-system-resources.t
- |
if [ -n "$AWS_ACCESS_KEY_ID" ];
then
(cd "$HOME/built-dist/ledgersmb/"
aws_url="s3://$LSMB_AWS_UPLOAD_BUCKET/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER"
aws s3 cp --quiet --recursive --acl public-read ./screens "$aws_url/logs/screens"
aws s3 cp --quiet --recursive --acl public-read ./logs "$aws_url/logs/html"
aws s3 cp --quiet --acl public-read /var/log/dmesg "$aws_url/logs/dmesg"
aws s3 cp --quiet --acl public-read /tmp/plackup-access.log "$aws_url/logs/plackup-access.log"
aws s3 cp --quiet --acl public-read /tmp/plackup-error.log "$aws_url/logs/plackup-error.log" )
echo Test results can be viewed from http://$LSMB_AWS_UPLOAD_BUCKET.s3.amazonaws.com/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/logs/index.html
echo plackup logs from:
echo http://$LSMB_AWS_UPLOAD_BUCKET.s3.amazonaws.com/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/logs/plackup-access.log
echo http://$LSMB_AWS_UPLOAD_BUCKET.s3.amazonaws.com/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/logs/plackup-error.log
echo dmesg info from:
echo http://$LSMB_AWS_UPLOAD_BUCKET.s3.amazonaws.com/$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/logs/dmesg
fi
after_success:
- |
if [ "$COVERAGE" == "1" ] ; then
curl http://localhost:5762/stop.pl ;
while [ -n "$(jobs -r | grep ledgersmb-server.psgi)" ] ; do sleep 1; echo -n "." ; done ;
echo "" ;
fi
- coverage-report
# try and force the github camo.githubusercontent.com cache to refresh our badges
# with no arguments, this only refreshes the badge assests linked to by the default page shown when visiting
# https://github.com/ledgersmb/LedgerSMB
# if we want to refresh assets other than those (ie: not master branch) then we will need to add explicit arguments to do so
# the script is sourced from https://github.com/sbts/github-badge-cache-buster but isn't expected to change so there is no point making it a submodule
- utils/test/github-badge-cache-buster.sh
after_failure:
- |
if [ -z "$AWS_ACCESS_KEY_ID" ]
then
echo ===============================
echo === dmesg ===
echo ===============================
cat /var/log/dmesg
# display the dmesg log. may give some hints about system related failures. eg: has the OOM killer triggered
echo ===============================
echo === /tmp/plackup-access.log ===
echo ===============================
cat /tmp/plackup-access.log
echo
echo ===============================
echo === /tmp/plackup-error.log ===
echo ===============================
cat /tmp/plackup-error.log
echo
fi