You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2019/08/02 17:46:11 UTC

[trafficcontrol] branch dev-actions updated (fa51b09 -> 765cbe0)

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

ocket8888 pushed a change to branch dev-actions
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git.


    from fa51b09  Added experimental test workflow
     new 4b9b043  Added a GH action for running go tests
     new 765cbe0  Fixed workflow to use new action

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/main.workflow                              |  2 +-
 .../traffic_ops/golang/Dockerfile                  | 13 ++++++------
 .../NOTICE => test/traffic_ops/golang/README.md    |  9 +++++----
 test/traffic_ops/golang/entrypoint.sh              | 23 ++++++++++++++++++++++
 4 files changed, 35 insertions(+), 12 deletions(-)
 rename traffic_ops/app/bin/tests/Dockerfile-golangtest => test/traffic_ops/golang/Dockerfile (64%)
 copy vendor/gopkg.in/yaml.v2/NOTICE => test/traffic_ops/golang/README.md (63%)
 create mode 100644 test/traffic_ops/golang/entrypoint.sh


[trafficcontrol] 02/02: Fixed workflow to use new action

Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch dev-actions
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 765cbe059433c7cf746aa4e2734886c07bdd2de5
Author: ocket8888 <oc...@gmail.com>
AuthorDate: Fri Aug 2 11:45:54 2019 -0600

    Fixed workflow to use new action
---
 .github/main.workflow | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/main.workflow b/.github/main.workflow
index 785e9b1..11a6ebe 100644
--- a/.github/main.workflow
+++ b/.github/main.workflow
@@ -4,5 +4,5 @@ workflow "Daily Tests" {
 }
 
 action "Go Test" {
-  uses = "./traffic_ops/app/bin/tests/Dockerfile-golangtest"
+  uses = "./tests/traffic_ops/golang"
 }


[trafficcontrol] 01/02: Added a GH action for running go tests

Posted by oc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch dev-actions
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 4b9b0438067ea19fa4c396f321c59da2ddc6c6c5
Author: ocket8888 <oc...@gmail.com>
AuthorDate: Fri Aug 2 11:41:01 2019 -0600

    Added a GH action for running go tests
---
 .../traffic_ops/golang/Dockerfile                  | 13 ++++++------
 test/traffic_ops/golang/README.md                  | 14 +++++++++++++
 test/traffic_ops/golang/entrypoint.sh              | 23 ++++++++++++++++++++++
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/traffic_ops/app/bin/tests/Dockerfile-golangtest b/test/traffic_ops/golang/Dockerfile
similarity index 64%
rename from traffic_ops/app/bin/tests/Dockerfile-golangtest
rename to test/traffic_ops/golang/Dockerfile
index 8b4a925..153deb2 100644
--- a/traffic_ops/app/bin/tests/Dockerfile-golangtest
+++ b/test/traffic_ops/golang/Dockerfile
@@ -13,13 +13,12 @@
 #
 FROM golang:1.11
 MAINTAINER dev@trafficcontrol.apache.org
-ARG DIR=github.com/apache/trafficcontrol
 
-ADD traffic_ops /go/src/$DIR/traffic_ops
-ADD lib /go/src/$DIR/lib
+# ADD traffic_ops /go/src/github.com/apache/trafficcontrol/traffic_ops
+# ADD lib /go/src/github.com/apache/trafficcontrol/lib
+# WORKDIR /go/src/github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang
 
-WORKDIR /go/src/$DIR/traffic_ops/traffic_ops_golang
+ADD entrypoint.sh /
 
-CMD bash -c 'go get -v && go test -cover -v ./... ../../lib/go-tc/...'
-#
-# vi:syntax=Dockerfile
+# CMD bash -c 'go get -v && go test -cover -v ./... ../../lib/go-tc/...'
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/test/traffic_ops/golang/README.md b/test/traffic_ops/golang/README.md
new file mode 100644
index 0000000..9f81ae5
--- /dev/null
+++ b/test/traffic_ops/golang/README.md
@@ -0,0 +1,14 @@
+<!-- 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. -->
+
+# Traffic Ops Go Tests
+This Dockerfile is responsible for importing the repository's Traffic Ops Go code and running unit tests and coverage tests.
diff --git a/test/traffic_ops/golang/entrypoint.sh b/test/traffic_ops/golang/entrypoint.sh
new file mode 100644
index 0000000..46309b0
--- /dev/null
+++ b/test/traffic_ops/golang/entrypoint.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+pushd traffic_ops/traffic_ops_golang
+
+if [ ! $(go get -v) ]; then
+	echo "Failed to get dependencies; bailing" >&2
+	exit 1
+fi
+
+if [ ! $(go test -cover -v ./...)]; then
+	echo "TO tests failed" >&2
+	exit 1
+fi
+
+popd
+pushd lib/go-tc
+
+if [ ! $(go test -cover -v ../../)]; then
+	echo "Library tests failed" >&2
+	exit 1
+fi
+
+popd