aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-22 23:53:13 +0100
committerMichael Muré <batolettre@gmail.com>2022-12-22 23:53:13 +0100
commit108518530e822e3bdf59c8bfc333ad0bbe2d5fc8 (patch)
treefc8a7a5c02fc3bf811978e75c1a974479797b295 /bridge/github
parent02510cb197993b9f5c6acec431f1432cd02341f1 (diff)
downloadgit-bug-108518530e822e3bdf59c8bfc333ad0bbe2d5fc8.tar.gz
github: cleanup test token when test is done
Diffstat (limited to 'bridge/github')
-rw-r--r--bridge/github/export_test.go7
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