Skip to content

Commit

Permalink
Merge pull request #85 from lbrlabs/explicit_provider_test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxstorm committed May 21, 2023
2 parents 13570fc + ed60654 commit f36534c
Show file tree
Hide file tree
Showing 2,224 changed files with 220 additions and 348,075 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ provider/**/schema-embed.json
**/version.txt
**/nuget
**/dist

**/__pycache__
**/venv
9 changes: 9 additions & 0 deletions examples/examples_py_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ func TestAccServiceAccount(t *testing.T) {
integration.ProgramTest(t, &test)
}

func TestAccExplicitProvider(t *testing.T) {
test := getPythonBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: path.Join(getCwd(t), "python/explicit_provider"),
})

integration.ProgramTest(t, &test)
}

func getPythonBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
basePython := base.With(integration.ProgramTestOptions{
Expand Down
2 changes: 2 additions & 0 deletions examples/python/explicit_provider/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
venv/
6 changes: 6 additions & 0 deletions examples/python/explicit_provider/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: python_explicit_provider
runtime:
name: python
options:
virtualenv: venv
description: A minimal Python Pulumi program
33 changes: 33 additions & 0 deletions examples/python/explicit_provider/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""A Python Pulumi program"""

import pulumi
import pulumi_random as random
import lbrlabs_pulumi_grafana as grafana


service_account = grafana.ServiceAccount(
"ci-testing",
role="Admin"
)

service_account_token = grafana.ServiceAccountToken(
"ci-testing",
service_account_id = service_account.id,
seconds_to_live = 600,
)

provider = grafana.Provider(
"ci-testing",
auth=service_account_token.key,
)

folder_name = random.RandomString(
"example",
length=10,
)

folder = grafana.Folder(
"example",
title=folder_name.result,
)

Binary file not shown.
2 changes: 2 additions & 0 deletions examples/python/explicit_provider/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pulumi>=3.0.0,<4.0.0
pulumi-random>=4.0.0,<5.0.0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f36534c

Please sign in to comment.