Skip to content

Shorten two slow tests without changing the coverage - #1193

Merged
adtzlr merged 1 commit into
mainfrom
tests-cheaper-optimize
Oct 14, 2026
Merged

adtzlr merged 1 commit into
mainfrom
tests-cheaper-optimize

Conversation

@adtzlr

@adtzlr adtzlr commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Third PR of the series to speed up the tests (after #1191 and #1192). Two of the slowest items of the test suite cover no line which is not covered by other tests (checked by the coverage contexts of each test).

Changes

before after
test_optimize 10 s (18 s with coverage) 2 s
doctest of AnimationWriterPlugin 10–13 s 4–5 s
  • test_optimize: most of the time was spent in two fits. The model of Alexander stopped at the maximum number of function evaluations without convergence (500 evaluations, 4.6 s) and the model of Miehe, Göktepe and Lulei needed 429 evaluations (4.9 s). Alexander is removed from the fits with absolute residuals. Miehe, Göktepe and Lulei is replaced by Ogden in the fits with relative residuals, i.e. the array-valued material parameters (mu, alpha) are now also fitted with relative residuals (0.4 s). Each fit takes less than a second.
  • AnimationWriterPlugin: the rendering of a frame takes about 0.8 s. The example writes 5 instead of 11 frames (linsteps([0, 1, 0], num=2) instead of num=5).

The covered lines of the whole test suite are unchanged (130 missed lines of 9386, the same lines before and after). ruff OK.

No change of the package.

🤖 Generated with Claude Code


Generated by Claude Code

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (60cdd55) to head (c3ad085).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1193   +/-   ##
=======================================
  Coverage   98.61%   98.61%           
=======================================
  Files         225      225           
  Lines        9376     9376           
=======================================
  Hits         9246     9246           
  Misses        130      130           

☔ View full report in Codecov by Harness.
📢 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.

`test_optimize` fitted the models of Alexander and of Miehe, Göktepe and
Lulei, which took about 5 s each (Alexander's model stopped at the
maximum number of evaluations without convergence). The fits with
relative residuals use the model of Ogden instead, i.e. the array-valued
material parameters are also fitted with relative residuals. The test
takes about 2 s instead of 10 s.

The example of `AnimationWriterPlugin` writes 5 instead of 11 frames, the
rendering of a frame takes most of its time.

The covered lines of the whole test suite are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adtzlr
adtzlr force-pushed the tests-cheaper-optimize branch from 902531e to c3ad085 Compare October 14, 2026 15:01
@adtzlr
adtzlr merged commit 4f8e10c into main Oct 14, 2026
7 checks passed
@adtzlr
adtzlr deleted the tests-cheaper-optimize branch October 14, 2026 15:05
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