From 5c1be3265b083d1df311d333f916c870e31e0fde Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Fri, 26 Aug 2022 01:48:36 +0000 Subject: [PATCH] e2e: Fix the token check to actually fail on expiration --- test/e2e/e2e_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index c82f5cf6..81ae3889 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -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))