mirror of
https://github.com/hanzoai/migrate.git
synced 2026-09-30 22:55:10 +00:00
As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. So replacing all usage of ioutil pkg with io & os.
34 lines
621 B
Go
34 lines
621 B
Go
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)
|
|
}
|