test: remove redundant tests, add workflow integration tests - #102
Merged
Conversation
Remove ~35 low-value tests: - 7 import smoke tests in test_gsim.py - 3 GroundPlane/MeshPreset default-value tests in test_mesh.py - 5 model_dump/default tests in test_meep_models.py - ~20 pure-default tests in test_simulation.py Add Meep workflow integration tests (27 tests): - Validation, build_config, write_config, stopping modes - Different component types (straight, MMI, bend) Add Palace workflow integration tests (20+ tests): - DrivenSim, EigenmodeSim, ElectrostaticSim end-to-end - CPW ports, inplane ports, terminals - Validation errors, material overrides, numerical config
- Guard iteration over self.ports and self.cpw_ports with `or []` in _configure_ports_on_component() — ElectrostaticSim sets both to None - Make config-reading tests call write_config() themselves so they work with random test ordering (pytest-randomly) - Fix test_missing_output_dir assertion — validate_config() doesn't check output_dir, that's enforced at mesh() time
- Fix typo in config_generator validation: accept "electrostatic" (matching ElectrostaticSim.simulation_type) alongside "electrostatics" - Replace electrostatic write_config tests with a single test that asserts NotImplementedError — config generation for this sim type is a known placeholder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Net result: 279 → 299 tests, with much better coverage of actual workflows vs model defaults.
Removed
test_gsim.py: 7 import-only smoke teststest_mesh.py: 3 GroundPlane/MeshPreset default-value teststest_meep_models.py: PortData, LayerStackEntry, MaterialData model_dump tests; ImportWithoutMeeptest_simulation.py: TestModeSource.defaults, TestDomain.defaults, TestStoppingFields.defaults, TestFDTD.defaults, TestFDTDDiagnostics, TestMaterial.basic/with_extinction, TestImportsAdded
tests/meep/test_workflow.py: validation, build_config pipeline, write_config output files, stopping modes, different component types (MMI, bend)tests/palace/test_workflow.py: DrivenSim (CPW + inplane ports), EigenmodeSim, ElectrostaticSim full workflows; validation error tests; material overrides; numerical config