Skip to content

test: multi-perspective improvement rotation (20 new tests, exit code fix, docs)#5

Open
SebTardif wants to merge 6 commits into
masterfrom
fix/improve-mpi-20260702-1
Open

test: multi-perspective improvement rotation (20 new tests, exit code fix, docs)#5
SebTardif wants to merge 6 commits into
masterfrom
fix/improve-mpi-20260702-1

Conversation

@SebTardif

Copy link
Copy Markdown
Owner

Summary

Multi-perspective improvement rotation across 14 perspectives.

Changes

QA Engineer (iteration 1):

  • Added 17 tests for error paths and edge cases across cli, parser, graph, cache
  • Fixed parser to reject bare rule (no name) which was an unreachable error path

Developer (iteration 2):

  • Refactored main.rs to destructure RuleResult::Failed fields instead of discarding them via matches!()

End User (iteration 3):

  • Added missing --version/-V flag to README CLI usage section
  • Updated test count in README

Spec/Contract Compliance (iteration 8):

  • Fixed --help and --version to print to stdout and exit 0 (was printing to stderr and exiting 1)
  • Introduced ParseOutcome enum to distinguish informational output from normal builds at the type level

Adversarial Tester (iteration 11):

  • Added 3 adversarial tests: double-dollar expansion, unicode rule names, large dependency lists

Post-cycle gate:

  • Updated test count to 56 in README

Test results

All 56 tests pass. make ci green locally (fmt, clippy, test, docs, lockfile, deny).

SebTardif added 6 commits July 2, 2026 13:59
QA Engineer perspective (MPI iteration 1):
- cli: help flag, unknown flag, missing --file value, invalid --jobs, duplicate target
- parser: indented line outside rule, empty rule name (bare 'rule'), trailing
  whitespace-only rule name, unknown top-level/rule directive, expand_vars edge
  cases (bare $ at end, unclosed brace), empty env key
- graph: self-cycle detection (a -> a)
- cache: empty/malformed deserialization

Also fixed parser to reject 'rule' with no name (previously unreachable
error path because trim() consumed trailing whitespace before strip_prefix).

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Developer perspective (MPI iteration 2):
Collect failures by destructuring RuleResult::Failed(name, reason) instead
of discarding the fields with matches!(). The executor's eprintln already
reports failures to stderr, so this prepares the data for any future
structured exit reporting without changing behavior.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
End User perspective (MPI iteration 3):
- Missing --version/-V flag in README CLI Usage section
- Test count was stale at 36 (now 53 after QA iteration)

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Spec/Contract Compliance perspective (MPI iteration 8):
Previously --help and --version used the Err path, printing to stderr
and exiting with code 1. Standard CLI convention is informational flags
print to stdout and exit 0 (only real errors exit non-zero).

Introduce ParseOutcome enum to distinguish Info (--help, --version) from
Run (normal build) at the type level. Tests updated accordingly.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Adversarial Tester perspective (MPI iteration 11):
- Double dollar ($$X) expansion behavior documented via test
- Unicode rule names (cafe with accent) work correctly
- Large dependency lists (50 deps) handled without issues

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Post-cycle gate B: documentation accuracy audit.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
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