Add an upgrade test

This commit is contained in:
Bryce Lampe
2024-04-25 09:22:20 -07:00
parent 2499eeb27b
commit 5175dbeb3f
16 changed files with 1370 additions and 0 deletions

View File

@@ -6,8 +6,11 @@ package examples
import (
"os"
"path"
"path/filepath"
"testing"
"github.com/pulumi/providertest"
"github.com/pulumi/pulumi-docker-build/provider"
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"github.com/stretchr/testify/require"
)
@@ -26,6 +29,28 @@ func TestYAMLExample(t *testing.T) {
integration.ProgramTest(t, &test)
}
func TestYAMLExampleUpgrade(t *testing.T) {
// t.Setenv("PULUMI_PROVIDER_TEST_MODE", "snapshot")
cwd, err := os.Getwd()
require.NoError(t, err)
bin, err := filepath.Abs("../bin")
require.NoError(t, err)
t.Setenv("PATH", bin+":"+os.Getenv("PATH"))
p, err := provider.New(nil)
require.NoError(t, err)
test := providertest.NewProviderTest(path.Join(cwd, "upgrade"),
providertest.WithProviderName("docker-build"),
providertest.WithBaselineVersion("0.0.1"),
providertest.WithResourceProviderServer(p),
// providertest.WithConfig("dockerHubPassword", os.Getenv("DOCKER_HUB_PASSWORD")), // Doesn't support secrets yet.
)
test.Run(t)
}
func TestECR(t *testing.T) {
if os.Getenv("AWS_SESSION_TOKEN") == "" {
t.Skip("Missing AWS credentials")