Skip to content

Commit

Permalink
Skips incompatible tests on kind
Browse files Browse the repository at this point in the history
  • Loading branch information
rquitales committed Mar 9, 2024
1 parent 9e2d0c9 commit 76a98bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ jobs:
needs:
- build_sdks
strategy:
fail-fast: true
fail-fast: false
matrix:
language:
- nodejs
Expand Down Expand Up @@ -384,7 +384,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: cd tests/sdk/${{ matrix.language }} && go test -v -count=1 -cover -timeout
2h -parallel 4 --create-cluster --cluster-type=kind --num-clusters=5 -short ./...
2h -parallel 4 --create-cluster --cluster-type=kind --num-clusters=1 -short ./...
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
1 change: 1 addition & 0 deletions tests/sdk/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ func TestGo(t *testing.T) {
})

t.Run("Import Deployment Created by Helm", func(t *testing.T) {
tests.SkipIfShort(t)
baseDir := filepath.Join(cwd, "helm-import-deployment", "step1")
namespace := getRandomNamespace("importdepl")
chartPath := filepath.Join(baseDir, "./nginx")
Expand Down
29 changes: 18 additions & 11 deletions tests/sdk/nodejs/nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ func TestCRDs(t *testing.T) {
}

func TestPod(t *testing.T) {
tests.SkipIfShort(t) // statuses are different in Kind cluster
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("delete-before-replace", "step1"),
Quick: true,
Expand Down Expand Up @@ -561,7 +562,7 @@ func TestPod(t *testing.T) {
},
},
})
test, _ = testClusters.WrapProviderTestOptions(test)
// test, _ = testClusters.WrapProviderTestOptions(test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -803,6 +804,7 @@ func TestGet(t *testing.T) {
}

func TestIstio(t *testing.T) {
tests.SkipIfShort(t)
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("istio", "step1"),
Quick: true,
Expand All @@ -825,7 +827,6 @@ func TestIstio(t *testing.T) {
assert.Fail(t, "Maximum Istio gateway request retries exceeded")
},
})
test, _ = testClusters.WrapProviderTestOptions(test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -1170,6 +1171,8 @@ func TestRenderYAML(t *testing.T) {
assert.Equal(t, len(files), 2)
},
})

test, _ = testClusters.WrapProviderTestOptions(test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -1812,7 +1815,7 @@ func TestStrictMode(t *testing.T) {
},
},
})
test, _ = testClusters.WrapProviderTestOptions(test)
// test, _ = testClusters.WrapProviderTestOptions(test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -1855,22 +1858,23 @@ func TestClientSideDriftCorrectCSA(t *testing.T) {

// Use manual lifecycle management since we need to run external commands in between pulumi up steps, while referencing
// the same stack.
applyStep, kcfg := testClusters.WrapProviderTestOptions(applyStep)
pt := integration.ProgramTestManualLifeCycle(t, &applyStep)
err := pt.TestLifeCycleInitAndDestroy()
assert.NoError(t, err)

// Sanity check with kubectl to verify that the ConfigMap was created with the wanted label.
out, err := exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err := exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)
assert.Contains(t, string(out), "bar") // ConfigMap should have been created with data foo: bar.

// Update the ConfigMap and change the data foo: bar to foo: baz.
out, err = exec.Command("kubectl", "patch", "configmap", "-n", ns, cmName, "-p", `{"data":{"foo":"baz"}}`).CombinedOutput()
out, err = exec.Command("kubectl", "patch", "configmap", "--kubeconfig", kcfg, "-n", ns, cmName, "-p", `{"data":{"foo":"baz"}}`).CombinedOutput()
assert.NoError(t, err)
assert.Contains(t, string(out), "configmap/"+cmName+" patched") // Ensure CM was patched.

// Use kubectl to verify that the ConfigMap was updated and now has data foo: baz.
out, err = exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err = exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)
assert.NotContains(t, string(out), "foo: bar") // ConfigMap should no longer have data foo: bar.
assert.Contains(t, string(out), "foo: baz") // ConfigMap should have data foo: baz.
Expand All @@ -1886,7 +1890,7 @@ func TestClientSideDriftCorrectCSA(t *testing.T) {
assert.NoError(t, err)

// Use kubectl to verify that the ConfigMap was updated and has the label again.
out, err = exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err = exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)

assert.Contains(t, string(out), "foo: bar") // ConfigMap should have been updated with data foo: bar.
Expand Down Expand Up @@ -1932,22 +1936,23 @@ func TestClientSideDriftCorrectSSA(t *testing.T) {

// Use manual lifecycle management since we need to run external commands in between pulumi up steps, while referencing
// the same stack.
applyStep, kcfg := testClusters.WrapProviderTestOptions(applyStep)
pt := integration.ProgramTestManualLifeCycle(t, &applyStep)
err := pt.TestLifeCycleInitAndDestroy()
assert.NoError(t, err)

// Sanity check with kubectl to verify that the ConfigMap was created with the wanted label.
out, err := exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err := exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)
assert.Contains(t, string(out), "bar") // ConfigMap should have been created with data foo: bar.

// Update the ConfigMap and change the data foo: bar to foo: baz.
out, err = exec.Command("kubectl", "patch", "configmap", "-n", ns, cmName, "-p", `{"data":{"foo":"baz"}}`).CombinedOutput()
out, err = exec.Command("kubectl", "patch", "configmap", "--kubeconfig", kcfg, "-n", ns, cmName, "-p", `{"data":{"foo":"baz"}}`).CombinedOutput()
assert.NoError(t, err)
assert.Contains(t, string(out), "configmap/"+cmName+" patched") // Ensure CM was patched.

// Use kubectl to verify that the ConfigMap was updated and now has data foo: baz.
out, err = exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err = exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)
assert.NotContains(t, string(out), "foo: bar") // ConfigMap should no longer have data foo: bar.
assert.Contains(t, string(out), "foo: baz") // ConfigMap should have data foo: baz.
Expand All @@ -1963,7 +1968,7 @@ func TestClientSideDriftCorrectSSA(t *testing.T) {
assert.NoError(t, err)

// Use kubectl to verify that the ConfigMap was updated and has the label again.
out, err = exec.Command("kubectl", "get", "configmap", "-o", "yaml", "-n", ns, cmName).CombinedOutput()
out, err = exec.Command("kubectl", "get", "configmap", "--kubeconfig", kcfg, "-o", "yaml", "-n", ns, cmName).CombinedOutput()
assert.NoError(t, err)

assert.Contains(t, string(out), "foo: bar") // ConfigMap should have been updated with data foo: bar.
Expand All @@ -1982,6 +1987,7 @@ func TestClientSideDriftCorrectSSA(t *testing.T) {
// 5. Re-enable access to the unreachable cluster and run `pulumi up` again.
// 6. Validate that the resource in the unreachable cluster was updated.
func TestSkipUpdateUnreachableFlag(t *testing.T) {
tests.SkipIfShort(t)
var ns0, ns1, cm0, cm1 string

test := baseOptions.With(integration.ProgramTestOptions{
Expand Down Expand Up @@ -2293,6 +2299,7 @@ func TestEmptyItemNormalization(t *testing.T) {
// 3. Update the DeploymentPatch resource to further patch the deployment, setting the image to nginx:1.14.0,
// and verify that other fields managed by kubectl-client-side-apply remain unaffected (Step 2).
func TestFieldManagerPatchResources(t *testing.T) {
tests.SkipIfShort(t)
testFolder := "field-manager-patch-resources"

createDeployment := func() string {
Expand Down

0 comments on commit 76a98bb

Please sign in to comment.