Skip to content

Respect disabled node coverage when a rule raises - #27

Open
chupakobra6 wants to merge 1 commit into
iterorganization:developfrom
chupakobra6:codex/respect-error-coverage
Open

chupakobra6 wants to merge 1 commit into
iterorganization:developfrom
chupakobra6:codex/respect-error-coverage

Conversation

@chupakobra6

Copy link
Copy Markdown
Contributor

Related to #10.

When a rule raises, add_error_result() calls append_nodes_dict() even when node coverage is disabled. This can traverse a large IDS and add coverage to the report despite running without -nc / --node-coverage.

Apply the same track_node_dict guard already used by assert_(). Preserve the failed result and its exception/traceback. With coverage enabled, errors still register the filled nodes as uncovered.

Validation:

  • Six regression cases cover errors before/after an assertion, cross-IDS context, nonzero occurrences, coverage on/off, and real netCDF validation. They check the failed result, traceback, XML/text failure counts, and coverage output. With coverage disabled, the unit tests explicitly forbid filled-node traversal. Three cases fail on unchanged develop; all pass with this change.
  • Full suite: 191 passed, 2 existing skips on macOS/Python 3.12 with IMAS-Python 2.3.0, and on Python 3.10 with minimum IMAS-Python 2.2.0.
  • Integration run of both follow-ups with Speed up assert bookkeeping: cached node paths and lazy stacks #24 (22eb4cd): 287 passed, 3 expected skips on each of Linux arm64/Python 3.10–3.14.
  • Black, Flake8, MyPy, and Isort pass.

This removes unnecessary work on the rule-exception path. It does not change successful validation or claim to resolve all of #10.

This branch has not been deployed

No deployments
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