aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/export_test.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-06-21 01:09:05 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-06-24 21:29:37 +0200
commit1d42814166f783766a1b81e926c93c21244289dc (patch)
tree77379dba611bdfda5dea35d4974489716e40f63c /bridge/github/export_test.go
parenta121991f556f5b2a362d769b9304956bcedb3805 (diff)
downloadgit-bug-1d42814166f783766a1b81e926c93c21244289dc.tar.gz
[bridge/github] cache user token
fix import typo init tests verify issue
Diffstat (limited to 'bridge/github/export_test.go')
-rw-r--r--bridge/github/export_test.go67
1 files changed, 66 insertions, 1 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go
index 710b798c..c3a835b2 100644
--- a/bridge/github/export_test.go
+++ b/bridge/github/export_test.go
@@ -1,7 +1,72 @@
package github
-import "testing"
+import (
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "github.com/MichaelMure/git-bug/bridge/core"
+ "github.com/MichaelMure/git-bug/cache"
+ "github.com/MichaelMure/git-bug/repository"
+ "github.com/MichaelMure/git-bug/util/interrupt"
+ "github.com/stretchr/testify/require"
+)
func TestExporter(t *testing.T) {
//TODO test strategy
+ tests := []struct {
+ name string
+ }{
+ {
+ name: "bug creation",
+ },
+ }
+
+ repo := repository.CreateTestRepo(false)
+ defer repository.CleanupTestRepos(t, repo)
+
+ backend, err := cache.NewRepoCache(repo)
+ require.NoError(t, err)
+
+ defer backend.Close()
+ interrupt.RegisterCleaner(backend.Close)
+
+ token := os.Getenv("GITHUB_TOKEN_PRIVATE")
+ if token == "" {
+ t.Skip("Env var GITHUB_TOKEN_PRIVATE missing")
+ }
+
+ exporter := &githubExporter{}
+ err = exporter.Init(core.Configuration{
+ keyOwner: "MichaelMure",
+ keyProject: "git-bug-exporter-tests",
+ keyToken: token,
+ })
+ require.NoError(t, err)
+
+ start := time.Now()
+
+ err = exporter.ExportAll(backend, time.Time{})
+ require.NoError(t, err)
+
+ fmt.Printf("test repository exported in %f seconds\n", time.Since(start).Seconds())
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+
+ })
+ }
+}
+
+func genRepoName() {}
+
+func createRepository() {}
+
+func deleteRepository() {}
+
+// verifyIssue is full
+// comments
+func verifyIssue() {
+
}