Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
b18afc9e
Unverified
Commit
b18afc9e
authored
5 years ago
by
catsby
Browse files
Options
Download
Email Patches
Plain Diff
snapshot
parent
6f55b4c2
Branches unavailable
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/go.mod
+5
-5
api/go.mod
api/go.sum
+515
-0
api/go.sum
sdk/testing/stepwise/testing.go
+9
-15
sdk/testing/stepwise/testing.go
with
529 additions
and
20 deletions
+529
-20
api/go.mod
+
5
-
5
View file @
b18afc9e
...
...
@@ -5,16 +5,16 @@ go 1.13
replace github.com/hashicorp/vault/sdk => ../sdk
require (
github.com/go-test/deep v1.0.2
-0.20181118220953-042da051cf31
github.com/go-test/deep v1.0.2
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/go-retryablehttp v0.6.2
github.com/hashicorp/go-rootcerts v1.0.
1
github.com/hashicorp/go-rootcerts v1.0.
2
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/vault/sdk v0.1.14-0.20200
215195600-2ca765f0a500
github.com/hashicorp/vault/sdk v0.1.14-0.20200
429182704-29fce8f27ce4
github.com/mitchellh/mapstructure v1.1.2
golang.org/x/net v0.0.0-20
190813141303-74dc4d7220e7
golang.org/x/net v0.0.0-20
200114155413-6afb5195e5aa
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
gopkg.in/square/go-jose.v2 v2.
3
.1
gopkg.in/square/go-jose.v2 v2.
4
.1
)
This diff is collapsed.
Click to expand it.
api/go.sum
+
515
-
0
View file @
b18afc9e
This diff is collapsed.
Click to expand it.
sdk/testing/stepwise/testing.go
+
9
-
15
View file @
b18afc9e
...
...
@@ -310,21 +310,15 @@ func Run(tt TestT, c Case) {
// or not. Set the err to nil. If the error is a logical.ErrorResponse,
// it will be handled later.
if
s
.
ErrorOk
{
// err = nil
q
.
Q
(
"===> error ok, setting to nil"
)
err
=
nil
}
else
{
// // If the error is not expected, fail right away.
//
tt.Error(fmt.Sprintf("Failed step %d: %s", i+1, err))
//
break
tt
.
Error
(
fmt
.
Sprintf
(
"Failed step %d: %s"
,
i
+
1
,
err
))
break
}
}
// If the error is a 'logical.ErrorResponse' and if error was not expected,
// set the error so that this can be caught below.
// TODO resp error check
// if resp.IsError() && !s.ErrorOk {
// err = fmt.Errorf("erroneous response:\n\n%#v", resp)
// }
// TODO
// - test check func here
//
...
...
@@ -335,11 +329,11 @@ func Run(tt TestT, c Case) {
// TODO: This works perfectly for now, but it would be better if 'Check'
// function takes in both the response object and the error, and decide on
// the action on its own.
//
if err == nil && s.Check != nil {
//
// Call the test method
//
// TODO check here
// //
err = s.Check(resp)
//
}
if
err
==
nil
&&
s
.
Check
!=
nil
{
// Call the test method
// TODO check here
err
=
s
.
Check
(
resp
)
}
if
err
!=
nil
{
tt
.
Error
(
fmt
.
Sprintf
(
"Failed step %d: %s"
,
i
+
1
,
err
))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help