e2e: Fix the token check to actually fail on expiration

This commit is contained in:
Yusuke Kuoka 2022-08-26 01:48:36 +00:00
parent ebcd838501
commit 5c1be3265b
1 changed files with 6 additions and 6 deletions

View File

@ -557,9 +557,9 @@ func (e *env) checkGitHubToken(t *testing.T, tok string) error {
c := github.NewClient(&http.Client{Transport: transport})
aa, res, err := c.Octocat(context.Background(), "hello")
if err != nil {
b, err := io.ReadAll(res.Body)
if err != nil {
t.Logf("%v", err)
b, ioerr := io.ReadAll(res.Body)
if ioerr != nil {
t.Logf("%v", ioerr)
return err
}
t.Logf(string(b))
@ -569,9 +569,9 @@ func (e *env) checkGitHubToken(t *testing.T, tok string) error {
t.Logf("%s", aa)
if _, res, err := c.Actions.CreateRegistrationToken(ctx, e.testOrg, e.testOrgRepo); err != nil {
b, err := io.ReadAll(res.Body)
if err != nil {
t.Logf("%v", err)
b, ioerr := io.ReadAll(res.Body)
if ioerr != nil {
t.Logf("%v", ioerr)
return err
}
t.Logf(string(b))