osinfra-io / terraform-google-kubernetes-engine

Terraform example module for Google Cloud Platform Kubernetes Engine cluster.
https://www.osinfra.io
GNU General Public License v2.0
1 stars 0 forks source link

Refactor tests in native `terraform test` #72

Closed brettcurtis closed 6 months ago

infracost[bot] commented 6 months ago

💰 Infracost report

Monthly cost will not change

Changed project Baseline cost Usage cost* Total change New monthly cost
fixtures-gke_fleet_host-regional_istio -$7 +$0 -$7 $0
tests-fixtures-gke_fleet_host-regional_istio +$7 +$0 +$7 $7

*Usage costs were estimated using Infracost Cloud settings, see docs for other options.

Cost details ``` Key: * usage cost, ~ changed, + added, - removed ────────────────────────────────── Project: fixtures-gke_fleet_host-regional_istio Module path: fixtures/gke_fleet_host/regional_istio - module.test.google_dns_record_set.istio_gateway["gateway-us-east1-b.test.gcp.osinfra.io"] Monthly cost depends on usage - Queries Monthly cost depends on usage -$0.40 per 1M queries - module.test.google_dns_record_set.istio_gateway["stream-team-us-east1-b.test.gcp.osinfra.io"] Monthly cost depends on usage - Queries Monthly cost depends on usage -$0.40 per 1M queries - module.test.google_compute_global_address.istio_gateway[0] -$7 - IP address (unused) -$7 Monthly cost change for fixtures-gke_fleet_host-regional_istio (Module path: fixtures/gke_fleet_host/regional_istio) Amount: -$7 ($7 → $0.00) ────────────────────────────────── Project: tests-fixtures-gke_fleet_host-regional_istio Module path: tests/fixtures/gke_fleet_host/regional_istio + module.test.google_compute_global_address.istio_gateway[0] +$7 + IP address (unused) +$7 + module.test.google_dns_record_set.istio_gateway["gateway-us-east1-b.test.gcp.osinfra.io"] Monthly cost depends on usage + Queries Monthly cost depends on usage +$0.40 per 1M queries + module.test.google_dns_record_set.istio_gateway["stream-team-us-east1-b.test.gcp.osinfra.io"] Monthly cost depends on usage + Queries Monthly cost depends on usage +$0.40 per 1M queries Monthly cost change for tests-fixtures-gke_fleet_host-regional_istio (Module path: tests/fixtures/gke_fleet_host/regional_istio) Amount: +$7 ($0.00 → $7) ────────────────────────────────── Key: * usage cost, ~ changed, + added, - removed 8 projects have no cost estimate changes. Run the following command to see their breakdown: infracost breakdown --path=/path/to/code ────────────────────────────────── *Usage costs were estimated using Infracost Cloud settings, see docs for other options. 3 cloud resources were detected: ∙ 3 were estimated ```

Governance checks

🟢 53 passed
52 FinOps policies and 1 Tagging policy passed.

View report in Infracost Cloud. This comment will be updated when code changes.

coderabbitai[bot] commented 6 months ago

Walkthrough

This update enhances testing processes by introducing a new GitHub Actions workflow for Terraform tests, updating the pre-commit-terraform hook, and adjusting Terraform configurations across modules. It also aligns source paths and network configurations in test fixtures with new directory structures and testing needs, impacting both global and regional scopes for more robust testing environments.

Changes

File Path Change Summary
.github/workflows/test.yml Sets up a new workflow "Terraform Tests" for GitHub Actions.
.pre-commit-config.yaml Updates pre-commit-terraform hook from v1.89.0 to v1.89.1.
empty.tf Added to aid Terraform initialization and testing.
regional/README.md
regional/istio/README.md
Updates provider versions for Google, Google-beta, Helm, Kubernetes, and Random.
tests/.../tftest.hcl Adds test configurations for GKE fleet hosts and members.
tests/fixtures/.../main.tf Adjusts source paths and network values in test fixtures for GKE fleet hosts and members to match new directory structures and network configurations.

This condensed table groups similar changes across files to provide a concise overview of the modifications in this update.


Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 30b15c6e7932b09b798c7dea66bb8cf41ae5a458 and 5609832d1b2b407732edfb02d8da3976f7370a14.
Files selected for processing (1) * README.md (2 hunks)
Additional Context Used
LanguageTool (19)
README.md (19)
Near line 1: Possible spelling mistake found. Context: # Open Source Infrastructure (as Code) is a developme... --- Near line 42: If this is a compound adjective that modifies the following noun, use a hyphen. Context: ...zations can use internally at scale. - [Open Source Infrastructure (as Code)](https://www.o... --- Near line 44: If this is a compound adjective that modifies the following noun, use a hyphen. Context: ... the possibility for contributions. The Open Source Infrastructure (as Code) model allows t... --- Near line 44: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing. Context: ...oad. This section is for developers who want to contribute to this repository, describi... --- Near line 51: Possible spelling mistake found. Context: ...🛠️ Tools - [helm](https://helm.sh) - [infracost](https://github.com/infracost/infracost... --- Near line 60: This sentence does not start with an uppercase letter. Context: ...te in this repository successfully. - [istio](https://istio.io/latest/docs) - [ist... --- Near line 61: Possible spelling mistake found. Context: ...tio](https://istio.io/latest/docs) - [istio on gke](https://istio.io/latest/docs/se... --- Near line 61: Possible spelling mistake found. Context: ...s://istio.io/latest/docs) - [istio on gke](https://istio.io/latest/docs/setup/pla... --- Near line 62: Possible spelling mistake found. Context: ...atest/docs/setup/platform-setup/gke) - [kubernetes engine](https://cloud.google.com/kubern... --- Near line 65: Possible spelling mistake found. Context: ...s-engine/docs/concepts/node-pools) - [RBAC](https://cloud.google.com/kubernetes-en... --- Near line 67: Possible spelling mistake found. Context: ...ocs/how-to/workload-identity) - [shared vpc](https://cloud.google.com/vpc/docs/shar... --- Near line 72: Possible missing article found. Context: ...the tests. This group manages access to Testing/Sandbox folder in the resource hierarch... --- Near line 85: Possible typo: you repeated a word Context: ...tation - [global](global/README.md) - [regional](regional/README.md) - [regional/istio](regional/istio/README.md) - [reg... --- Near line 86: Possible spelling mistake found. Context: ...gional](regional/README.md) - [regional/istio](regional/istio/README.md) - [regional/... --- Near line 87: Possible spelling mistake found. Context: ...](regional/istio/README.md) - [regional/mci](regional/mci/README.md) - [regional/on...
Additional comments not posted (1)
README.md (1)
`23-23`: Updated directory path to `tests/fixtures` looks good. Please verify that the `tests/fixtures` directory exists and contains the expected configurations.
---
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.