You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/06/21 21:15:50 UTC

[trafficcontrol] 01/02: fixed the Docker Container for the API Tests

This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 6c22bed78586ac591ce138e2318efca70f00e6ad
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Jun 21 14:18:41 2018 -0600

    fixed the Docker Container for the API Tests
---
 traffic_ops/testing/api/docker/Dockerfile           | 7 +++++++
 traffic_ops/testing/api/docker/run_api_tests.sh     | 2 +-
 traffic_ops/testing/api/docker/traffic-ops-test.env | 9 +++++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/traffic_ops/testing/api/docker/Dockerfile b/traffic_ops/testing/api/docker/Dockerfile
index d3d317a..a22cb61 100644
--- a/traffic_ops/testing/api/docker/Dockerfile
+++ b/traffic_ops/testing/api/docker/Dockerfile
@@ -20,12 +20,18 @@ ARG DB_SERVER
 ARG DB_PORT
 ARG DB_USER
 ARG DB_PASSWORD
+ARG TO_URL
+ARG TODB_HOSTNAME
+ARG TODB_NAME
 
 ENV DB_NAME=$DB_SERVER
 ENV DB_SERVER=$DB_SERVER
 ENV DB_PORT=$DB_PORT
 ENV DB_USER=$DB_SERVER
 ENV DB_PASSWORD=$DB_PASSWORD
+ENV TO_URL=$TO_URL
+ENV TODB_HOSTNAME=$TODB_HOSTNAME
+ENV TODB_NAME=$TODB_NAME
 
 ARG SRC_DIR=/go/src
 ARG TC_DIR=$SRC_DIR/github.com/apache/trafficcontrol
@@ -41,6 +47,7 @@ WORKDIR $TC_DIR
 ADD lib lib
 
 # Add the dependent dirs (without the cruft)
+ADD vendor vendor
 ADD traffic_ops/traffic_ops_golang traffic_ops/traffic_ops_golang
 ADD traffic_ops/vendor traffic_ops/vendor
 ADD traffic_ops/testing/api traffic_ops/testing/api
diff --git a/traffic_ops/testing/api/docker/run_api_tests.sh b/traffic_ops/testing/api/docker/run_api_tests.sh
index d6159b3..fd78af7 100755
--- a/traffic_ops/testing/api/docker/run_api_tests.sh
+++ b/traffic_ops/testing/api/docker/run_api_tests.sh
@@ -27,7 +27,7 @@ start() {
    export PATH=/usr/local/go/bin:/opt/traffic_ops/go/bin:$PATH
    export GOPATH=/go
    go get -u golang.org/x/net/publicsuffix golang.org/x/crypto/scrypt
-   TODB_HOSTNAME=db TODB_NAME=traffic_ops TO_URL=https://trafficops go test -v -cfg=../conf/traffic-ops-test.conf
+   go test -v -cfg=../conf/traffic-ops-test.conf
 }
 
 
diff --git a/traffic_ops/testing/api/docker/traffic-ops-test.env b/traffic_ops/testing/api/docker/traffic-ops-test.env
index bdd5c7b..7e46cd5 100644
--- a/traffic_ops/testing/api/docker/traffic-ops-test.env
+++ b/traffic_ops/testing/api/docker/traffic-ops-test.env
@@ -14,11 +14,16 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-TO_URL=https://localhost:8443
+TO_URL=https://trafficops
 TO_USER=admin
 TO_USER_PASSWORD=twelve
+
+# API Test Tool vars
+TODB_HOSTNAME=db
+TODB_NAME=traffic_ops
+
 SSL_INSECURE=true
-DB_NAME=traffic_ops
+DB_NAME=db
 DB_USER=traffic_ops
 DB_PASSWORD=twelve
 DB_PORT=5432