Skip to content

ES functional tests: assertion failures in esql/30_queries.sh and ingest/10_basic.sh #189

@MattDevy

Description

@MattDevy

Summary

Two generated ES functional test scripts run to completion but produce incorrect assertions, printing FAIL: expected <field> = <value> against live Elasticsearch output.

Observed in Buildkite ES functional matrix

FAIL: expected queries = [object Object]
  (from test/functional/es/esql/30_queries.sh)

FAIL: expected acknowledged = true
  (from test/functional/es/ingest/10_basic.sh)

Analysis

esql/30_queries.shexpected queries = [object Object] is a tell-tale sign the codegen serialised a nested JS object into the comparison literal with default String(value) instead of JSON.stringify. The match expression in the source YAML likely has a structured value (array/object) that the generator should either serialise with jq or assert field-by-field.

ingest/10_basic.shexpected acknowledged = true. Either (a) the CLI's --format=json output for this endpoint doesn't include acknowledged at the top level (e.g. wrapped in a data: envelope), or (b) the assertion is reading the wrong path. Worth diffing actual CLI output vs. what the generator assumes.

Suggested investigation

  1. Run both scripts against a local ES 9.1.0 with set -x and capture the actual CLI output.
  2. Compare against the match: / is_true: block in the upstream YAML to determine whether the issue is codegen (wrong path), CLI (output shape mismatch), or both.
  3. If it's codegen, add a mapper test covering object-valued match steps.

Acceptance criteria

  • Both scripts pass against ES 9.1.0 in CI.
  • Root cause identified (codegen vs. CLI output shape) and documented in the fix PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions