Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Tests on incremental tables were rejected with "Running tests on incremental datasets is not yet supported", and includeTestsInCompiledGraph rejected them too. Accept them: RefReplacingContext.incremental() is false, so the test runs the full-refresh SELECT. A test on a dataset with no ahead-of-time query (JiT, or a JS publish() without .query()) now reports a compile error instead of crashing on undefined.trim(). Document what tests on incremental tables cover. Fixes dataform-co#2120
dmargol1
force-pushed
the
feat/incremental-unit-tests
branch
from
November 27, 2026 23:44
6865555 to
b1bbd47
Compare
This branch has not been deployed
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.
Fixes #2120. Related: #1132, #2117.
This implements the approach @ihistand proposed in #2120 and @kolina agreed to: allow tests on incremental tables, test the full-refresh query, and document the limitation.
Change
core/actions/test.ts: remove the "Running tests on incremental datasets is not yet supported" rejection.RefReplacingContext.incremental()is alreadyfalse, so an incremental table is tested with its full-refreshSELECT.core/session.ts:includeTestsInCompiledGraphrejected incremental tables too ("Tests are only supported for Tables and Views"). It now accepts them, so they depend on their tests like tables and views do.publish()without.query()) now gets a compile error saying so. Before, it crashed withCannot read properties of undefined (reading 'trim').core/README.md, theTestdoc comment anddocs/reference/test.md):SELECTis tested;when(incremental(), ...)still need inputs;self(),name(),schema()anddatabase()are empty strings in tests.Full-refresh testing becomes the default for incremental tables. Testing the incremental query itself, with an input for the current table as @kolina described, could be added later as an opt-in mode without changing existing tests.
Tests
The old "not yet supported" test is replaced by 9 tests in
core/actions/test_test.ts. All of them fail onmain.pre_operations,incremental_whereandpost_operationsare excluded.when()argument: they need an input.includeTestsInCompiledGraph: adds the dependency edge.table/view/incrementaland query-less JStable/incrementalall get it.bazel test //core/...passes, and ESLint and Prettier are clean on the changed.tsfiles.dataform testagainst BigQuery, with a CLI built from this branch and literal inputs, passes and fails the expected cases.🤖 Generated with Claude Code