2023-08-25 05:41:13 +00:00
|
|
|
package internal_test
|
|
|
|
|
|
|
|
import (
|
2023-08-26 14:42:23 +00:00
|
|
|
"os"
|
2023-08-25 05:41:13 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/Kichiyaki/terraform-provider-woodpecker/internal"
|
|
|
|
"github.com/hashicorp/terraform-plugin-framework/providerserver"
|
|
|
|
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
|
|
|
|
)
|
|
|
|
|
|
|
|
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
|
2023-08-26 14:42:23 +00:00
|
|
|
"woodpecker": providerserver.NewProtocol6WithError(internal.NewProvider("test")()),
|
2023-08-25 05:41:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func testAccPreCheck(t *testing.T) {
|
|
|
|
t.Helper()
|
2023-08-26 14:42:23 +00:00
|
|
|
|
|
|
|
if v := os.Getenv("WOODPECKER_SERVER"); v == "" {
|
|
|
|
t.Fatal("WOODPECKER_SERVER must be set for tests")
|
|
|
|
}
|
|
|
|
|
|
|
|
if v := os.Getenv("WOODPECKER_TOKEN"); v == "" {
|
|
|
|
t.Fatal("WOODPECKER_TOKEN must be set for tests")
|
|
|
|
}
|
2023-08-25 05:41:13 +00:00
|
|
|
}
|