Skip to content

test(fleet/output): add acceptance tests for schema coverage gaps#2805

Open
github-actions[bot] wants to merge 2 commits intomainfrom
code-factory/issue-2772-a8138b48fe28178c
Open

test(fleet/output): add acceptance tests for schema coverage gaps#2805
github-actions[bot] wants to merge 2 commits intomainfrom
code-factory/issue-2772-a8138b48fe28178c

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 8, 2026

Adds five new acceptance tests for elasticstack_fleet_output covering attributes identified as having zero or poor coverage in the schema coverage report.

Changes

New test functions in acc_test.go

  • TestAccResourceOutputElasticsearchWithFingerprint — creates an Elasticsearch output with ca_sha256 and ca_trusted_fingerprint set and asserts round-trip values (gap [ci] add jobs to run the acceptance tests #1 from the report)
  • TestAccResourceOutputElasticsearchSSL — creates an Elasticsearch output with ssl.verification_mode = "none" via the native schema attribute (not the config_yaml workaround) and asserts the value (gap Align "elasticsearch_connection" and "provider" blocks #2)
  • TestAccResourceOutputDefaultFlags — creates an output with default_integrations = true and default_monitoring = true, asserts both are "true", then updates to false and asserts again (gap [feature] Support ILM policies #3)
  • TestAccResourceOutputKafkaUserPass — creates a Kafka output with auth_type = "user_pass", username, password, and sasl.mechanism = "PLAIN" and asserts those fields (gap [feature] support snapshot repositories #4)
  • TestAccResourceOutputKafkaPartitions — creates a Kafka output with partition = "random" and the random { group_events = 1 } block, then updates to partition = "round_robin" with the round_robin { group_events = 1 } block (gap [feature] support kibana spaces #5)

New testdata directories

Follows the existing pattern of testdata/<TestName>/<step>/output.tf + variables.tf.

Verification

  • go build ./internal/fleet/output/... — passes
  • go vet ./internal/fleet/output/... — passes
  • make build — passes

Acceptance tests require a live Elastic Stack and will run in CI.

Closes #2772


🤖 Generated with [Claude Code]((claude.com/redacted)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • checkpointapi.hashicorp.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "checkpointapi.hashicorp.com"

See Network Configuration for more information.

Generated by Code Factory Issue Intake for issue #2772 · ● 576.1K ·

Adds five new acceptance tests covering attributes that had zero or
poor coverage in elasticstack_fleet_output:

- TestAccResourceOutputElasticsearchWithFingerprint: covers ca_sha256
  and ca_trusted_fingerprint round-trip
- TestAccResourceOutputElasticsearchSSL: covers ssl.verification_mode
  via the native schema attribute instead of the config_yaml workaround
- TestAccResourceOutputDefaultFlags: covers default_integrations and
  default_monitoring with true values and an update back to false
- TestAccResourceOutputKafkaUserPass: covers kafka.auth_type=user_pass,
  username, and sasl.mechanism
- TestAccResourceOutputKafkaPartitions: covers the kafka.random and
  kafka.round_robin partition blocks with group_events

Closes #2772

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 8, 2026

PR Changelog Check passedno-changelog label is set.

@tobio tobio marked this pull request as ready for review May 8, 2026 13:00
Copilot AI review requested due to automatic review settings May 8, 2026 13:00
@tobio tobio enabled auto-merge (squash) May 8, 2026 13:01
Copy link
Copy Markdown
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 new acceptance coverage for previously untested/poorly-tested elasticstack_fleet_output schema attributes, primarily around TLS fingerprints/SSL verification mode and Kafka-specific configuration.

Changes:

  • Added 5 new acceptance tests in internal/fleet/output/acc_test.go to exercise schema-coverage gaps (fingerprints, ssl.verification_mode, default flags toggling, Kafka user_pass, Kafka partition sub-blocks).
  • Added corresponding HCL test configurations under internal/fleet/output/testdata/ for each new test and step (create/update).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/fleet/output/acc_test.go Adds five new acceptance tests targeting schema coverage gaps for Fleet Output.
internal/fleet/output/testdata/TestAccResourceOutputKafkaUserPass/create/output.tf New Kafka user_pass test config (username/password + SASL mechanism).
internal/fleet/output/testdata/TestAccResourceOutputKafkaUserPass/create/variables.tf Variable definition for the Kafka user_pass test config.
internal/fleet/output/testdata/TestAccResourceOutputKafkaPartitions/create/output.tf New Kafka partition “random” + random { group_events = 1 } test config.
internal/fleet/output/testdata/TestAccResourceOutputKafkaPartitions/create/variables.tf Variable definition for Kafka partitions create step.
internal/fleet/output/testdata/TestAccResourceOutputKafkaPartitions/update/output.tf New Kafka partition update to “round_robin” + round_robin { group_events = 1 }.
internal/fleet/output/testdata/TestAccResourceOutputKafkaPartitions/update/variables.tf Variable definition for Kafka partitions update step.
internal/fleet/output/testdata/TestAccResourceOutputElasticsearchWithFingerprint/create/output.tf New Elasticsearch output config covering ca_sha256 + ca_trusted_fingerprint.
internal/fleet/output/testdata/TestAccResourceOutputElasticsearchWithFingerprint/create/variables.tf Variable definition for fingerprint test config.
internal/fleet/output/testdata/TestAccResourceOutputElasticsearchSSL/create/output.tf New Elasticsearch output config covering native ssl.verification_mode.
internal/fleet/output/testdata/TestAccResourceOutputElasticsearchSSL/create/variables.tf Variable definition for SSL test config.
internal/fleet/output/testdata/TestAccResourceOutputDefaultFlags/create/output.tf New config with default_integrations/default_monitoring = true.
internal/fleet/output/testdata/TestAccResourceOutputDefaultFlags/create/variables.tf Variable definition for default flags create step.
internal/fleet/output/testdata/TestAccResourceOutputDefaultFlags/update/output.tf Update config flipping default flags back to false.
internal/fleet/output/testdata/TestAccResourceOutputDefaultFlags/update/variables.tf Variable definition for default flags update step.

Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("elasticstack_fleet_output.test_output", "type", "kafka"),
resource.TestCheckResourceAttr("elasticstack_fleet_output.test_output", "kafka.auth_type", "user_pass"),
resource.TestCheckResourceAttr("elasticstack_fleet_output.test_output", "kafka.username", "testuser"),
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.

[schema-coverage] elasticstack_fleet_output: ca_sha256, ca_trusted_fingerprint, ssl.verification_mode, and kafka sub-attributes missing acceptance

2 participants