Skip to content

Commit 3ae257c

Browse files
authored
Use server-configs-test for tests (#176)
Co-authored-by: <[email protected]>
1 parent 35edb91 commit 3ae257c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+474
-4311
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
node_modules
2-
test/fixtures/.htaccess
2+
dist/
3+
test/*
4+
!test/build/
5+
!test/vhosts/
36
*.old

.travis.yml

+48-30
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,55 @@
1-
# For more information about the configurations used
2-
# in this file, please see the Travis CI documentation:
31
# https://docs.travis-ci.com/
42

5-
language: node_js
6-
node_js: node
7-
sudo: required
3+
language: minimal
84

9-
env:
10-
global:
11-
- secure: "itatOgspOE49LX1fczgut51/3AGiCE7ueMeUHdGseB7cWfyFlJ2eUozspXBfbmWtEls8Y97/V1Q8vZty/WXJ2Q3CdxjK8TBBhVycRgK5Qp03eG/yFy/G5hXN1mGil4KwIwqHVYAQvCVcuDv0Ek4V+PEfNp8KGkRILxP2a6kRjgw="
12-
13-
jobs:
14-
include:
15-
- env: # Tests for Apache 2.4.x
16-
- APACHE_VERSION="2.4"
17-
- CONF_TARGET="000-default.conf"
18-
before_script: ./bin/setup.sh
19-
20-
- stage: distribution
21-
if: branch = master
22-
script: .travis/update-dist.sh
23-
24-
fast_finish: true
25-
allow_failures:
26-
- stage: distribution
27-
28-
after_failure:
29-
- sudo cat /var/log/apache2/error.log
30-
- sudo cat /var/log/apache2/access.log
5+
services:
6+
- docker
317

328
addons:
339
hosts:
34-
- travis.localhost
10+
- server.localhost
11+
- www-server.localhost
12+
- www.server.localhost
13+
- secure.server.localhost
14+
- www.secure.server.localhost
15+
apt:
16+
packages:
17+
- docker-ce
18+
19+
install:
20+
- curl -sSL https://github.com/h5bp/server-configs-test/releases/download/1.0.1/server-configs-test.tar.gz | tar -xz -C test/
21+
22+
before_script:
23+
- bash -c "./bin/build.sh test/fixtures/.htaccess test/build/htaccess_fixture.conf"
24+
- docker pull httpd
25+
- |
26+
docker run -d -p 80:80 -p 443:443 --name server \
27+
-v $TRAVIS_BUILD_DIR/test/fixtures:/usr/local/apache2/htdocs \
28+
-v $TRAVIS_BUILD_DIR/test/vhosts/httpd.conf:/usr/local/apache2/conf/httpd.conf \
29+
httpd
30+
31+
script:
32+
- ./test/bin/k6 run test/lib/index.js -e TESTS=basic-file-access:cache-busting:custom-errors:forbidden-files:enforce-gzip:precompressed-files-gzip:concatenation
33+
- bash -c "./test/build/test_userbuild.sh"
34+
35+
after_success: ./test/bin/k6 run test/lib/benchmark.js
3536

36-
cache:
37-
directories: node_modules
37+
after_failure:
38+
- docker ps -a
39+
- docker logs server
40+
41+
before_deploy: bash -c "bin/build.sh dist/.htaccess htaccess.conf"
42+
43+
deploy:
44+
- provider: releases
45+
api_key: $GITHUB_API_TOKEN
46+
file: dist/.htaccess
47+
skip_cleanup: true
48+
on:
49+
tags: true
50+
- provider: npm
51+
email: $NPM_API_EMAIL
52+
api_key: $NPM_API_TOKEN
53+
skip_cleanup: true
54+
on:
55+
tags: true

.travis/github-deploy-key.enc

-3.17 KB
Binary file not shown.

.travis/update-dist.sh

-15
This file was deleted.

bin/setup.sh

-28
This file was deleted.

bin/setup_configs/2.4.conf

-19
This file was deleted.

0 commit comments

Comments
 (0)