diff options
author | Michael Muré <batolettre@gmail.com> | 2022-12-22 23:53:13 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-12-22 23:53:13 +0100 |
commit | 108518530e822e3bdf59c8bfc333ad0bbe2d5fc8 (patch) | |
tree | fc8a7a5c02fc3bf811978e75c1a974479797b295 /bridge/github | |
parent | 02510cb197993b9f5c6acec431f1432cd02341f1 (diff) | |
download | git-bug-108518530e822e3bdf59c8bfc333ad0bbe2d5fc8.tar.gz |
github: cleanup test token when test is done
Diffstat (limited to 'bridge/github')
-rw-r--r-- | bridge/github/export_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go index 2ebe9622..b7511a3d 100644 --- a/bridge/github/export_test.go +++ b/bridge/github/export_test.go @@ -158,11 +158,18 @@ func TestGithubPushPull(t *testing.T) { defer backend.Close() interrupt.RegisterCleaner(backend.Close) + // Setup token + cleanup token := auth.NewToken(target, envToken) token.SetMetadata(auth.MetaKeyLogin, login) err = auth.Store(repo, token) require.NoError(t, err) + cleanToken := func() error { + return auth.Remove(repo, token.ID()) + } + defer cleanToken() + interrupt.RegisterCleaner(cleanToken) + tests := testCases(t, backend) // generate project name |