Skip to content

Commit

Permalink
Add nodejs test
Browse files Browse the repository at this point in the history
  • Loading branch information
viveklak committed Mar 29, 2022
1 parent dabb4ea commit debc2ae
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/sdk/nodejs/examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,20 @@ func TestAccHelm(t *testing.T) {
integration.ProgramTest(t, &test)
}

func TestHelmNoDefaultProvider(t *testing.T) {
skipIfShort(t)
test := getBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "helm-no-default-provider"),
SkipRefresh: true,
Verbose: true,
Quick: true,
Config: map[string]string{"disable-default-providers": `["kubernetes"]`},
})

integration.ProgramTest(t, &test)
}

func TestAccHelmApiVersions(t *testing.T) {
skipIfShort(t)
test := getBaseOptions(t).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: helm-no-default-provider
runtime: nodejs
description: A minimal Kubernetes TypeScript Pulumi program
38 changes: 38 additions & 0 deletions tests/sdk/nodejs/examples/helm-no-default-provider/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as k8s from '@pulumi/kubernetes'

const k8sProvider = new k8s.Provider(`k8s-provider`, {
kubeconfig: '~/.kube/config',
})

const namespace = new k8s.core.v1.Namespace("release-ns");

new k8s.helm.v3.Chart(
'wordpress',
{
fetchOpts: {
repo: 'https://charts.bitnami.com/bitnami',
},
namespace: namespace.metadata.name,
chart: 'wordpress',
values: {
"service": {"type": "ClusterIP"},
},
},
{
provider: k8sProvider,
}
)
11 changes: 11 additions & 0 deletions tests/sdk/nodejs/examples/helm-no-default-provider/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "helm-def-prov",
"devDependencies": {
"@types/node": "^14"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/kubernetes": "3.15.1",
"@pulumi/kubernetesx": "^0.1.5"
}
}
18 changes: 18 additions & 0 deletions tests/sdk/nodejs/examples/helm-no-default-provider/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.ts"
]
}

0 comments on commit debc2ae

Please sign in to comment.