Skip to content

Add unit tests for FEMO core modules#3

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/suggest-tests-to-add
Draft

Add unit tests for FEMO core modules#3
Copilot wants to merge 4 commits into
mainfrom
copilot/suggest-tests-to-add

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown

This PR now implements the previously proposed test plan by adding unit tests under tests/ for core FEMO modules, while leaving original source code unchanged.

  • Scope

    • Added tests only in the tests directory.
    • No changes were made to production files in femo/fea or femo/csdl_opt.
  • Implemented test coverage

    • FEA registration APIs: add_input, add_state, add_output, add_field_output, and strong BC handling.
    • Utility behavior: findNodeIndices, locateDOFs (polar/cartesian handling), and import_mesh association-table/return contracts.
    • CSDL integration wiring: FEAModel, OutputOperation, and StateOperation core control/data-flow paths.
    • Import smoke coverage for key package entry modules.
  • Execution strategy used

    • Added dependency stubs/mocks in test scaffolding to isolate unit behavior from heavy FEniCS/PETSc runtime dependencies.
    • Implemented deterministic contract-level tests for all 12 requested test areas.
  • Validation

    • Ran: python -m pytest -q tests
    • Result: all added tests pass.
Original prompt

suggest a list of tests to be added to this repo. do not add anything yet.

Created from VS Code.

Copilot AI changed the title [WIP] Suggest tests to be added to the repository Propose prioritized test plan for FEMO core modules Jun 18, 2026
Copilot finished work on behalf of RuruX June 18, 2026 08:19
Copilot AI requested a review from RuruX June 18, 2026 08:19
@RuruX

RuruX commented Jun 18, 2026

Copy link
Copy Markdown
Owner

@copilot okay. create unit tests for all 12 tests. do not change the original code. only do addition to the tests directory.

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Author

@copilot okay. create unit tests for all 12 tests. do not change the original code. only do addition to the tests directory.

Implemented in commit 9e7e0da. I added a new /home/runner/work/femo/femo/tests directory with unit tests covering all 12 requested areas, and did not modify original source files.

Copilot AI changed the title Propose prioritized test plan for FEMO core modules Add unit tests for FEMO core modules Jun 18, 2026
Copilot finished work on behalf of RuruX June 18, 2026 08:28
@RuruX

RuruX commented Jun 18, 2026

Copy link
Copy Markdown
Owner

@copilot add doc strings to the unit tests

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Author

@copilot add doc strings to the unit tests

Addressed in commit f4da304: added docstrings to the unit tests under tests/ only.

Copilot finished work on behalf of RuruX June 18, 2026 08:51
@RuruX

RuruX commented Jun 18, 2026

Copy link
Copy Markdown
Owner

@copilot put the unit tests unter tests/unit/

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Author

@copilot put the unit tests unter tests/unit/

Addressed in commit 54fdb85: moved the unit test files into tests/unit/.

Copilot finished work on behalf of RuruX June 18, 2026 08:54
@RuruX

RuruX commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@copilot create a functional test to run the example optimization problem under examples/. Lay out the implementation plan first. do not make any changes.

@RuruX

RuruX commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@copilot rank the examples from easy to hard

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Author

@copilot rank the examples from easy to hard

Easy → hard (heuristic by coupling, preprocessing, external deps, and runtime):

  1. examples/poisson_opt/run_poisson_opt.py
  2. examples/nonlinear_poisson_opt/run_nonlinear_poisson_opt.py
  3. examples/beam_thickness_opt/run_thickness_opt_cantilever_beam.py
  4. examples/beam_topo_opt/run_topo_opt_cantilever_beam.py
  5. examples/aeroelasticity_vlm/static/csdl_without_feedback/run_aeroelasticity_static_wo_feedback.py
  6. examples/aeroelasticity_vlm/static/csdl_with_feedback/run_aeroelasticity_static_w_feedback.py
  7. examples/aeroelasticity_vlm/dynamic/run_aeroelasticity_dynamic.py
  8. examples/aeroelasticity_vpm/run_aeroelasticity_vpm.py
  9. examples/ongoing/shape_opt/run_shape_opt_roof.py
  10. examples/em_motor_opt/run_motor_opt.py
  11. examples/test_shell_m3l/run_pav_shell*.py (hardest; especially old_run_scripts/ variants).

Copilot finished work on behalf of RuruX June 19, 2026 07:53
@RuruX

RuruX commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@copilot testability-focused ranking only

@RuruX

RuruX commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@copilot show me the PR

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Author

@copilot show me the PR

Current PR summary:

  • Adds 12 FEMO core unit tests (no production code changes)
  • Adds docstrings to all added unit tests
  • Moves unit tests to tests/unit/

Latest commits on this branch:

  • 54fdb85 test: move unit tests into tests/unit
  • f4da304 test: add docstrings across unit test files
  • 9e7e0da Add tests for 12 planned coverage areas

Copilot finished work on behalf of RuruX June 19, 2026 07:56
@RuruX

RuruX commented Jun 19, 2026

Copy link
Copy Markdown
Owner

@copilot git status

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Author

@copilot git status

git status --short --branch returns:

## copilot/suggest-tests-to-add...origin/copilot/suggest-tests-to-add

Working tree is clean (no modified, staged, or untracked files).

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.

2 participants