Commit 9364595f authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

Merge branch '88-job-failed-246137' into 'develop'

Resolve "Job Failed #246137"

See merge request cocsn/gosdn!124
parents f748a699 607b7a98
FROM golang:1.15-alpine AS builder
FROM golang:1.15-buster AS builder
ARG GITLAB_USER
ARG GITLAB_TOKEN
ARG BUILDARGS
WORKDIR /src/gosdn
COPY . .
RUN apk add git
RUN apt-get update && apt-get install -y git
RUN git config --global url."https://$GITLAB_USER:$GITLAB_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
RUN CGO_ENABLED=0 GOOS=linux go build $BUILDARGS ./cmd/gosdn
RUN GOOS=linux go build $BUILDARGS ./cmd/gosdn
FROM alpine:latest
EXPOSE 8080
......
......@@ -263,6 +263,7 @@ func TestGnmi_SubscribeIntegration(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var wantErr = tt.wantErr
g, err := NewGnmiTransport(tt.fields.opt)
if err != nil {
t.Error(err)
......@@ -271,10 +272,10 @@ func TestGnmi_SubscribeIntegration(t *testing.T) {
ctx := context.WithValue(context.Background(), CtxKeyOpts, tt.args.opts) //nolint
ctx, cancel := context.WithCancel(ctx)
go func() {
err = g.Subscribe(ctx)
if (err != nil) != tt.wantErr {
if !tt.wantErr {
if err.Error() != "rpc error: code = Canceled desc = context canceled" {
subErr := g.Subscribe(ctx)
if (subErr != nil) != wantErr {
if !wantErr && subErr != nil {
if subErr.Error() != "rpc error: code = Canceled desc = context canceled" {
t.Errorf("Subscribe() error = %v, wantErr %v", err, tt.wantErr)
}
}
......
......@@ -33,7 +33,7 @@ func (s store) add(item Storable) error {
log.WithFields(log.Fields{
"type": reflect.TypeOf(item),
"uuid": item.ID(),
}).Info("storable was added")
}).Debug("storable was added")
return nil
}
......@@ -43,7 +43,7 @@ func (s store) get(id uuid.UUID) (Storable, error) {
}
log.WithFields(log.Fields{
"uuid": id,
}).Info("storable was accessed")
}).Debug("storable was accessed")
storeLock.RLock()
defer storeLock.RUnlock()
return s[id], nil
......@@ -58,7 +58,7 @@ func (s store) delete(id uuid.UUID) error {
storeLock.Unlock()
log.WithFields(log.Fields{
"uuid": id,
}).Info("storable has been deleted")
}).Debug("storable was deleted")
return nil
}
......@@ -92,7 +92,7 @@ func (s sbiStore) get(id uuid.UUID) (SouthboundInterface, error) {
}
log.WithFields(log.Fields{
"uuid": id,
}).Info("southbound interface was accessed")
}).Debug("southbound interface was accessed")
return sbi, nil
}
......@@ -114,7 +114,7 @@ func (s pndStore) get(id uuid.UUID) (PrincipalNetworkDomain, error) {
}
log.WithFields(log.Fields{
"uuid": id,
}).Info("principal network domain was accessed")
}).Debug("principal network domain was accessed")
return pnd, nil
}
......@@ -136,6 +136,6 @@ func (s deviceStore) get(id uuid.UUID) (*Device, error) {
}
log.WithFields(log.Fields{
"uuid": id,
}).Info("device was accessed")
}).Debug("device was accessed")
return device, 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