snapshot of https://github.com/golang-migrate/migrate.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
33
source/bitbucket/bitbucket_test.go
Normal file
33
source/bitbucket/bitbucket_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package bitbucket
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
st "github.com/golang-migrate/migrate/v4/source/testing"
|
||||
)
|
||||
|
||||
var BitbucketTestSecret = "" // username:password
|
||||
|
||||
func init() {
|
||||
secrets, err := os.ReadFile(".bitbucket_test_secrets")
|
||||
if err == nil {
|
||||
BitbucketTestSecret = string(bytes.TrimSpace(secrets)[:])
|
||||
}
|
||||
}
|
||||
|
||||
func Test(t *testing.T) {
|
||||
if len(BitbucketTestSecret) == 0 {
|
||||
t.Skip("test requires .bitbucket_test_secrets")
|
||||
}
|
||||
|
||||
b := &Bitbucket{}
|
||||
|
||||
d, err := b.Open("bitbucket://" + BitbucketTestSecret + "@abhishekbipp/test-migration/migrations/test#master")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
st.Test(t, d)
|
||||
}
|
||||
Reference in New Issue
Block a user