Skip to content

fix(behat): retain escaped jq string assertions after removing legacy wrapper - #131

Merged
vitormattos merged 2 commits into
mainfrom
fix/jq-string-compat-red-20261102
Nov 4, 2026
Merged

vitormattos merged 2 commits into
mainfrom
fix/jq-string-compat-red-20261102

Conversation

@vitormattos

Copy link
Copy Markdown
Member

Root cause

After v1.6.4 replaced estahn/json-query-wrapper, the new JSON decoder unescaped the contents of jq string results. Existing Behat assertions compare against the previously preserved escaped representation, causing reproducible failures in LibreSign stable35 (e.g. groups_request_sign_policy.feature).

Changes

  • Add a Behat regression scenario with a nested JSON string containing escaped quotes; it fails before the fix and passes afterward.
  • Preserve the legacy escaped representation only when jq returns a JSON string, while continuing native JSON decoding for objects, arrays, booleans and numbers.

Validation

  • PHP 8.5: new scenario fails on v1.6.4 and passes with this correction.
  • PHP 8.5: existing JSON/jq matching and typed numeric assertions pass.
  • PHP 8.3: new regression and existing JSON/jq test pass.
  • php -l and git diff --check pass.

Tracked from LibreSign/libresign#9324. No Behat 4 migration changes.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos merged commit 0b54b3f into main Nov 4, 2026
11 checks passed
@vitormattos
vitormattos deleted the fix/jq-string-compat-red-20261102 branch November 4, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant