Skip to content

runtests: add options to set minimum number of tests, use them - #19942

Closed
vszakats wants to merge 16 commits into
curl:masterfrom
vszakats:minruntests
Closed

runtests: add options to set minimum number of tests, use them#19942
vszakats wants to merge 16 commits into
curl:masterfrom
vszakats:minruntests

Conversation

@vszakats

@vszakats vszakats commented Dec 12, 2025

Copy link
Copy Markdown
Member

To detect mistakes made in the runtests framework that reduce
the number of test runs. Before this patch it could go undetected with
a green CI.

The minimum thresholds will need light maintenance going forward (either
bumping them periodically, or adjust if some may fell below minimums for
justified reasons). We may also make minimums tighter or looser, or more
job-specific.

Latest number of test runs for each job can be seen at Test Clutch:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:

  • GHA: set minimums.

Assisted-by: Dan Fandrich

Follow-up to f2a75a1
Follow-up to bb1391f #19510


https://github.com/curl/curl/pull/19942/files?w=1
https://github.com/curl/curl/pull/19942/changes?w=1

  • set CURL_TEST_MIN in more workflows/jobs.
  • it would be nice for pytest too. (not in this PR)

@vszakats vszakats added the tests label Dec 12, 2025
@vszakats
vszakats marked this pull request as draft December 12, 2025 00:58
@github-actions github-actions Bot added the CI Continuous Integration label Dec 12, 2025
@vszakats vszakats changed the title runtests: add option to set minimum number of tests runtests: add options to set minimum number of tests Dec 12, 2025
@vszakats
vszakats requested a review from Copilot December 12, 2025 02:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds functionality to enforce a minimum number of tests to run in the test suite, helping detect CI configurations that inadvertently skip most tests. The feature can be set via the --min command-line option or the CURL_TEST_MIN environment variable, with the command-line option taking precedence.

Key changes:

  • Adds --min=[count] option to runtests.pl for setting minimum test count
  • Implements validation logic that fails the test run if fewer than the minimum tests are executed
  • Sets global minimum of 1600 tests for Linux CI and specific minimums for various test configurations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/runtests.pl Implements --min argument parsing and validation logic to enforce minimum test counts
tests/globalconfig.pm Declares and exports the $mintotal global variable for tracking minimum test requirements
docs/runtests.md Documents the new -min option and its relationship to the CURL_TEST_MIN environment variable
.github/workflows/linux.yml Sets default minimum test count (1600) and configures specific minimums for individual test jobs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/runtests.pl Outdated
Comment thread docs/runtests.md Outdated
Comment thread docs/runtests.md Outdated
Comment thread tests/runtests.pl Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/runtests.pl
@vszakats
vszakats marked this pull request as ready for review December 12, 2025 02:39

@bagder bagder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent. We need this!

@vszakats

Copy link
Copy Markdown
Member Author

(since yesterday's GitHub update, files?w=1 links no longer work to show diff w/o whitespace changes. This breaks hundreds of such links I put in PR messages. It's been renamed to changes?w=1 apparently.)

@vszakats vszakats changed the title runtests: add options to set minimum number of tests runtests: add options to set minimum number of tests, use them Dec 12, 2025
@vszakats vszakats closed this in 3f1cd80 Dec 12, 2025
@vszakats
vszakats deleted the minruntests branch December 12, 2025 11:20
@jay

jay commented Dec 12, 2025

Copy link
Copy Markdown
Member

(since yesterday's GitHub update, files?w=1 links no longer work to show diff w/o whitespace changes. This breaks hundreds of such links I put in PR messages. It's been renamed to changes?w=1 apparently.)

In my opinion that is a bug in the beta test. I have reported it here.

Check if you have beta / "new experience" / preview enabled:

preview

@vszakats

Copy link
Copy Markdown
Member Author

@jay Phew, thanks for the tip and reporting it. I did have it enabled. Turned it off
now. This may also explain the odd Copilot change-grouping features and maybe
even the inexplicably slow performance, I shall see.

@vszakats

Copy link
Copy Markdown
Member Author

First bug caught by this feature: #19973 (via the Vista patch #18009)

vszakats added a commit to vszakats/curl that referenced this pull request Dec 15, 2025
vszakats added a commit that referenced this pull request Dec 15, 2025
Also increase the minimum for FreeBSD.

Ref: #19987
Follow-up to 3f1cd80 #19942
Closes #19988
vszakats added a commit that referenced this pull request Dec 16, 2025
For Test Clutch.

If set (via env or tflags), include the minimum number of tests required
in runtests' log output:
```
* Min tests: 1750
```

Follow-up to 3f1cd80 #19942

Closes #19987
vszakats added a commit that referenced this pull request Dec 20, 2025
Tailored for each job with a relatively tight limits. Also with no
tolerance in valgrind tests: 4 of the 4 has to be run.

Based on Test Clutch feature matrix which displays the minimum and
actual number of tests:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- runtests.pl: include total number of tests in the error message shown
  when the limit was not met.

Assisted-by: Dan Fandrich
Follow-up to 3f1cd80 #19942

Closes #20050
vszakats added a commit to vszakats/curl that referenced this pull request Jan 23, 2026
Before this patch CI silently ignored stunnel install failures. This
pushed the failure to the test run step due to not meeting the minimum
number of tests.

Make the root cause obvious by failing early in this case.

Reported-by: Stefan Eissing
Follow-up to 3f1cd80 curl#19942
vszakats added a commit that referenced this pull request Jan 23, 2026
Before this patch CI silently ignored stunnel install failures. This
pushed the failure to the test run step due to not meeting the minimum
number of tests.

Make the root cause obvious by failing early in this case.

Reported-by: Stefan Eissing
Follow-up to 3f1cd80 #19942
Ref: https://github.com/curl/curl/actions/runs/21245626382/job/61134101176?pr=20397
Ref: #16819

Closes #20409
vszakats added a commit that referenced this pull request Aug 18, 2026
Set the default to `CURL_TEST_MIN` if set, first. Then process the
command-line options to override it. Previously, the env took over if
the command-line explicitly tried to set it to zero.

Ref: #22617

Follow-up to 3f1cd80 #19942

Closes #22618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration tests

Development

Successfully merging this pull request may close these issues.

4 participants