Repository navigation
Conversation
A transform test pins a transform's behaviour without touching real data: every table it reads is replaced by an input fixture, the transform runs into a temp table, and each expectation checks that output. `transform-test list/get/create/update/delete/run` over `/api/transform-test`, with the schemas the endpoint speaks — inputs as SQL or inline rows, expectations as `empty` or `equals`, and a run report naming what each expectation found. `run` exits non-zero when the test does not pass, so it drops into CI as it stands. Gated at v64, the first version serving the endpoint. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The server closes `::transform-test.create` and `::transform-test.update`, so a body cloned from `get` earned an opaque 400. Closing them here names the offending key instead; a stored test needs `id`, `entity_id`, `creator_id`, `created_at` and `updated_at` stripped before it can be sent back, which the command help, the README and the transform skill now say. `get` projects through the compact view, so `--full` is what shows `inputs` and `expectations` — the examples and docs advertise it. An `equals` expectation needs `format: "sql"` or `format: "rows"`, which the docs omitted, leaving a body written from them to fail on a three-branch union error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`equals` pins the exact rows; `empty` asserts an invariant the row data alone would not show. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Published Install: |
…to test philosophy and design
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Published Install: |
# Conflicts: # packages/cli/skill-data/core/SKILL.md # packages/cli/src/runtime/command-help.test.ts # packages/client/src/domain/transform-test.ts # packages/client/src/index.ts # packages/client/src/resources/transform-test.test.ts # packages/client/src/resources/transform-test.ts
|
Published Install: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
mb transform-test list | get | create | update | delete | runover/api/transform-test.A transform test pins a transform's behaviour without touching real data: every table the transform reads is replaced by an input fixture, the transform runs into a temp table, and each expectation checks that output. The temp tables are dropped when the run ends.
tableand carry eitherformat: "sql"with a query, orformat: "rows"withcolumns(each with thedatabase_typethe warehouse accepts as aCASTtarget) androws.type: "empty"(this SQL must return no rows) ortype: "equals", which takes the sameformatsplit as an input.runreports what each expectation found — the rows a comparison disagreed on, or a sample of what anemptyquery returned — and exits non-zero when the test does not pass, so it drops into CI as it stands.get --fullshows theinputsandexpectations; the compact form is id, transform, name and description.Create and update bodies are closed, matching the server's own closed maps, so a body cloned from
get --fullis refused client-side with the offending key named rather than earning an opaque 400 — stripid,entity_id,creator_id,created_atandupdated_atto send it back.Commands are gated at
minVersion: 64, the first version serving the endpoint.Testing
bun run checkpasses:tsc --noEmit,oxlint,oxfmt --check, 1336 unit tests across 120 files,lint:skills.Wire-level unit tests cover every method in
packages/client/src/resources/transform-test.test.ts— the list query with and withouttransform-id, get, create, update, delete, and run, including that the run report keeps the server's kebab-case keys (row-counts,extra-rows,cell-mismatches).packages/client/src/domain/transform-test.test.tscovers the closed write-path bodies both ways: the keys a cloned body is refused for, and that it parses once they are stripped.No e2e lane was run: no released Metabase serves
/api/transform-testyet — the endpoint is on an unmerged branch (metabase#82495). The e2e tier needs a live server, so this ships with unit coverage only, and an e2e suite should follow once a server with the endpoint is available.🤖 Generated with Claude Code