Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Support for codecov.io (#596)
Browse files Browse the repository at this point in the history
Fixes openshiftio/openshift.io#3559

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored and aslakknutsen committed May 15, 2018
1 parent f1e987f commit eb89f5a
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ $(eval COV_OUT_FILE := $(COV_DIR)/$(PACKAGE_NAME)/coverage.$(TEST_NAME).mode-$(C
-coverprofile $(COV_OUT_FILE) \
-coverpkg $(ALL_PKGS_COMMA_SEPARATED) \
-covermode=$(COVERAGE_MODE) \
-timeout 10m \
-timeout 30m \
$(EXTRA_TEST_PARAMS) \
|| echo $(PACKAGE_NAME) >> $(ERRORS_FILE)

Expand Down
5 changes: 5 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ required = [
"github.com/fabric8-services/fabric8-auth/design",
"github.com/jteeuwen/go-bindata/go-bindata",
"github.com/jstemmer/go-junit-report",
"github.com/wadey/gocovmerge",
]

ignored = [
Expand Down Expand Up @@ -95,6 +96,10 @@ ignored = [
name = "github.com/jstemmer/go-junit-report"
revision = "master"

[[constraint]]
name = "github.com/wadey/gocovmerge"
revision = "master"

[prune]
go-tests = true
unused-packages = true
41 changes: 13 additions & 28 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
## Service for initializing and updating the tenant services in fabric8/openshift.io
= Fabric8 Tenant Service

image:https://ci.centos.org/buildStatus/icon?job=devtools-fabric8-tenant-build-master[Jenkins,link="https://ci.centos.org/view/Devtools/job/devtools-fabric8-tenant-build-master/lastBuild/"]
image:https://goreportcard.com/badge/github.com/fabric8-services/fabric8-tenant[Go Report Card, link="https://goreportcard.com/report/github.com/fabric8-services/fabric8-tenant"]
image:https://godoc.org/github.com/fabric8-services/fabric8-tenant?status.png[GoDoc,link="https://godoc.org/github.com/fabric8-services/fabric8-tenant"]
image:https://codecov.io/gh/fabric8-services/fabric8-tenant/branch/master/graph/badge.svg[Codecov.io,link="https://codecov.io/gh/fabric8-services/fabric8-tenant"]


== Service for initializing and updating the tenant services in fabric8/openshift.io

The YAML for the tenant services is defined in the following projects:

* che : https://github.com/fabric8-services/fabric8-tenant-che
* jenkins : https://github.com/fabric8-services/fabric8-tenant-jenkins
* team : https://github.com/fabric8-services/fabric8-tenant-team

### Testing YAML
=== Testing YAML

When a PR is made on one of the above YAML repos you can test in production in your tenant via the following:

Expand All @@ -24,35 +32,12 @@ To go back to using the default YAML:
* click `Update Profile`
* now https://github.com/openshiftio/openshift.io/wiki/FAQ#how-do-i-update-my-tenant-[Update Tenant] and you should be back to the default versions

### Unit Testing Go
=== Unit Testing Go

Tips to running unit tests - this command seems to work on OS X:
Tips to running unit tests:

```
make clean && make && make deps && glide update && make test-unit
make clean && make deps && make test-unit-no-coverage
```


### Rapid development on Minikube / Minishift
If you run fabric8 in minikube or minishift then you can get rapid feedback of your code via the following:
* run the app using the `:dev` docker image label:
```
git clone https://github.com/fabric8io/fabric8-platform.git
cd fabric8-platform
cd apps/init-tenant
mvn fabric8:deploy -Pdev
```
* use the `kube-redeploy` make target whenever you want to create a new docker image and redeploy
```
make kube-redeploy
```
if the docker build fails you may need to type this first to point your local shell at the docker daemon inside minishift/minikube:
```
eval $(minishift docker-env)
```
2 changes: 1 addition & 1 deletion cico_build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ ! -f .cico-prepare ]; then
install_deps
prepare

run_tests_without_coverage
run_tests_with_coverage

touch .cico-prepare
fi
Expand Down
2 changes: 1 addition & 1 deletion cico_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

cico_setup;

run_tests_without_coverage;
run_tests_with_coverage;
2 changes: 1 addition & 1 deletion cico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function run_tests_with_coverage() {

# Upload coverage to codecov.io
cp tmp/coverage.mode* coverage.txt
bash <(curl -s https://codecov.io/bash) -X search -f coverage.txt -t ad12dad7-ebdc-47bc-a016-8c05fa7356bc #-X fix
bash <(curl -s https://codecov.io/bash) -X search -f coverage.txt -t fc7e9798-9ac2-4b06-af3e-c951fa579ed0 #-X fix

echo "CICO: ran tests and uploaded coverage"
}
Expand Down
38 changes: 38 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See http://docs.codecov.io/docs/coverage-configuration
coverage:
precision: 2 # 2 = xx.xx%, 0 = xx%
round: down
# For example: 20...60 would result in any coverage less than 20%
# would have a red background. The color would gradually change to
# green approaching 60%. Any coverage over 60% would result in a
# solid green color.
range: "20...60"

status:
# project will give us the diff in the total code coverage between a commit
# and its parent
project: yes
# Patch gives just the coverage of the patch
patch: yes
# changes tells us if there are unexpected code coverage changes in other files
# which were not changed by the diff
changes: yes

# See http://docs.codecov.io/docs/ignoring-paths
ignore:
- "*/bindata_assetfs.go"
- "vendor/*"
- "auth/client"
- "app/*"
- "client/*"
- "swagger/*"
- "tool/cli/*"
- "design/*"

# See http://docs.codecov.io/docs/pull-request-comments-1
comment:
layout: "header, diff, tree"
behavior: # defualt = posts once then update, posts new if delete
# once = post once then updates
# new = delete old, post new
# spammy = post new

0 comments on commit eb89f5a

Please sign in to comment.