Skip to content

[schema-coverage] elasticstack_elasticsearch_ingest_processor_json #4357

Description

@github-actions

Entity

  • Name: elasticstack_elasticsearch_ingest_processor_json
  • Type: data source
  • Implementation: internal/elasticsearch/ingest/processor_json_pf_data_source.go
  • Acceptance tests: internal/elasticsearch/ingest/processor_json_data_source_test.go

1) Attributes with no coverage

None. Every schema attribute (id, json, field, target_field, add_to_root, add_to_root_conflict_strategy, allow_duplicate_keys, description, if, ignore_failure, on_failure, tag) is configured and/or asserted in at least one test step.

2) Attributes with poor coverage

  • add_to_root (Optional, bool): only ever asserted as true (in the add_to_root step). Never asserted as false/absent, so the default/mutually-exclusive-with-target_field behavior is untested.
  • add_to_root_conflict_strategy (Optional, string, OneOf("replace", "merge")): only "merge" is ever exercised; "replace" is never tested.
  • allow_duplicate_keys (Optional, bool): only ever asserted as true (in all_attributes). Never asserted as false/absent, and no update coverage.
  • description / if / tag (Optional, string): each has exactly one non-default value tested (in all_attributes) with no explicit absence assertion in the other steps (read, add_to_root, updated_values) and no update coverage (value never changes across steps).
  • on_failure (Optional, list of normalized JSON): asserted with exactly one entry in all_attributes (on_failure.# = 1); not asserted absent in the other steps, and no coverage of multiple entries or of the list changing across an update step.

Prioritized top 5 gaps

  1. add_to_root_conflict_strategy — only one of its two valid values ("merge") is ever exercised; "replace" is untested.
  2. add_to_root — only tested as true; no coverage of the false/unset default.
  3. allow_duplicate_keys — only tested as true; no false/unset coverage, no update coverage.
  4. on_failure — single-entry only; no multi-entry or update coverage.
  5. description / if / tag — single value each, no absence assertions outside all_attributes, no update coverage.

Concrete acceptance-test additions

  • Add a step (or extend an existing one) that sets add_to_root_conflict_strategy = "replace" and asserts the resulting attribute value and JSON body.
  • Add explicit resource.TestCheckNoResourceAttr assertions for add_to_root and allow_duplicate_keys in steps where they are omitted (e.g. read), to lock in default/unset behavior.
  • Extend the updated_values step to also change description, if, tag, and on_failure (not just field/target_field), asserting the new values to add update coverage for these attributes.
  • Add a step configuring on_failure with two entries and assert on_failure.# = 2 plus CheckResourceJSON for each entry.

Generated by Schema Coverage Rotation · sonnet50 · 18.3 AIC · ⌖ 0.529 AIC ·

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions