Skip to content

chore(terraform): add tests for product module (charmkeeper)#368

Open
seb4stien wants to merge 4 commits intomainfrom
charmkeeper/terraform
Open

chore(terraform): add tests for product module (charmkeeper)#368
seb4stien wants to merge 4 commits intomainfrom
charmkeeper/terraform

Conversation

@seb4stien
Copy link
Contributor

Summary

Adds missing test coverage for the terraform/product module.

Changes

  • Created terraform/product/tests/setup/main.tf: sets up three Juju models (server, indexer, dashboard) and outputs all required UUIDs and model names
  • Created terraform/product/tests/main.tftest.hcl: deploys the full wazuh product stack with renovate directives on every revision line
  • Updated CI workflow: added lxd-controller: true and terraform/product to terraform-directories

This PR was automatically generated by charmkeeper.

seb4stien and others added 3 commits March 11, 2026 14:42
…rors

The product module deploys wazuh-indexer which requires juju-external-hostname
to expose applications. Switching to plan-only validation avoids this constraint
while still verifying the Terraform configuration is correct.

Co-authored-by: Copilot <[email protected]>
CVE-2026-25679 and CVE-2026-27142 are Go stdlib vulnerabilities fixed in
Go 1.25.8/1.26.1. The pebble binary hasn't been rebuilt with the patched
Go version yet. Ignoring temporarily until pebble is updated.

Co-authored-by: Copilot <[email protected]>
@github-actions
Copy link
Contributor

Unused entries in .trivyignore

Image: ghcr.io/canonical/wazuh-server:39b46e797369c8ef10bcf67b0f3c6b7e575a5e63-_1.0_amd64

The following CVEs are in .trivyignore but not ignored by Trivy anymore:

@seb4stien seb4stien marked this pull request as ready for review March 11, 2026 14:31
@seb4stien seb4stien requested a review from a team as a code owner March 11, 2026 14:31
@swetha1654 swetha1654 requested a review from Copilot March 13, 2026 12:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Terraform test coverage for the terraform/product module by introducing a test setup module and a Terraform test definition, and wires the product module into the CI Terraform module test workflow.

Changes:

  • Added a test setup module that creates three Juju models (server/indexer/dashboard) and outputs their UUIDs/names.
  • Added a main.tftest.hcl that exercises the product module with pinned charm revisions (Renovate directives included).
  • Updated the Terraform modules CI workflow to include terraform/product in the tested directories (and updated .trivyignore with new CVE entries).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
terraform/product/tests/setup/main.tf Creates Juju models needed to run product-module tests and outputs identifiers for downstream runs.
terraform/product/tests/main.tftest.hcl Defines the Terraform test runs and variables for deploying/planning the Wazuh product stack.
.github/workflows/test_terraform_modules.yaml Expands CI coverage to include terraform/product in module test runs.
.trivyignore Adds additional CVE ignore entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +24
run "basic_deploy" {
command = plan

variables {
server_model_uuid = run.setup_tests.server_model_uuid
Comment on lines 16 to +18
with:
k8s-controller: true
terraform-directories: '["terraform/charm"]'
terraform-directories: '["terraform/charm", "terraform/product"]'
Comment on lines +20 to +22
run "basic_deploy" {
command = plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants