Skip to content

fix(test): clean up PEC block test marks#142

Open
benvial wants to merge 2 commits into
gdsfactory:mainfrom
benvial:fix/pec-test-cleanup
Open

fix(test): clean up PEC block test marks#142
benvial wants to merge 2 commits into
gdsfactory:mainfrom
benvial:fix/pec-test-cleanup

Conversation

@benvial
Copy link
Copy Markdown
Member

@benvial benvial commented May 21, 2026

Summary

  • Remove dead PEC block skip tests that were duplicated
  • Restore PEC block tests as xfail instead of skip — they catch a real gmsh OpenCASCADE crash, not a known-passing feature

Details

PEC block boolean pipeline crashes in gmsh (Unknown OpenCASCADE entity). Tests were incorrectly skip-marked. xfail records the expected failure until the gmsh integration is fixed.

Standalone change, no dependencies on other PRs.

benvial added 2 commits May 21, 2026 14:12
PEC block boolean pipeline crashes in gmsh (Unknown OpenCASCADE entity).
Tests were incorrectly skip-marked — they catch a real bug. xfail records
the expected failure until the gmsh integration is fixed.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the TestPECBlockMesh test suite by replacing @pytest.mark.skip with @pytest.mark.xfail to track a known gmsh crash and modifies a layer name in the pec_block_sim fixture. Feedback suggests that changing the layer name to metal2 might cause a 'layer not found' error, potentially masking the intended crash. Additionally, because the crash occurs within a fixture, it may result in a test ERROR rather than an XFAIL, so moving the crashing call into the test functions was recommended.

sim.add_cpw_port("o1", layer="metal1", s_width=20, gap_width=15, length=5.0)
sim.add_cpw_port("o2", layer="metal1", s_width=20, gap_width=15, length=5.0)
sim.add_pec(gds_layer=PEC_LAYER, from_layer="metal1", to_layer="topmetal2")
sim.add_pec(gds_layer=PEC_LAYER, from_layer="metal1", to_layer="metal2")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The layer name was changed from topmetal2 to metal2. However, topmetal2 is used as the default layer name in _make_sim (line 58) and was previously used here. If the default stack created by set_stack (line 398) uses topmetal2, this change might cause the test to fail with a "layer not found" error during configuration, which would prevent the test from reaching the intended gmsh crash point. Please verify if metal2 is indeed the correct layer name in this context.

Suggested change
sim.add_pec(gds_layer=PEC_LAYER, from_layer="metal1", to_layer="metal2")
sim.add_pec(gds_layer=PEC_LAYER, from_layer="metal1", to_layer="topmetal2")

Comment on lines +407 to +410
@pytest.mark.xfail(
reason="PEC block surfaces cause gmsh boolean pipeline crash",
strict=False,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Applying @pytest.mark.xfail to the class is a good way to track known issues. However, note that the crash described in the reason occurs during sim.mesh() inside the pec_block_sim fixture (line 403). In pytest, a failure or crash within a fixture typically results in an ERROR status for the tests rather than an XFAIL. If you want these tests to specifically report as XFAIL, you might need to move the crashing sim.mesh() call into the test functions themselves or handle the fixture failure explicitly.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.18%. Comparing base (ccd7b62) to head (710d2c2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
+ Coverage   55.55%   56.18%   +0.63%     
==========================================
  Files          59       59              
  Lines        6966     6966              
  Branches     1270     1270              
==========================================
+ Hits         3870     3914      +44     
+ Misses       2697     2642      -55     
- Partials      399      410      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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