Files
Abhinav Nair baec8ed6b6 Replace deprecated ioutil pkg with os & io
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.
2022-06-26 16:57:29 +08:00

33 lines
570 B
Go

package gitlab
import (
"bytes"
"os"
"testing"
st "github.com/golang-migrate/migrate/v4/source/testing"
)
var GitlabTestSecret = "" // username:token
func init() {
secrets, err := os.ReadFile(".gitlab_test_secrets")
if err == nil {
GitlabTestSecret = string(bytes.TrimSpace(secrets)[:])
}
}
func Test(t *testing.T) {
if len(GitlabTestSecret) == 0 {
t.Skip("test requires .gitlab_test_secrets")
}
g := &Gitlab{}
d, err := g.Open("gitlab://" + GitlabTestSecret + "@gitlab.com/11197284/migrations")
if err != nil {
t.Fatal(err)
}
st.Test(t, d)
}