Repository navigation
Commit 64dd815
fix: CI — isolate
The prior integration-style test mocked the Registry module globally with
`mock.module(".../registry", ...)`, which leaks across all test files in
bun:test's single-process runner. That caused 14 unrelated tests in
`connections.test.ts`, `telemetry-safety.test.ts`, and
`dbt-first-execution.test.ts` to fail in CI.
Additionally, the test relied on `mock.module("@altimateai/altimate-core")`
to supply a fake `DataParitySession`. The npm-published 0.2.6 of that
package does not export `DataParitySession` (sessions are only in the
locally-built `altimate-core-internal` binary), and Bun's `mock.module`
cannot override a package that another test file has already imported —
so the integration test was structurally unreliable.
Resolution:
1. **Export pure SQL-builder helpers** from `data-diff.ts`
(`dateTruncExpr`, `buildPartitionWhereClause`) and unit-test them
directly. No module mocking required; the test directly exercises the
logic the CRITICAL/MAJOR fix changed.
2. **Move the `joindiff` + cross-warehouse guard earlier** in `runDataDiff`
— before the NAPI import. Semantically identical for callers (guard
still fires, same error message, `steps: 0`), but now it can be
integration-tested without any NAPI mock. Preserves end-to-end
wiring coverage for the guard.
3. **Rewrite `data-diff-cross-dialect.test.ts`** as pure-function unit
tests for the partition WHERE logic + a real `runDataDiff` call for
the joindiff guard. No more cross-file mock pollution.
Functionality unchanged:
- `runDataDiff` behavior for real callers is identical. The only
observable difference is error-ordering: if a caller simultaneously
omits NAPI and passes `joindiff + cross-warehouse`, they now get the
"joindiff requires same warehouse" error instead of the NAPI-missing
error. That's strictly better UX — NAPI availability is a deployment
concern, `joindiff`+cross-warehouse is a user error.
- `buildPartitionWhereClause` and `dateTruncExpr` are now exported but
semantically unchanged — same inputs, same outputs.
Test results:
- 2821 altimate tests pass, 0 fail
- 43 sqlserver driver tests pass, 0 fail
- The 19 remaining full-suite failures (`mcp/`, `tool/project-scan`,
`plan-approval-phrase`) are pre-existing on `main` and unrelated.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>data-diff-cross-dialect tests from other files1 parent 3ebcec1 commit 64dd815
2 files changed
Lines changed: 194 additions & 161 deletions
File tree
- packages/opencode
- src/altimate/native/connections
- test/altimate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
485 | 487 | | |
486 | | - | |
| 488 | + | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
| |||
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
| 570 | + | |
| 571 | + | |
568 | 572 | | |
569 | | - | |
| 573 | + | |
570 | 574 | | |
571 | 575 | | |
572 | 576 | | |
| |||
845 | 849 | | |
846 | 850 | | |
847 | 851 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | 852 | | |
867 | 853 | | |
868 | 854 | | |
| |||
889 | 875 | | |
890 | 876 | | |
891 | 877 | | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
892 | 914 | | |
893 | 915 | | |
894 | 916 | | |
| |||
897 | 919 | | |
898 | 920 | | |
899 | 921 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
| 922 | + | |
914 | 923 | | |
915 | 924 | | |
916 | 925 | | |
| |||
0 commit comments