Skip to content

Commit 2b0399f

Browse files
committed
move docker setup into Makefile
this moves the docker services setup into the Makefile making it easier to run the full CI test suite with just a single `make ci` command.
1 parent 743133d commit 2b0399f

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
## How to run tests
1111

12+
Since most of the tests are actually integration tests you will need to have a
13+
working docker setup to make the full test suite pass.
14+
1215
1. build vendorized gtest: `./utils/build_gtest.sh`
1316
2. build restclient-cpp: `./autogen.sh && ./configure && make check`
14-
3. run the proxy server used in testing: `docker run -d -p 3128:3128 chrisdaish/squid`
15-
4. run the unit test suite: `make test`
17+
3. run the unit test suite: `make ci`

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ script:
1313
- ./autogen.sh && ./configure --enable-coverage
1414
- make ci
1515

16-
before_install:
17-
- docker pull chrisdaish/squid
18-
- docker run -d -p 3128:3128 chrisdaish/squid
19-
- docker ps -a
2016
install:
2117
- gem install fpm
2218
- gem install package_cloud

Makefile.am

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ librestclient_cpp_la_LDFLAGS=-version-info 2:1:1
1616

1717
dist_doc_DATA = README.md
1818

19-
.PHONY: test check clean-coverage-files coverage-html include/restclient-cpp/version.h lint ci
19+
.PHONY: test check clean-coverage-files coverage-html include/restclient-cpp/version.h lint ci docker-services
2020

2121
include/restclient-cpp/version.h:
2222
m4 -I m4 -DM4_RESTCLIENT_VERSION=$(VERSION) version.h.m4 > $@
@@ -30,7 +30,11 @@ valgrind: check
3030
lint:
3131
cpplint --filter=-legal/copyright include/restclient-cpp/*.h source/*.cc
3232

33-
ci: lint test valgrind
33+
docker-services:
34+
docker inspect --format="{{ .State.Running }}" restclient-proxy &> /dev/null || docker run -d --name restclient-proxy -p 3128:3128 chrisdaish/squid
35+
docker ps -a
36+
37+
ci: lint docker-services test valgrind
3438

3539
clean-local:
3640
find . -name "*.gcda" -print0 | xargs -0 rm

0 commit comments

Comments
 (0)