test(fleet/output): add acceptance tests for schema coverage gaps#2805
Open
github-actions[bot] wants to merge 2 commits intomainfrom
Open
test(fleet/output): add acceptance tests for schema coverage gaps#2805github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
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>
Contributor
Author
|
✅ PR Changelog Check passed — |
tobio
approved these changes
May 8, 2026
Contributor
There was a problem hiding this comment.
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.goto exercise schema-coverage gaps (fingerprints,ssl.verification_mode, default flags toggling, Kafkauser_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"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds five new acceptance tests for
elasticstack_fleet_outputcovering attributes identified as having zero or poor coverage in the schema coverage report.Changes
New test functions in
acc_test.goTestAccResourceOutputElasticsearchWithFingerprint— creates an Elasticsearch output withca_sha256andca_trusted_fingerprintset and asserts round-trip values (gap [ci] add jobs to run the acceptance tests #1 from the report)TestAccResourceOutputElasticsearchSSL— creates an Elasticsearch output withssl.verification_mode = "none"via the native schema attribute (not theconfig_yamlworkaround) and asserts the value (gap Align "elasticsearch_connection" and "provider" blocks #2)TestAccResourceOutputDefaultFlags— creates an output withdefault_integrations = trueanddefault_monitoring = true, asserts both are"true", then updates tofalseand asserts again (gap [feature] Support ILM policies #3)TestAccResourceOutputKafkaUserPass— creates a Kafka output withauth_type = "user_pass",username,password, andsasl.mechanism = "PLAIN"and asserts those fields (gap [feature] support snapshot repositories #4)TestAccResourceOutputKafkaPartitions— creates a Kafka output withpartition = "random"and therandom { group_events = 1 }block, then updates topartition = "round_robin"with theround_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/...— passesgo vet ./internal/fleet/output/...— passesmake build— passesAcceptance 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.comSee Network Configuration for more information.