Skip to content

ci: only run smoke-test-examples on manual workflow_dispatch - #94

Merged
endolith merged 1 commit into
masterfrom
ci/gate-smoke-test-examples
Aug 6, 2026
Merged

ci: only run smoke-test-examples on manual workflow_dispatch#94
endolith merged 1 commit into
masterfrom
ci/gate-smoke-test-examples

Conversation

@endolith

@endolith endolith commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Background

smoke-test-examples runs the full stochastic example scripts (pytest tests/test_examples.py -m slow) to verify reference values against the published tables. It is useful for one-off checks when changing joblib/parallelism code.

Problem

The Monte Carlo output occasionally exceeds its tolerance by pure chance. On 6e08e9e (merge of #87) the job failed on weber_1977_effectiveness_table.py with a 4.206 deviation against atol=4.0; the identical example code then passed on fc3d1eb. Running it on every push/PR blocks merges randomly with no code change involved.

Visible symptoms

CI run 30938429399 shows smoke-test-examples failing with AssertionError: Max absolute difference among violations: 4.20580657 while every other job passes.

What this PR changes

  • Gate the smoke-test-examples job on github.event_name == 'workflow_dispatch'. The workflow already declares workflow_dispatch in on:, so the job stays available from the Actions tab for manual runs (skipped on push/PR). Slow tests remain excluded from normal pytest runs via the existing -m 'not slow' addopts.
  • Widen the per-script tolerances a little (e.g. weber_1977_effectiveness_table 4.0 -> 5.0, merrill_1984_table_1_fig_1 3.5 -> 4.0, others 3.0 -> 3.5, weber_1977_table_4 0.2 -> 0.3) to cut flake probability while still catching real regressions.

Tests

Tolerance values are read directly from TOLERANCES; no test logic changed. The gating is a CI-only change verified by parsing the workflow.

Summary by CodeRabbit

  • Tests
    • Updated example validation thresholds to accommodate expected variation in stochastic results.
  • Chores
    • Adjusted automated example smoke tests to run only when manually initiated.
    • Added documentation clarifying why these tests are skipped for pushes and pull requests.

The example scripts are slow stochastic Monte Carlo simulations whose
output occasionally exceeds its reference-value tolerance by pure chance
(e.g. weber_1977_effectiveness_table failed CI on 6e08e9e with a 4.206
deviation against atol 4.0, then passed on fc3d1eb with identical example
code). Running them on every push/PR therefore blocks merges randomly
with no code change involved.

Gate the job on workflow_dispatch so it stays available in the Actions
UI for one-off verification of joblib/parallelism changes but is skipped
on push and PR. Also widen the per-script tolerances (e.g. 4.0 -> 5.0 for
weber_1977_effectiveness_table) to reduce the chance of such flakes while
still catching real regressions.

Co-authored-by: opencode <opencode@anomalyco.ai>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a772e2a-e589-441c-afc7-b8ffe2a07af6

📥 Commits

Reviewing files that changed from the base of the PR and between fc3d1eb and 49b7604.

📒 Files selected for processing (2)
  • .github/workflows/python-package.yml
  • tests/test_examples.py

📝 Walkthrough

Walkthrough

The example smoke-test job now runs only on manual workflow dispatches. Example result comparisons use higher absolute tolerances for Merrill and Weber outputs.

Changes

Example smoke-test adjustments

Layer / File(s) Summary
Manual smoke-test execution
.github/workflows/python-package.yml
The smoke-test-examples job runs only for manually dispatched workflows.
Example result tolerances
tests/test_examples.py
The tests use higher absolute tolerances for Merrill and Weber example results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • endolith/elsim#87: Updates the same smoke-test workflow and example-result tolerances.
  • endolith/elsim#89: Modifies the same example-result comparisons for row-shape and emptiness validation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary CI workflow change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/gate-smoke-test-examples

Comment @coderabbitai help to get the list of available commands.

@what-the-diff

what-the-diff Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

  • Refined GitHub Actions Execution Process

    • The execution process of GitHub actions has been refined. This involves modifying the smoke-test-examples job to be performed only when triggered manually. This decision was taken to avoid potential random failures in the tests, thereby providing a more efficient testing process. Previously, this job was triggered by any changes made (push and pull request events).
  • Increased Tolerance Levels in Tests

    • To improve the accuracy of the testing process, tolerance values of a number of tests in the tests/test_examples.py file have been increased. A higher tolerance value implies greater flexibility in the tests, thus reducing the chances of errors. The specifics changes in each file are:
      • merrill_1984_table_1_fig_1.py: The value has increased from 3.5 to 4.0.
      • merrill_1984_table_2.py: The value has increased from 3.0 to 3.5.
      • merrill_1984_table_3_fig_3.py: The value has increased from 3.0 to 3.5.
      • merrill_1984_table_4.py: The value has increased from 3.0 to 3.5.
      • weber_1977_effectiveness_table.py: The value has increased from 4.0 to 5.0.
      • weber_1977_table_4.py: The value has increased from 0.2 to 0.3.

This PR brings about increased efficiency in the testing process by refining the error-detecting mechanism and granting higher resilience towards variability in the results.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.37%. Comparing base (fc3d1eb) to head (49b7604).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #94   +/-   ##
=======================================
  Coverage   96.37%   96.37%           
=======================================
  Files          17       17           
  Lines         496      496           
=======================================
  Hits          478      478           
  Misses         18       18           
Flag Coverage Δ
no-numba 95.76% <ø> (ø)
numba 88.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@endolith
endolith merged commit a261024 into master Aug 6, 2026
16 checks passed
@endolith
endolith deleted the ci/gate-smoke-test-examples branch August 6, 2026 02:46
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