8000 Split the long checks of the jetdb-wasm package test into smaller ones by dominion525 · Pull Request #129 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Split the long checks of the jetdb-wasm package test into smaller ones - #129

Merged
dominion525 merged 1 commit into
mainfrom
test/split-long-js-tests
Oct 24, 2026
Merged

dominion525 merged 1 commit into
mainfrom
test/split-long-js-tests

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Three functions of crates/jetdb-wasm/tests/smoke.mjs, which scripts/test-wasm-package.sh runs against the Node.js and web builds of the package, were above the complexity thresholds of scripts/quality-check.sh (CC ≥ 10, cognitive ≥ 10 or SLOC ≥ 50). Each is now split into a function for each thing it checks, called by check() in the same order, and none of them is above the thresholds.
  • What the checks assert is unchanged: there are 149 assertions, as before. The value of a property, read by the same closure in two functions, is read by one function, propertyValue.
  • Functions above the thresholds: 144 → 141.
Function Before (CC / Cog / SLOC) After, the largest function Functions
checkRows 14 / 5 / 101 5 / 4 / 20 5
checkForms 19 / 1 / 79 7 / 1 / 18 4
checkProperties 13 / 1 / 26 8 / 1 / 13 2

🤖 Generated with Claude Code

…y check, to make them easier to read

- Split checkRows into five: the rows of a table, reading a part at a time, CSV, complex columns, and binary and BigInt values
- Split checkForms into four: the list and the properties, the controls, the streams, and a form and a report of the same name
- Split checkProperties into two: a table, and the type option
- Read the va
8000
lue of a property with one function, propertyValue, rather than the same closure in two places

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage

For 11a56b9.

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jetdb-cli/src/export.rs            108                11    89.81%           5                 0   100.00%          66                 6    90.91%           0                 0         -
jetdb-cli/src/form.rs              254                24    90.55%          19                 5    73.68%         152                 9    94.08%           0                 0         -
jetdb-cli/src/macro_cmd.rs         151                11    92.72%          11                 2    81.82%          81                 5    93.83%           0                 0         -
jetdb-cli/src/main.rs              864                38    95.60%          70                 2    97.14%         549                25    95.45%           0                 0         -
jetdb-cli/src/prop.rs              308                15    95.13%          33                 2    93.94%         186                10    94.62%           0                 0         -
jetdb-cli/src/query.rs              80                 4    95.00%           5                 0   100.00%          51                 1    98.04%           0                 0         -
jetdb-cli/src/vba.rs                74                 4    94.59%           5                 0   100.00%          47                 1    97.87%           0                 0         -
jetdb-wasm/src/lib.rs             3841                95    97.53%         246                 4    98.37%        2009                22    98.90%           0                 0         -
jetdb/src/catalog.rs               531                14    97.36%          41                 0   100.00%         304                 7    97.70%           0                 0         -
jetdb/src/complex.rs               917                32    96.51%          73                 0   100.00%         607                15    97.53%           0                 0         -
jetdb/src/crypto.rs               2284               210    90.81%         105                21    80.00%        1301               169    87.01%           0                 0         -
jetdb/src/csv.rs                   810                23    97.16%          65                 0   100.00%         453                 6    98.68%           0                 0         -
jetdb/src/data.rs                 4542               177    96.10%         254                 3    98.82%        2549               108    95.76%           0                 0         -
jetdb/src/ddl/access.rs             70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/mod.rs              2777                 8    99.71%         199                 2    98.99%        1503                 6    99.60%           0                 0         -
jetdb/src/ddl/mysql.rs              70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/postgres.rs           71                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/sqlite.rs             69                 0   100.00%           7                 0   100.00%          48                 0   100.00%           0                 0         -
jetdb/src/encoding.rs              284                 0   100.00%          30                 0   100.00%         153                 0   100.00%           0                 0         -
jetdb/src/file.rs                 1914                67    96.50%         110                 0   100.00%        1042                26    97.50%           0                 0         -
jetdb/src/form.rs                 3273               150    95.42%         233                10    95.71%        1773                69    96.11%           0                 0         -
jetdb/src/form2000.rs              762                21    97.24%          56                 1    98.21%         402                 4    99.00%           0                 0         -
jetdb/src/format.rs                620                 2    99.68%          41                 0   100.00%         408                 2    99.51%           0                 0         -
jetdb/src/lib.rs                     3                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
jetdb/src/macro_action.rs          299                19    93.65%          27                 3    88.89%         165                24    85.45%           0                 0         -
jetdb/src/macro_def.rs            2350                98    95.83%         179                 9    94.97%        1522                46    96.98%           0                 0         -
jetdb/src/macro_text.rs            783                24    96.93%          49                 2    95.92%         437                20    95.42%           0                 0         -
jetdb/src/map.rs                   416                13    96.88%          27                 0   100.00%         221                 5    97.74%           0                 0         -
jetdb/src/money.rs                 286                 0   100.00%          26                 0   100.00%         189                 0   100.00%           0                 0         -
jetdb/src/prop.rs                 1414                56    96.04%          88                 8    90.91%         744                63    91.53%           0                 0         -
jetdb/src/query.rs                2705                78    97.12%         184                 0   100.00%        1682                38    97.74%           0                 0         -
jetdb/src/relationship.rs          302                27    91.06%          12                 0   100.00%         187                17    90.91%           0                 0         -
jetdb/src/save_as_text.rs          574                27    95.30%          52                 3    94.23%         341                27    92.08%           0                 0         -
jetdb/src/storage.rs               596                46    92.28%          26                 1    96.15%         316                24    92.41%           0                 0         -
jetdb/src/table.rs                1589                61    96.16%          95                 2    97.89%         939                18    98.08%           0                 0         -
jetdb/src/timestamp.rs             413                 0   100.00%          43                 0   100.00%         232                 0   100.00%           0                 0         -
jetdb/src/vba.rs                   634                65    89.75%          54                16    70.37%         361                60    83.38%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            37038              1420    96.17%        2492                96    96.15%       21161               833    96.06%           0                 0         -

@dominion525
dominion525 merged commit 615b8df into main Oct 24, 2026
11 checks passed
@dominion525
dominion525 deleted the test/split-long-js-tests branch October 24, 2026 19:48
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

0