Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit b7d7a84

Browse files
authored
Merge pull request #298 from Lukasa/better-testing
Fixup bad test behaviour on travis.
2 parents 1f8e53f + 654d4a4 commit b7d7a84

File tree

3 files changed

+16
-54
lines changed

3 files changed

+16
-54
lines changed

.travis.yml

+1-15
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,15 @@ env:
1111
- TEST_RELEASE=false HYPER_FAST_PARSE=true
1212
- TEST_RELEASE=true HYPER_FAST_PARSE=false
1313
- TEST_RELEASE=true HYPER_FAST_PARSE=true
14-
- NGHTTP2=true
1514

1615
matrix:
1716
allow_failures:
1817
- env: TEST_RELEASE=true HYPER_FAST_PARSE=true
1918
- env: TEST_RELEASE=true HYPER_FAST_PARSE=false
20-
exclude:
21-
- env: NGHTTP2=true
22-
python: "pypy-5.3.1"
2319

2420
install:
2521
- ".travis/install.sh"
2622
before_script: "flake8 --max-complexity 15 --exclude 'hyper/packages/*' hyper test"
2723

2824
script:
29-
- >
30-
if [[ "$TEST_RELEASE" == true ]]; then
31-
py.test test_release.py
32-
else
33-
if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then
34-
py.test test/
35-
else
36-
coverage run -m py.test test/
37-
coverage report
38-
fi
39-
fi
25+
- ".travis/run.sh"

.travis/install.sh

-39
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,6 @@
33
set -e
44
set -x
55

6-
if [[ "$NGHTTP2" = true ]]; then
7-
# GCC 4.6 seems to cause problems, so go straight to 4.8.
8-
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
9-
sudo apt-get update
10-
sudo apt-get install g++-4.8 libstdc++-4.8-dev
11-
export CXX="g++-4.8" CC="gcc-4.8"
12-
$CC --version
13-
14-
# Install nghttp2. Right now I haven't built a PPA for this so we have to
15-
# do it from source, which kinda sucks. First, install a ton of
16-
# prerequisite packages.
17-
sudo apt-get install autoconf automake autotools-dev libtool pkg-config \
18-
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \
19-
libevent-dev libjansson-dev libjemalloc-dev
20-
pip install cython
21-
22-
# Now, download and install nghttp2's latest version.
23-
git clone https://github.com/tatsuhiro-t/nghttp2.git
24-
cd nghttp2
25-
DIR=`pwd`
26-
export PYTHONPATH="$DIR/lib/python${TRAVIS_PYTHON_VERSION}/site-packages"
27-
mkdir -p $PYTHONPATH
28-
autoreconf -i
29-
automake
30-
autoconf
31-
./configure --disable-threads --prefix=`pwd`
32-
make
33-
make install
34-
35-
# The makefile doesn't install into the active virtualenv. Install again.
36-
cd python
37-
python setup.py install
38-
cd ../..
39-
40-
# Let's try ldconfig.
41-
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/libnghttp2.conf'
42-
sudo ldconfig
43-
fi
44-
456
if [[ "$HYPER_FAST_PARSE" = true ]]; then
467
pip install pycohttpparser~=1.0
478
fi

.travis/run.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [[ "$TEST_RELEASE" == true ]]; then
7+
py.test test_release.py
8+
else
9+
if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then
10+
py.test test/
11+
else
12+
coverage run -m py.test test/
13+
coverage report
14+
fi
15+
fi

0 commit comments

Comments
 (0)