Commit 53e0febc authored by Stefan Dähling's avatar Stefan Dähling
Browse files

add test to ci

parent 4ee4613a
Pipeline #409933 passed with stages
in 4 minutes and 14 seconds
stages:
- build
# - test
- test
- deploy
build:
......@@ -24,6 +24,14 @@ build:
- cd ../kubestub
- CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o kubestub
test:
stage: test
image: golang:1.13.8
script:
- cd pkg
- go test ./... -coverprofile cover.out
- go tool cover -func cover.out
deploy:
stage: deploy
image: docker:19.03.12
......
......@@ -45,14 +45,17 @@ THE SOFTWARE.
package ams
import (
"log"
"net/http"
"os"
"strconv"
"testing"
"time"
agclient "git.rwth-aachen.de/acs/public/cloud/mas/clonemap/pkg/agency/client"
amscli "git.rwth-aachen.de/acs/public/cloud/mas/clonemap/pkg/ams/client"
"git.rwth-aachen.de/acs/public/cloud/mas/clonemap/pkg/common/httpreply"
dfclient "git.rwth-aachen.de/acs/public/cloud/mas/clonemap/pkg/df/client"
"git.rwth-aachen.de/acs/public/cloud/mas/clonemap/pkg/schemas"
)
......@@ -64,7 +67,11 @@ func TestAMS(t *testing.T) {
os.Setenv("CLONEMAP_STORAGE_TYPE", "local")
os.Setenv("CLONEMAP_STUB_HOSTNAME", "localhost")
os.Setenv("CLONEMAP_LOG_LEVEL", "error")
ams := &AMS{}
ams := &AMS{
logError: log.New(os.Stderr, "[ERROR] ", log.LstdFlags),
agencyClient: agclient.New(time.Second*60, time.Second*1, 4),
dfClient: dfclient.New(time.Second*60, time.Second*1, 4),
}
// create storage and deployment object according to specified deployment type
err := ams.init()
if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment