e2e: Fix the token check to actually fail on expiration
This commit is contained in:
parent
ebcd838501
commit
5c1be3265b
|
|
@ -557,9 +557,9 @@ func (e *env) checkGitHubToken(t *testing.T, tok string) error {
|
||||||
c := github.NewClient(&http.Client{Transport: transport})
|
c := github.NewClient(&http.Client{Transport: transport})
|
||||||
aa, res, err := c.Octocat(context.Background(), "hello")
|
aa, res, err := c.Octocat(context.Background(), "hello")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b, err := io.ReadAll(res.Body)
|
b, ioerr := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if ioerr != nil {
|
||||||
t.Logf("%v", err)
|
t.Logf("%v", ioerr)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
t.Logf(string(b))
|
t.Logf(string(b))
|
||||||
|
|
@ -569,9 +569,9 @@ func (e *env) checkGitHubToken(t *testing.T, tok string) error {
|
||||||
t.Logf("%s", aa)
|
t.Logf("%s", aa)
|
||||||
|
|
||||||
if _, res, err := c.Actions.CreateRegistrationToken(ctx, e.testOrg, e.testOrgRepo); err != nil {
|
if _, res, err := c.Actions.CreateRegistrationToken(ctx, e.testOrg, e.testOrgRepo); err != nil {
|
||||||
b, err := io.ReadAll(res.Body)
|
b, ioerr := io.ReadAll(res.Body)
|
||||||
if err != nil {
|
if ioerr != nil {
|
||||||
t.Logf("%v", err)
|
t.Logf("%v", ioerr)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
t.Logf(string(b))
|
t.Logf(string(b))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue