You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Acceptance tests: internal/elasticsearch/index/indexmappings/acc_test.go, configs under internal/elasticsearch/index/indexmappings/testdata/
1) Attributes with no coverage
elasticsearch_connection (Optional block, injected by the envelope): not configured in any testdata config and not asserted in acc_test.go. Other Elasticsearch resources/data sources in this repo cover the entity-local connection block; this resource does not.
2) Attributes with poor coverage
mappings (Required, string with index.MappingsType{ExactDynamicTemplateNames: true} and StringIsJSONObject{NonEmpty: true})
Observed: validated indirectly via the custom helpers checkStateMappingsProperties, checkStateMappingsTopLevelKeys, checkStateMappingsDynamic*, etc.; the only direct attribute check is TestCheckResourceAttrSet(mappings) in _allTopLevelKeys.
Gaps:
No test that semantically-equal JSON (different key order / whitespace) produces an empty plan, which is the main reason for the custom type.
No test of an invalid (non-JSON / non-object, e.g. array) value. Only the empty-object case (_emptyMappings) is covered.
No test of field removal from the config on update (only additions: one_field -> two_fields, base -> with_dynamic, and full -> narrow after import).
id (Computed, string): matched against a regexp in several tests but never asserted to equal <cluster_uuid>/<index_name> with the actual index name, and explicitly ignored in ImportStateVerifyIgnore.
index (Required, string, RequiresReplace): force-new covered by _indexForceNew, but the check does not assert that the old index's mappings remain untouched after replacement (destroy is a no-op).
Prioritized top 5 gaps
elasticsearch_connection: add a test using the entity-local connection block (endpoints, insecure, auth) and assert elasticsearch_connection.#, .0.endpoints.*, .0.insecure plus auth via the shared acctest helpers.
mappings semantic-equality: add a step whose config has the same mappings with reordered keys / different whitespace and assert plancheck.ExpectEmptyPlan().
mappings invalid input: add steps with mappings = "not json" and mappings = "[]" using ExpectError.
mappings field removal on update: add a step removing a previously declared field and assert the plan/state tracks only the remaining fields while the field remains on the index (no-op removal semantics).
id value: add an assertion that id ends with /<index_name> (use TestCheckResourceAttrWith or a regexp built from indexName) and compare with the import ID in _import.
Concrete acceptance-test additions
TestAccResourceIndexMappings_elasticsearchConnection with a new testdata/.../apply config containing an elasticsearch_connection block (see existing tests for other resources using acctest.PreCheckWithExplicitElasticsearchEndpoint-style helpers).
Schema coverage report:
elasticstack_elasticsearch_index_mappings(resource)internal/elasticsearch/index/indexmappings/(schema.go,resource.go,create.go,update.go,read.go,delete.go)internal/elasticsearch/index/indexmappings/acc_test.go, configs underinternal/elasticsearch/index/indexmappings/testdata/1) Attributes with no coverage
elasticsearch_connection(Optional block, injected by the envelope): not configured in anytestdataconfig and not asserted inacc_test.go. Other Elasticsearch resources/data sources in this repo cover the entity-local connection block; this resource does not.2) Attributes with poor coverage
mappings(Required, string withindex.MappingsType{ExactDynamicTemplateNames: true}andStringIsJSONObject{NonEmpty: true})checkStateMappingsProperties,checkStateMappingsTopLevelKeys,checkStateMappingsDynamic*, etc.; the only direct attribute check isTestCheckResourceAttrSet(mappings)in_allTopLevelKeys._emptyMappings) is covered.one_field->two_fields,base->with_dynamic, andfull->narrowafter import).id(Computed, string): matched against a regexp in several tests but never asserted to equal<cluster_uuid>/<index_name>with the actual index name, and explicitly ignored inImportStateVerifyIgnore.index(Required, string,RequiresReplace): force-new covered by_indexForceNew, but the check does not assert that the old index's mappings remain untouched after replacement (destroy is a no-op).Prioritized top 5 gaps
elasticsearch_connection: add a test using the entity-local connection block (endpoints,insecure, auth) and assertelasticsearch_connection.#,.0.endpoints.*,.0.insecureplus auth via the sharedacctesthelpers.mappingssemantic-equality: add a step whose config has the same mappings with reordered keys / different whitespace and assertplancheck.ExpectEmptyPlan().mappingsinvalid input: add steps withmappings = "not json"andmappings = "[]"usingExpectError.mappingsfield removal on update: add a step removing a previously declared field and assert the plan/state tracks only the remaining fields while the field remains on the index (no-op removal semantics).idvalue: add an assertion thatidends with/<index_name>(useTestCheckResourceAttrWithor a regexp built fromindexName) and compare with the import ID in_import.Concrete acceptance-test additions
TestAccResourceIndexMappings_elasticsearchConnectionwith a newtestdata/.../applyconfig containing anelasticsearch_connectionblock (see existing tests for other resources usingacctest.PreCheckWithExplicitElasticsearchEndpoint-style helpers).TestAccResourceIndexMappings_semanticEquality(reordered keys -> empty plan).TestAccResourceIndexMappings_invalidMappings(non-JSON and array inputs)._update.idassertions in_basicand_import.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
api.anthropic.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.