Skip to content

test: expand schema tests — @sealed, Brotli Blob, array @indexed, schema-less table#1205

Open
claude[bot] wants to merge 2 commits into
mainfrom
claude/fix-1194
Open

test: expand schema tests — @sealed, Brotli Blob, array @indexed, schema-less table#1205
claude[bot] wants to merge 2 commits into
mainfrom
claude/fix-1194

Conversation

@claude

@claude claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds four integration test cases requested in #1194 (Section 3 Cat 1):

  • @sealed enforcement (schema-enforcement.test.mjs): REST PUT and operations-API insert with undeclared fields on a @sealed table are rejected with HTTP 400 and the "is not allowed" error message from Table.ts.
  • [String] @indexed element-level search (schema-enforcement.test.mjs): A table with an indexed array field is searched via the REST query syntax (?tags=value); records are returned only when their array contains the queried element, confirming per-element index storage via getIndexedValues.
  • Brotli Blob Content-Encoding: br pass-through (blob.test.mjs, new suite): A sourced blob resource that Brotli-compresses content and sets Content-Encoding: br in its get() response headers; the test verifies Harper passes that header through without re-compressing.
  • Schema-less table for MQTT retained messages (configuration.test.mjs): A table created with only a hash_attribute accepts arbitrary fields on insert; upsert to the same id replaces the previous record, matching retained-message semantics.

Test plan

  • npm run format:check — passes
  • npm run lint — passes
  • node --test integrationTests/apiTests/schema-enforcement.test.mjs — new suite passes (requires non-Windows runner)
  • node --test integrationTests/apiTests/configuration.test.mjs — new schema-less tests pass
  • node --test integrationTests/apiTests/blob.test.mjs — new Brotli suite passes (requires non-Windows/non-Bun runner)

Closes #1194

🤖 Generated with Claude Code

Add four test cases per issue #1194:

- @Sealed enforcement: PUT and operations-API insert with undeclared
  fields are rejected with HTTP 400 and "is not allowed" error.
  (schema-enforcement.test.mjs)

- [String] @indexed array element search: REST queries on an indexed
  array field return only records whose array contains the queried
  element. (schema-enforcement.test.mjs)

- Brotli Blob Content-Encoding pass-through: a sourced resource that
  stores Brotli-compressed bytes and sets Content-Encoding: br in the
  get() response delivers that header through Harper's REST layer.
  (blob.test.mjs — new Brotli Blob suite)

- Schema-less table for MQTT retained messages: a table created via the
  operations API with no declared attributes (only hash_attribute)
  accepts arbitrary fields; upsert correctly overwrites the record for
  the same id, modelling retained-message semantics.
  (configuration.test.mjs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed; no blockers found.

…mpression failure

The /brotlicache/ list endpoint responds with Content-Encoding: br, causing
supertest's automatic decompression to throw "Decompression failed" during the
readiness poll in restartHttpWorkers — which stalls the before() for 120s and
then fails. Switch to /openapi (the same probe the original blob suite uses),
which is brotli-free and a reliable HTTP-worker readiness signal.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@kriszyp kriszyp self-assigned this Jun 10, 2026
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.

Expand schema tests: @sealed enforcement, Brotli Blob, array @indexed search, schema-less table

1 participant