Skip to content
Snippets Groups Projects
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
Branches
Tags
2 merge requests!124Resolve "Job Failed #246137",!90Develop
Pipeline #67427 failed
FROM golang:1.15-alpine AS builder FROM golang:1.15-buster AS builder
ARG GITLAB_USER ARG GITLAB_USER
ARG GITLAB_TOKEN ARG GITLAB_TOKEN
ARG BUILDARGS ARG BUILDARGS
WORKDIR /src/gosdn WORKDIR /src/gosdn
COPY . . 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 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 FROM alpine:latest
EXPOSE 8080 EXPOSE 8080
......
...@@ -263,6 +263,7 @@ func TestGnmi_SubscribeIntegration(t *testing.T) { ...@@ -263,6 +263,7 @@ func TestGnmi_SubscribeIntegration(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
var wantErr = tt.wantErr
g, err := NewGnmiTransport(tt.fields.opt) g, err := NewGnmiTransport(tt.fields.opt)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
...@@ -271,10 +272,10 @@ func TestGnmi_SubscribeIntegration(t *testing.T) { ...@@ -271,10 +272,10 @@ func TestGnmi_SubscribeIntegration(t *testing.T) {
ctx := context.WithValue(context.Background(), CtxKeyOpts, tt.args.opts) //nolint ctx := context.WithValue(context.Background(), CtxKeyOpts, tt.args.opts) //nolint
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
go func() { go func() {
err = g.Subscribe(ctx) subErr := g.Subscribe(ctx)
if (err != nil) != tt.wantErr { if (subErr != nil) != wantErr {
if !tt.wantErr { if !wantErr && subErr != nil {
if err.Error() != "rpc error: code = Canceled desc = context canceled" { if subErr.Error() != "rpc error: code = Canceled desc = context canceled" {
t.Errorf("Subscribe() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("Subscribe() error = %v, wantErr %v", err, tt.wantErr)
} }
} }
......
...@@ -33,7 +33,7 @@ func (s store) add(item Storable) error { ...@@ -33,7 +33,7 @@ func (s store) add(item Storable) error {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"type": reflect.TypeOf(item), "type": reflect.TypeOf(item),
"uuid": item.ID(), "uuid": item.ID(),
}).Info("storable was added") }).Debug("storable was added")
return nil return nil
} }
...@@ -43,7 +43,7 @@ func (s store) get(id uuid.UUID) (Storable, error) { ...@@ -43,7 +43,7 @@ func (s store) get(id uuid.UUID) (Storable, error) {
} }
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"uuid": id, "uuid": id,
}).Info("storable was accessed") }).Debug("storable was accessed")
storeLock.RLock() storeLock.RLock()
defer storeLock.RUnlock() defer storeLock.RUnlock()
return s[id], nil return s[id], nil
...@@ -58,7 +58,7 @@ func (s store) delete(id uuid.UUID) error { ...@@ -58,7 +58,7 @@ func (s store) delete(id uuid.UUID) error {
storeLock.Unlock() storeLock.Unlock()
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"uuid": id, "uuid": id,
}).Info("storable has been deleted") }).Debug("storable was deleted")
return nil return nil
} }
...@@ -92,7 +92,7 @@ func (s sbiStore) get(id uuid.UUID) (SouthboundInterface, error) { ...@@ -92,7 +92,7 @@ func (s sbiStore) get(id uuid.UUID) (SouthboundInterface, error) {
} }
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"uuid": id, "uuid": id,
}).Info("southbound interface was accessed") }).Debug("southbound interface was accessed")
return sbi, nil return sbi, nil
} }
...@@ -114,7 +114,7 @@ func (s pndStore) get(id uuid.UUID) (PrincipalNetworkDomain, error) { ...@@ -114,7 +114,7 @@ func (s pndStore) get(id uuid.UUID) (PrincipalNetworkDomain, error) {
} }
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"uuid": id, "uuid": id,
}).Info("principal network domain was accessed") }).Debug("principal network domain was accessed")
return pnd, nil return pnd, nil
} }
...@@ -136,6 +136,6 @@ func (s deviceStore) get(id uuid.UUID) (*Device, error) { ...@@ -136,6 +136,6 @@ func (s deviceStore) get(id uuid.UUID) (*Device, error) {
} }
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"uuid": id, "uuid": id,
}).Info("device was accessed") }).Debug("device was accessed")
return device, nil return device, nil
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment