-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added typescript tests to meraki provider. This is not a full test suite. * add get-devices, network-base-ts, network-settings-ts, network-appliance-vlans-settings-ts, network-alert-settings-ts, and network-appliance-content-filter-ts tests add test_nodejs to makefile * Set secrets --------- Co-authored-by: phillip edwards <[email protected]> Co-authored-by: zbuchheit <[email protected]>
- Loading branch information
1 parent
2a81549
commit 27bd162
Showing
117 changed files
with
2,157 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,77 @@ | ||
// Copyright 2016-2017, Pulumi Corporation. All rights reserved. | ||
// Copyright 2016-2024, Pulumi Corporation. All rights reserved. | ||
//go:build nodejs || all | ||
// +build nodejs all | ||
|
||
package examples | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/pulumi/pulumi/pkg/v3/testing/integration" | ||
"github.com/pulumi/providertest/pulumitest" | ||
"github.com/pulumi/providertest/pulumitest/opttest" | ||
) | ||
|
||
func TestAccRecordTs(t *testing.T) { | ||
test := getJSBaseOptions(t). | ||
With(integration.ProgramTestOptions{ | ||
Dir: filepath.Join(getCwd(t), "org-policy-groups", "ts"), | ||
}) | ||
func TestGetDevicesTs(t *testing.T) { | ||
t.Skip("Skipping Pulumi Test as this currently doesn't work. See https://github.com/pulumi/pulumi-meraki/issues/134 for more details") | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "get-devices-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.Preview() | ||
} | ||
func TestNetworkBaseTs(t *testing.T) { | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "network-base-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
opttest.YarnLink("@pulumi/meraki"), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.SetConfig("networkName", "Pulumi Base Test Network_" + randomString(6)) | ||
test.Up() | ||
} | ||
|
||
integration.ProgramTest(t, &test) | ||
func TestNetworkSettingsTs(t *testing.T) { | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "network-settings-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
opttest.YarnLink("@pulumi/meraki"), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.SetConfig("networkName", "Pulumi Base Test Network_" + randomString(6)) | ||
test.Up() | ||
} | ||
|
||
func getJSBaseOptions(t *testing.T) integration.ProgramTestOptions { | ||
base := getBaseOptions(t) | ||
baseJS := base.With(integration.ProgramTestOptions{ | ||
Dependencies: []string{"@pulumi/meraki"}, | ||
}) | ||
func TestApplianceVlansTs(t *testing.T) { | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "network-appliance-vlans-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
opttest.YarnLink("@pulumi/meraki"), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.SetConfig("networkName", "Pulumi Base Test Network_" + randomString(6)) | ||
test.Up() | ||
} | ||
|
||
return baseJS | ||
func TestAlertSettingsTs(t *testing.T) { | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "network-alert-settings-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
opttest.YarnLink("@pulumi/meraki"), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.SetConfig("networkName", "Pulumi Base Test Network_" + randomString(6)) | ||
test.Up() | ||
} | ||
func TestApplianceContentFilterTs(t *testing.T) { | ||
checkBaseEnvVars(t) | ||
test := pulumitest.NewPulumiTest(t, "network-appliance-content-filtering-ts", | ||
opttest.LocalProviderPath("meraki", filepath.Join(getCwd(t), "..", "bin")), | ||
opttest.YarnLink("@pulumi/meraki"), | ||
) | ||
test.SetConfig("organizationId", os.Getenv(EnvMerakiOrgID)) | ||
test.SetConfig("networkName", "Pulumi Base Test Network_" + randomString(6)) | ||
test.Up() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: meraki-get-devices-ts | ||
runtime: nodejs | ||
description: A minimal TypeScript Pulumi program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as meraki from "@pulumi/meraki"; | ||
|
||
export = async () => { | ||
const config = new pulumi.Config(); | ||
const organizationId = config.require("organizationId"); | ||
await meraki.getDevices({ | ||
organizationId, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "meraki-get-devices-ts", | ||
"main": "index.ts", | ||
"devDependencies": { | ||
"@types/node": "^18", | ||
"typescript": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/meraki": "^0.2.10", | ||
"@pulumi/pulumi": "^3.113.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"outDir": "bin", | ||
"target": "es2020", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": ["index.ts"] | ||
} |
Oops, something went wrong.