From 271dd61c58575853b9e3efbaf241d85db3a6552a Mon Sep 17 00:00:00 2001 From: Daniel Schauenberg Date: Wed, 4 Jan 2017 10:02:48 -0500 Subject: [PATCH] add proxy server as docker service this makes the tests rely on a dockerized proxy service instead of a random server on the internet --- .travis.yml | 9 +++++++++ test/test_connection.cc | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a8ddd2b0..63248e7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,21 @@ language: cpp dist: trusty sudo: required group: beta + +services: + - docker + compiler: - gcc - clang script: - ./autogen.sh && ./configure --enable-coverage - make ci + +before_install: + - docker pull chrisdaish/squid + - docker run -d -p 3128:3128 chrisdaish/squid + - docker ps -a install: - gem install fpm - gem install package_cloud diff --git a/test/test_connection.cc b/test/test_connection.cc index ba8805c0..adddbb9e 100644 --- a/test/test_connection.cc +++ b/test/test_connection.cc @@ -219,14 +219,14 @@ TEST_F(ConnectionTest, TestNoSignal) TEST_F(ConnectionTest, TestProxy) { - conn->SetProxy("37.187.100.23:3128"); + conn->SetProxy("127.0.0.1:3128"); RestClient::Response res = conn->get("/get"); EXPECT_EQ(200, res.code); } TEST_F(ConnectionTest, TestProxyAddressPrefixed) { - conn->SetProxy("https://37.187.100.23:3128"); + conn->SetProxy("https://127.0.0.1:3128"); RestClient::Response res = conn->get("/get"); EXPECT_EQ(200, res.code); }