Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added post-deployment test support #1036

Merged

Conversation

AlexanderSehr
Copy link
Contributor

@AlexanderSehr AlexanderSehr commented Feb 17, 2024

Description

Note: Test file changes for key vault are just for illustration purposes

  • Introduced 2 additional steps to deploy action that will look for Pester test files anywhere in a e2e test's folder (or nested folder, if desired), run the contained tests and publish the results
  • If no test was found, the publish results step will be skipped
  • By default, the action will pass in one parameter to the test files that MUST be implemented: [hashtable] $TestInputData. This parameter will automatically contain the test file outputs + the path to the test file. For example
    {
      "TestInputData": {
        "ModuleTestFolderPath": "/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/private-endpoint",
        "DeploymentOutputs": {
          "resourceId": {
            "type": "string",
            "value": "/subscriptions/1111111/resourcegroups/(...)"
          } 
        }
      }
    }
  • Example run
Pipeline
avm.res.key-vault.vault

@AlexanderSehr AlexanderSehr marked this pull request as ready for review February 27, 2024 20:34
@AlexanderSehr AlexanderSehr requested review from a team as code owners February 27, 2024 20:34
fblix
fblix previously approved these changes Feb 28, 2024
ChrisSidebotham
ChrisSidebotham previously approved these changes Mar 4, 2024
Copy link
Contributor

@ChrisSidebotham ChrisSidebotham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AlexanderSehr AlexanderSehr dismissed stale reviews from ChrisSidebotham and fblix via 515baba March 4, 2024 18:16
Copy link
Contributor

@ChrisSidebotham ChrisSidebotham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤌

@AlexanderSehr AlexanderSehr merged commit 5b2380a into Azure:main Mar 5, 2024
9 checks passed
@AlexanderSehr AlexanderSehr deleted the users/alsehr/postDeploymentTest branch March 5, 2024 19:45
hundredacres pushed a commit to hundredacres/bicep-registry-modules that referenced this pull request Mar 12, 2024
## Description

> **Note:** Test file changes for key vault are just for illustration
purposes

- Introduced 2 additional steps to deploy action that will look for
Pester test files anywhere in a e2e test's folder (or nested folder, if
desired), run the contained tests and publish the results
- If no test was found, the publish results step will be skipped
- By default, the action will pass in one parameter to the test files
that MUST be implemented: `[hashtable] $TestInputData`. This parameter
will automatically contain the test file outputs + the path to the test
file. For example
  ```json
  {
    "TestInputData": {
"ModuleTestFolderPath":
"/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/private-endpoint",
      "DeploymentOutputs": {
        "resourceId": {
          "type": "string",
          "value": "/subscriptions/1111111/resourcegroups/(...)"
        } 
      }
    }
  }
  ```
- Example
[run](https://github.com/AlexanderSehr/bicep-registry-modules/actions/runs/7944560531/job/21690223560)

| Pipeline |
| - |
|
[![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FpostDeploymentTest&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)
|

---------

Co-authored-by: Erika Gressi <[email protected]>
Co-authored-by: ChrisSidebotham-MSFT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants