Addition of our unit testing examples to our CI setup
Fixes:
MODIFY
.github/workflows/cron.yml
.github/workflows/cron.yml
@@ -21,6 +21,54 @@ env:
PULUMI_TEST_OWNER: moolumi
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
+ dotnet-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install DotNet ${{ matrix.dotnet-version }}
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: ${{matrix.dotnet-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: dotnet test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ dotnet-version:
+ - 3.1.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-cs
+ - testing-unit-cs-mocks
+ - testing-unit-fs-mocks
+ go-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Go ${{ matrix.go-version }}
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{matrix.go-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: go test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ go-version:
+ - 1.16.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-go
kubernetes:
name: kubernetes
needs: test-infra-setup
@@ -230,8 +278,8 @@ jobs:
- Aws
- Azure
- Gcp
- - EquinixMetal
- Packet
+ - EquinixMetal
- Cloud
dotnet-version:
- 3.1.301
@@ -253,6 +301,37 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ python-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{matrix.python-version}}
+ - name: Install Python Deps
+ run: |-
+ pip3 install virtualenv==20.0.23
+ pip3 install pipenv
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ python3 -m venv venv
+ source venv/bin/activate
+ pip3 install -r requirements.txt
+ python -m unittest
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - ubuntu-latest
+ python-version:
+ - 3.7.x
+ source-dir:
+ - testing-unit-py
test-infra-destroy:
name: test-infra-destroy
needs: kubernetes
@@ -418,6 +497,33 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ ts-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{matrix.node-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ npm install
+ npm install --global mocha
+ npm install --global ts-node
+ mocha -r ts-node/register ec2tests.ts
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version:
+ - 13.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-ts
name: Run Examples Cron Job
"on":
repository_dispatch:

MODIFY
.github/workflows/run-tests-command.yml
.github/workflows/run-tests-command.yml
@@ -41,6 +41,58 @@ jobs:
repository: ${{ github.event.client_payload.github.payload.repository.full_name
}}
token: ${{ secrets.GITHUB_TOKEN }}
+ dotnet-unit-testing:
+ if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
+ == github.repository
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install DotNet ${{ matrix.dotnet-version }}
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: ${{matrix.dotnet-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: dotnet test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ dotnet-version:
+ - 3.1.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-cs
+ - testing-unit-cs-mocks
+ - testing-unit-fs-mocks
+ go-unit-testing:
+ if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
+ == github.repository
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Go ${{ matrix.go-version }}
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{matrix.go-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: go test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ go-version:
+ - 1.16.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-go
kubernetes:
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
== github.repository
@@ -262,6 +314,39 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ python-unit-testing:
+ if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
+ == github.repository
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{matrix.python-version}}
+ - name: Install Python Deps
+ run: |-
+ pip3 install virtualenv==20.0.23
+ pip3 install pipenv
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ python3 -m venv venv
+ source venv/bin/activate
+ pip3 install -r requirements.txt
+ python -m unittest
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - ubuntu-latest
+ python-version:
+ - 3.7.x
+ source-dir:
+ - testing-unit-py
test-infra-destroy:
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
== github.repository
@@ -431,6 +516,35 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ ts-unit-testing:
+ if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name
+ == github.repository
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{matrix.node-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ npm install
+ npm install --global mocha
+ npm install --global ts-node
+ mocha -r ts-node/register ec2tests.ts
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version:
+ - 13.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-ts
name: Run Examples Tests From PR
"on":
pull_request:

MODIFY
.github/workflows/smoke-test-cli-command.yml
.github/workflows/smoke-test-cli-command.yml
@@ -21,6 +21,54 @@ env:
PULUMI_VERSION: ${{ github.event.client_payload.ref }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
+ dotnet-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install DotNet ${{ matrix.dotnet-version }}
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: ${{matrix.dotnet-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: dotnet test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ dotnet-version:
+ - 3.1.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-cs
+ - testing-unit-cs-mocks
+ - testing-unit-fs-mocks
+ go-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Go ${{ matrix.go-version }}
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{matrix.go-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: go test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ go-version:
+ - 1.16.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-go
kubernetes:
name: smoke-test-cli-on-kubernetes
needs: test-infra-setup
@@ -211,6 +259,37 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ python-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{matrix.python-version}}
+ - name: Install Python Deps
+ run: |-
+ pip3 install virtualenv==20.0.23
+ pip3 install pipenv
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ python3 -m venv venv
+ source venv/bin/activate
+ pip3 install -r requirements.txt
+ python -m unittest
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - ubuntu-latest
+ python-version:
+ - 3.7.x
+ source-dir:
+ - testing-unit-py
test-infra-destroy:
name: test-infra-destroy
needs: kubernetes
@@ -376,6 +455,33 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ ts-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{matrix.node-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ npm install
+ npm install --global mocha
+ npm install --global ts-node
+ mocha -r ts-node/register ec2tests.ts
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version:
+ - 13.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-ts
name: Smoke Test Specific Version of CLI
"on":
repository_dispatch:

MODIFY
.github/workflows/smoke-test-provider-command.yml
.github/workflows/smoke-test-provider-command.yml
@@ -21,6 +21,54 @@ env:
PULUMI_TEST_OWNER: moolumi
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
+ dotnet-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install DotNet ${{ matrix.dotnet-version }}
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: ${{matrix.dotnet-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: dotnet test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ dotnet-version:
+ - 3.1.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-cs
+ - testing-unit-cs-mocks
+ - testing-unit-fs-mocks
+ go-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Go ${{ matrix.go-version }}
+ uses: actions/setup-go@v1
+ with:
+ go-version: ${{matrix.go-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: go test
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ go-version:
+ - 1.16.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-go
kubernetes:
name: smoke-test-kubernetes-provider
needs: test-infra-setup
@@ -203,6 +251,37 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ python-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{matrix.python-version}}
+ - name: Install Python Deps
+ run: |-
+ pip3 install virtualenv==20.0.23
+ pip3 install pipenv
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ python3 -m venv venv
+ source venv/bin/activate
+ pip3 install -r requirements.txt
+ python -m unittest
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - ubuntu-latest
+ python-version:
+ - 3.7.x
+ source-dir:
+ - testing-unit-py
test-infra-destroy:
name: test-infra-destroy
needs: kubernetes
@@ -368,6 +447,33 @@ jobs:
- ubuntu-latest
python-version:
- "3.7"
+ ts-unit-testing:
+ name: Running ${{ matrix.source-dir }} test
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Install Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{matrix.node-version}}
+ - name: Install Latest Pulumi CLI
+ uses: pulumi/action-install-pulumi-cli@v1.0.1
+ - run: echo "Currently Pulumi $(pulumi version) is installed"
+ - uses: actions/checkout@v2
+ - run: |-
+ npm install
+ npm install --global mocha
+ npm install --global ts-node
+ mocha -r ts-node/register ec2tests.ts
+ working-directory: ${{ matrix.source-dir }}
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version:
+ - 13.x
+ platform:
+ - ubuntu-latest
+ source-dir:
+ - testing-unit-ts
name: Smoke Test Latest Provider Release
"on":
repository_dispatch:

Addition of our unit testing examples to our CI setup (#935)

Fixes: #930