Merge pull request #609 from yhua123/master

for shown go test coverage tag
This commit is contained in:
Daniel Jiang 2016-07-29 18:54:01 +08:00 committed by GitHub
commit bede27714f
24 changed files with 206 additions and 3 deletions

View File

@ -27,6 +27,7 @@ env:
DOCKER_COMPOSE_VERSION: 1.7.1 DOCKER_COMPOSE_VERSION: 1.7.1
HARBOR_ADMIN: admin HARBOR_ADMIN: admin
HARBOR_ADMIN_PASSWD: Harbor12345 HARBOR_ADMIN_PASSWD: Harbor12345
UI_SECRET: tempString
before_install: before_install:
- sudo ./tests/hostcfg.sh - sudo ./tests/hostcfg.sh
@ -68,9 +69,9 @@ before_script:
- mysql < ./Deploy/db/registry.sql -uroot --verbose - mysql < ./Deploy/db/registry.sql -uroot --verbose
script: script:
- go list ./... | grep -v 'tests' | grep -v /vendor/ | xargs -L1 fgt golint - go list ./... | grep -v -E 'vendor|tests' | xargs -L1 fgt golint
- go list ./... | grep -v 'tests' | grep -v 'vendor' | xargs -L1 go vet - go list ./... | grep -v -E 'vendor|tests' | xargs -L1 go vet
- go list ./... | grep -v 'tests' | grep -v 'vendor' | xargs -L1 go test -v - ./Deploy/coverage4gotest.sh
- docker-compose -f Deploy/docker-compose.yml up -d - docker-compose -f Deploy/docker-compose.yml up -d

12
Deploy/coverage4gotest.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
echo "mode: set" >>profile.cov
for dir in $(go list ./... | grep -v -E 'vendor|tests')
do
go test -cover -coverprofile=profile.tmp $dir
if [ -f profile.tmp ]
then
cat profile.tmp | tail -n +2 >> profile.cov
rm profile.tmp
fi
done

View File

@ -1,6 +1,7 @@
# Harbor # Harbor
[![Build Status](https://travis-ci.org/vmware/harbor.svg?branch=master)](https://travis-ci.org/vmware/harbor) [![Build Status](https://travis-ci.org/vmware/harbor.svg?branch=master)](https://travis-ci.org/vmware/harbor)
[![Coverage Status](https://coveralls.io/repos/github/vmware/harbor/badge.svg?branch=master)](https://coveralls.io/github/vmware/harbor?branch=master)
![alg tag](https://cloud.githubusercontent.com/assets/2390463/13484557/088a1000-e13a-11e5-87d4-a64366365bef.png) ![alg tag](https://cloud.githubusercontent.com/assets/2390463/13484557/088a1000-e13a-11e5-87d4-a64366365bef.png)

9
api/api_test.go Normal file
View File

@ -0,0 +1,9 @@
package api
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
api/jobs/job_test.go Normal file
View File

@ -0,0 +1,9 @@
package api
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
auth/auth_test.go Normal file
View File

@ -0,0 +1,9 @@
package auth
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
auth/db/db_test.go Normal file
View File

@ -0,0 +1,9 @@
package db
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
auth/ldap/ldap_test.go Normal file
View File

@ -0,0 +1,9 @@
package ldap
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package controllers
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package config
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
job/job_test.go Normal file
View File

@ -0,0 +1,9 @@
package job
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package replication
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
job/utils/utils_test.go Normal file
View File

@ -0,0 +1,9 @@
package utils
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package main
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
models/models_test.go Normal file
View File

@ -0,0 +1,9 @@
package models
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
service/cache/cache_test.go vendored Normal file
View File

@ -0,0 +1,9 @@
package cache
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
service/service_test.go Normal file
View File

@ -0,0 +1,9 @@
package service
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package token
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package utils
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
ui/ui_test.go Normal file
View File

@ -0,0 +1,9 @@
package main
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
utils/log/log_test.go Normal file
View File

@ -0,0 +1,9 @@
package log
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package auth
import (
"testing"
)
func TestMain(t *testing.T) {
}

View File

@ -0,0 +1,9 @@
package error
import (
"testing"
)
func TestMain(t *testing.T) {
}

9
utils/utils_test.go Normal file
View File

@ -0,0 +1,9 @@
package utils
import (
"testing"
)
func TestMain(t *testing.T) {
}