[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2020-01-03 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r362965121
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+
+coverage_out=()
+i=1
+
+for d in $(go list ./... ../lib/... | grep -v vendor); do
+   file="$i.out"
+   go test -v -coverprofile="$file" "$d"
+   if [ -f "$file" ]; then
+   coverage_out+=($file)
+   fi
+   ((i++))
+done
+
+gocovmerge ${coverage_out[*]} > coverage.out
+go tool cover -func=coverage.out
+go-junit-report --package-name=golang.test.tm --set-exit-code > 
/junit/golang.test.tm.xml
+touch coverage_out1
+for pkg in $(go list ./... ../lib/... | grep -v ); do
+   tmp="$(mktemp)"
+   go test -v -coverprofile covProfile "$pkg" > "$tmp"
+   mv -f "$tmp" coverage_out1
+done
 
 Review comment:
   @ocket i better leave it to you. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-11-22 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r349688465
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+go get "github.com/wadey/gocovmerge"
+touch result.txt
+packages=( "$@" )
+coverage_out=()
+i=1
+for pkg in ${packages[@]} ; do
+for d in $(go list $pkg | grep -v vendor); do
+file="$i.out"
+go test -v -coverprofile=$file $d | tee -a result.txt
+cat result.txt
+if [ -f $file ]; then
+coverage_out+=( $file )
+fi
+((i++))
 
 Review comment:
   gocovermerge doesn't do merge incrementally or from results appended in one 
file. I tried them first and then got down to what is there now.  


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-11-22 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r349665712
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+go get "github.com/wadey/gocovmerge"
+touch result.txt
+packages=( "$@" )
+coverage_out=()
+i=1
+for pkg in ${packages[@]} ; do
+for d in $(go list $pkg | grep -v vendor); do
+file="$i.out"
+go test -v -coverprofile=$file $d | tee -a result.txt
+cat result.txt
+if [ -f $file ]; then
+coverage_out+=( $file )
+fi
+((i++))
 
 Review comment:
   nope it didn't work


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-08-15 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r314379439
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+go get "github.com/wadey/gocovmerge"
+echo "" > result.txt
+packages=( "$@" )
+coverage_out=()
+i=1
+for pkg in ${packages[@]} ; do
+for d in $(go list $pkg | grep -v vendor); do
+file="$i.out"
+go test -v -coverprofile=$file $d >> result.txt
+cat result.txt
+if [ -f $file ]; then
+coverage_out+=( $file )
+fi
+((i++))
+done
+done 
+gocovmerge ${coverage_out[*]} > coverage.out
+go tool cover -func=coverage.out
+cat result.txt | 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
 
 Review comment:
   I just moved the command that was already in there. may be this question was 
missed in previous review/approval when that statement made to master


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-08-15 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r314378734
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+go get "github.com/wadey/gocovmerge"
+echo "" > result.txt
 
 Review comment:
   followed how things were already in there. THought it was a special 
requirement for doing things in open source way!! 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-08-15 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r314377876
 
 

 ##
 File path: traffic_monitor/tests/gocover.bash
 ##
 @@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# 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.
+
+#
+set -e
+go get "github.com/wadey/gocovmerge"
 
 Review comment:
   I might need some enlightenment here 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [trafficcontrol] lbathina commented on a change in pull request #3768: Codecov

2019-08-05 Thread GitBox
lbathina commented on a change in pull request #3768: Codecov
URL: https://github.com/apache/trafficcontrol/pull/3768#discussion_r310676692
 
 

 ##
 File path: traffic_monitor/tests/Dockerfile-golangtest
 ##
 @@ -23,6 +23,6 @@ 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'
-#
+CMD bash -c 'go test -coverprofile=tmcoverage.out -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'
+CMD bash -c 'go tool cover -func=tmcoverage.out'
 
 Review comment:
   my bad. Yes that's right. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services