Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
2c9d4857
Commit
2c9d4857
authored
3 years ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
workaround for false output of passing getUser test
parent
b7ed7f6e
No related branches found
No related tags found
1 merge request
!287
Implement data persisting for user management
Pipeline
#100062
passed
3 years ago
Stage: build
Stage: test
Stage: analyze
Stage: integration-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/northbound/server/auth_test.go
+16
-0
16 additions, 0 deletions
controller/northbound/server/auth_test.go
with
16 additions
and
0 deletions
controller/northbound/server/auth_test.go
+
16
−
0
View file @
2c9d4857
package
server
import
(
"bytes"
"context"
"log"
"reflect"
"testing"
...
...
@@ -150,6 +152,7 @@ func TestAuth_CreateUsers(t *testing.T) {
}
func
TestAuth_GetUser
(
t
*
testing
.
T
)
{
patchLogger
(
t
)
type
args
struct
{
ctx
context
.
Context
request
*
apb
.
GetUserRequest
...
...
@@ -829,3 +832,16 @@ func createTestRoles() error {
return
nil
}
func
patchLogger
(
t
*
testing
.
T
)
{
orig
:=
log
.
Writer
()
buf
:=
new
(
bytes
.
Buffer
)
log
.
SetOutput
(
buf
)
t
.
Cleanup
(
func
()
{
// optionally check t.Failed here if you only want to print logs on failure
t
.
Log
(
buf
.
String
())
log
.
SetOutput
(
orig
)
})
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment