feat(solver): Phase 1e — regression tests and ASMT export compatibility #296
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Verify that the pluggable solver refactor produces identical results to the direct OndselSolver integration. Add unit tests for the new components.
Parent: #287 (Phase 1)
Depends on: #295 (1d — AssemblyObject refactor)
Scope
Test categories
1. SolverRegistry unit tests
scan()with empty directory — no error, empty registryscan()with valid plugin — loads and registersscan()with bad plugin (missing symbol, wrong version) — warns and skipsregister_solver()— manual registration worksregister_solver()with duplicate ID — warns and skipsget()for known/unknown IDsset_default()/get_default()joints_for()aggregation across multiple solvers2. OndselAdapter unit tests
id(),name(),version()return expected valuessupported_joints()returns all expected BaseJointKind mappingsis_deterministic()returns truesupports_bundle_fixed()returns false3. Solve round-trip tests
Test assemblies that exercise each solver call pattern through the new interface:
One-shot solve:
Drag protocol:
pre_drag()+drag_step()+post_drag()sequenceSimulation protocol:
run_kinematic()with rotational motion — frames generatednum_frames()returns expected countupdate_for_frame()returns valid placements for each frame4. Joint type decomposition tests
Verify
buildSolveContext()correctly maps:5. Diagnostics tests
ConstraintDiagnostic(was:constraintSpec().starts_with("Redundant"))updateSolveStatus()outputlastRedundantJoints,lastHasRedundanciesflags set correctly6. ASMT export compatibility
exportAsASMT()produces valid .asmt file7. Orientation flip detection
validateNewPlacements()still catches >91-degree rotation flipsTest file locations
Comparison strategy
For the critical "no behavioral change" guarantee:
Acceptance criteria
References
src/Mod/Assembly/AssemblyTests/TestCore.py— existing test frameworksrc/Mod/Assembly/AssemblyTests/— test directory structuredocs/INTER_SOLVER.md§8 (Semi-deterministic behavior, tolerance-aware comparison)