improve test resiliency
This commit is contained in:
parent
852bc00354
commit
1fb12a98ea
1 changed files with 10 additions and 4 deletions
|
|
@ -123,6 +123,7 @@ func TestListRun(t *testing.T) {
|
|||
wantErr bool
|
||||
wantOut string
|
||||
wantErrOut string
|
||||
wantErrMsg string
|
||||
stubs func(*httpmock.Registry)
|
||||
isTTY bool
|
||||
}{
|
||||
|
|
@ -343,7 +344,8 @@ func TestListRun(t *testing.T) {
|
|||
httpmock.JSONResponse(shared.RunsPayload{}),
|
||||
)
|
||||
},
|
||||
wantErr: true,
|
||||
wantErr: true,
|
||||
wantErrMsg: "no runs found",
|
||||
},
|
||||
{
|
||||
name: "workflow selector",
|
||||
|
|
@ -384,7 +386,8 @@ func TestListRun(t *testing.T) {
|
|||
httpmock.JSONResponse(shared.RunsPayload{}),
|
||||
)
|
||||
},
|
||||
wantErr: true,
|
||||
wantErr: true,
|
||||
wantErrMsg: "no runs found",
|
||||
},
|
||||
{
|
||||
name: "actor filter applied",
|
||||
|
|
@ -400,7 +403,8 @@ func TestListRun(t *testing.T) {
|
|||
httpmock.JSONResponse(shared.RunsPayload{}),
|
||||
)
|
||||
},
|
||||
wantErr: true,
|
||||
wantErr: true,
|
||||
wantErrMsg: "no runs found",
|
||||
},
|
||||
{
|
||||
name: "status filter applied",
|
||||
|
|
@ -417,7 +421,8 @@ func TestListRun(t *testing.T) {
|
|||
httpmock.JSONResponse(shared.RunsPayload{}),
|
||||
)
|
||||
},
|
||||
wantErr: true,
|
||||
wantErr: true,
|
||||
wantErrMsg: "no runs found",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -441,6 +446,7 @@ func TestListRun(t *testing.T) {
|
|||
err := listRun(tt.opts)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, tt.wantErrMsg, err.Error())
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue