Skip to content

test: cover plain iteration under OpenResty#114

Merged
membphis merged 1 commit into
mainfrom
test/openresty-plain-iteration
May 31, 2026
Merged

test: cover plain iteration under OpenResty#114
membphis merged 1 commit into
mainfrom
test/openresty-plain-iteration

Conversation

@membphis
Copy link
Copy Markdown
Collaborator

@membphis membphis commented May 31, 2026

Summary

  • Add OpenResty smoke assertions for plain pairs(decoded) over qjson lazy objects.
  • Add OpenResty smoke assertions for plain ipairs(decoded.list) over qjson lazy arrays.
  • Keep the coverage in the OpenResty runtime job so stock LuaJIT CI remains portable.

Test Plan

  • cargo build --release
  • OPENRESTY_IMAGE=openresty/openresty:1.29.2.4-0-jammy OPENRESTY_FULL_BUSTED=false .github/scripts/run-openresty-runtime.sh
  • OPENRESTY_IMAGE=openresty/openresty:1.21.4.4-0-jammy OPENRESTY_FULL_BUSTED=false .github/scripts/run-openresty-runtime.sh
  • OPENRESTY_IMAGE=openresty/openresty:1.27.1.2-0-jammy OPENRESTY_FULL_BUSTED=false .github/scripts/run-openresty-runtime.sh
  • OPENRESTY_IMAGE=openresty/openresty:1.29.2.4-0-jammy OPENRESTY_FULL_BUSTED=true .github/scripts/run-openresty-runtime.sh

Summary by CodeRabbit

  • Tests
    • Expanded smoke-check test coverage for QJSON decoding and iteration functionality. New assertions validate the collection and ordering of keys and values through proper iteration mechanisms, verify that decoded values match expected nested structures, and confirm proper behavior when iterating list elements. These enhancements improve overall test robustness.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b21491f3-8e56-4a4e-8523-0ce2926b8e94

📥 Commits

Reviewing files that changed from the base of the PR and between 9d6c927 and 0081d2d.

📒 Files selected for processing (1)
  • .github/scripts/openresty-smoke.lua

📝 Walkthrough

Walkthrough

This PR extends smoke-check coverage for the QJSON library by adding assertions that validate iteration over the decoded result. The changes add pairs and ipairs iteration logic with assertions to verify top-level key contents and nested/list values in the test harness.

Changes

QJSON Iteration Coverage

Layer / File(s) Summary
Decode iteration assertions
.github/scripts/openresty-smoke.lua
Added assertions that iterate the decoded QJSON document using pairs to capture and validate top-level keys and their mapped values, and using ipairs to capture and validate list element values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • api7/lua-qjson#99: Establishes the baseline smoke-check coverage for decoded data structures; this PR extends that coverage with specific iteration (pairs/ipairs) validation.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: cover plain iteration under OpenResty' accurately summarizes the main change, which adds smoke-check coverage for plain iteration (pairs and ipairs) over QJSON decoded results in the OpenResty runtime environment.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
E2e Test Quality Review ✅ Passed PR adds plain pairs/ipairs E2E tests to openresty-smoke.lua with clear assertions, valid key order checks, and nested value validation, matching all stated objectives.
Security Check ✅ Passed Test/smoke-check script with hardcoded test data only; no sensitive data, credentials, database operations, authorization logic, TLS configs, or secret references detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/openresty-plain-iteration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@membphis membphis merged commit cf87fd4 into main May 31, 2026
14 checks passed
@membphis membphis deleted the test/openresty-plain-iteration branch May 31, 2026 08:23
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