You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2019/01/30 18:04:24 UTC

[trafficcontrol] branch master updated: Add Monitor unit test Dockerfile (#3263)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 96729f2  Add Monitor unit test Dockerfile (#3263)
96729f2 is described below

commit 96729f2d7001acb4c2cb9fbf5eb2c8057254d29b
Author: Robert Butts <ro...@users.noreply.github.com>
AuthorDate: Wed Jan 30 11:04:19 2019 -0700

    Add Monitor unit test Dockerfile (#3263)
---
 traffic_monitor/tests/Dockerfile-golangtest | 28 ++++++++++++++++++++++++++
 traffic_monitor/tests/docker-compose.yml    | 31 +++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/traffic_monitor/tests/Dockerfile-golangtest b/traffic_monitor/tests/Dockerfile-golangtest
new file mode 100644
index 0000000..a55e664
--- /dev/null
+++ b/traffic_monitor/tests/Dockerfile-golangtest
@@ -0,0 +1,28 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+FROM golang:1.9.4
+ARG DIR=github.com/apache/trafficcontrol
+
+ADD traffic_monitor /go/src/$DIR/traffic_monitor
+ADD traffic_ops /go/src/$DIR/traffic_ops
+ADD lib /go/src/$DIR/lib
+VOLUME ["/junit"]
+
+WORKDIR /go/src/$DIR/traffic_monitor
+
+RUN bash -c "go get -u github.com/jstemmer/go-junit-report"
+RUN bash -c "go get -v"
+CMD bash -c 'go test -v ./... ../lib/go-tc/... 2>&1 | go-junit-report --package-name=golang.test.tm --set-exit-code > /junit/golang.test.tm.xml && chmod 777 -R /junit && cat /junit/golang.test.tm.xml'
+#
+# vi:syntax=Dockerfile
diff --git a/traffic_monitor/tests/docker-compose.yml b/traffic_monitor/tests/docker-compose.yml
new file mode 100644
index 0000000..973c5b8
--- /dev/null
+++ b/traffic_monitor/tests/docker-compose.yml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+---
+version: '2'
+
+volumes:
+  junit:
+  traffic_monitor:
+
+services:
+  unit_monitor:
+    build:
+      context: ../..
+      dockerfile: traffic_monitor/tests/Dockerfile-golangtest
+    volumes:
+      - traffic_monitor:/traffic_monitor
+      - ../../junit:/junit