Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b27fe7f4
Unverified
Commit
b27fe7f4
authored
May 09, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 09, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74314 from oomichi/add-ExpectError
Add ExpectError() to e2e test framework
parents
e45f92fc
43654448
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
util.go
test/e2e/framework/util.go
+5
-0
provisioning.go
test/e2e/storage/testsuites/provisioning.go
+1
-1
No files found.
test/e2e/framework/util.go
View file @
b27fe7f4
...
@@ -2039,6 +2039,11 @@ func RandomSuffix() string {
...
@@ -2039,6 +2039,11 @@ func RandomSuffix() string {
return
strconv
.
Itoa
(
r
.
Int
()
%
10000
)
return
strconv
.
Itoa
(
r
.
Int
()
%
10000
)
}
}
// ExpectError expects an error happens, otherwise an exception raises
func
ExpectError
(
err
error
,
explain
...
interface
{})
{
gomega
.
Expect
(
err
)
.
To
(
gomega
.
HaveOccurred
(),
explain
...
)
}
// ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
// ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func
ExpectNoError
(
err
error
,
explain
...
interface
{})
{
func
ExpectNoError
(
err
error
,
explain
...
interface
{})
{
ExpectNoErrorWithOffset
(
1
,
err
,
explain
...
)
ExpectNoErrorWithOffset
(
1
,
err
,
explain
...
)
...
...
test/e2e/storage/testsuites/provisioning.go
View file @
b27fe7f4
...
@@ -483,7 +483,7 @@ func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(claims []*v1.P
...
@@ -483,7 +483,7 @@ func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(claims []*v1.P
// Wait for ClaimProvisionTimeout (across all PVCs in parallel) and make sure the phase did not become Bound i.e. the Wait errors out
// Wait for ClaimProvisionTimeout (across all PVCs in parallel) and make sure the phase did not become Bound i.e. the Wait errors out
By
(
"checking the claims are in pending state"
)
By
(
"checking the claims are in pending state"
)
err
=
framework
.
WaitForPersistentVolumeClaimsPhase
(
v1
.
ClaimBound
,
t
.
Client
,
namespace
,
claimNames
,
2
*
time
.
Second
/* Poll */
,
framework
.
ClaimProvisionShortTimeout
,
true
)
err
=
framework
.
WaitForPersistentVolumeClaimsPhase
(
v1
.
ClaimBound
,
t
.
Client
,
namespace
,
claimNames
,
2
*
time
.
Second
/* Poll */
,
framework
.
ClaimProvisionShortTimeout
,
true
)
Expect
(
err
)
.
To
(
HaveOccurred
()
)
framework
.
ExpectError
(
err
)
verifyPVCsPending
(
t
.
Client
,
createdClaims
)
verifyPVCsPending
(
t
.
Client
,
createdClaims
)
By
(
"creating a pod referring to the claims"
)
By
(
"creating a pod referring to the claims"
)
...
...
Write
Preview
Markdown
is supported
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