Skip to content

test: remove redundant tests, add workflow integration tests - #102

Merged
vvahidd merged 3 commits into
mainfrom
test/improve-test-suite
Apr 12, 2026
Merged

test: remove redundant tests, add workflow integration tests#102
vvahidd merged 3 commits into
mainfrom
test/improve-test-suite

Conversation

@vvahidd

@vvahidd vvahidd commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove ~35 low-value tests (import smoke tests, Pydantic default assertions, model_dump checks)
  • Add 27 Meep workflow integration tests covering validate → build_config → write_config
  • Add 20+ Palace workflow integration tests covering DrivenSim, EigenmodeSim, ElectrostaticSim end-to-end (configure → mesh → write_config)

Net result: 279 → 299 tests, with much better coverage of actual workflows vs model defaults.

Removed

  • test_gsim.py: 7 import-only smoke tests
  • test_mesh.py: 3 GroundPlane/MeshPreset default-value tests
  • test_meep_models.py: PortData, LayerStackEntry, MaterialData model_dump tests; ImportWithoutMeep
  • test_simulation.py: TestModeSource.defaults, TestDomain.defaults, TestStoppingFields.defaults, TestFDTD.defaults, TestFDTDDiagnostics, TestMaterial.basic/with_extinction, TestImports

Added

  • 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

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
vvahidd added 2 commits April 12, 2026 06:54
- 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
@vvahidd
vvahidd merged commit 1a438fb into main Apr 12, 2026
5 checks passed
@vvahidd
vvahidd deleted the test/improve-test-suite branch April 12, 2026 05:08
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