Add initial mock tests examples and pipelines #1983
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1949
Closing 1949.
Summary
This pull request includes several changes to improve the testing workflows and documentation of the project. The most significant changes include the addition of new GitHub workflow files for dispatching pull requests and running tests, modifications to the instructions for running workflows locally, and the introduction of Terraform test commands.
Outline
GitHub workflows:
.github/workflows/pr_dispatch.yaml
: Added a new GitHub workflow for dispatching pull requests. This workflow triggers on pull request events and runs a job that dispatches a repository event with a client payload containing the scenario to run..github/workflows/pr_workflow.yaml
: Added a new GitHub workflow for running PR tests. This workflow triggers on repository dispatch and workflow dispatch events, and runs jobs to load test scenarios, run mock plan scenarios, perform Terraform integration tests, and purge the integration environment if the previous jobs fail or are cancelled.Terraform test commands and mock data:
examples/tests/README.md
: Added documentation for running Terraform test commands locally.examples/tests/general.tftest.hcl
: Added a new Terraform test file with mock providers.examples/tests/mock/e2e_plan.tftest.hcl
: Added a new Terraform test file for end-to-end plan testing with mock providers.examples/tests/mock_data/data.tfmock.hcl
: Added a new Terraform mock data file for theazurerm_client_config
andazuread_client_config
data sources.Local configuration:
locals.tf
: Modified theclient_config
local to use thetomap
function instead of themap
function.Documentation:
.github/workflows/developer.md
: Improved the instructions for installing Act and running GitHub workflows locally, including the addition of a link to the Act GitHub repository and the use of thegh auth token
command to authenticate with GitHub.