Skip to content

tests: use %TESTNUMBER more instead of the actual test number - #23395

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/testnumber
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/testnumber

Conversation

@bagder

@bagder bagder commented Oct 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@bagder bagder added the tests label Oct 14, 2026
@bagder
bagder marked this pull request as ready for review October 14, 2026 12:16
@bagder
bagder requested a balanced review from Copilot October 14, 2026 12:16

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.

🟡 Changes recommended

Two substitutions target coincidental numeric fixture values rather than actual test identifiers.

2 open findings
What changed in this PR

Replaces hard-coded test identifiers with %TESTNUMBER across test fixtures and commands.

Changes:

  • Parameterizes URLs, paths, filenames, protocol expectations, and helper-script names.
  • Incorrectly parameterizes an unrelated HTTP date and shared ETag fixture.
File Description
tests/​data/​test998 Parameterizes request paths.
tests/​data/​test972 Parameterizes output filename.
tests/​data/​test971 Parameterizes helper script name.
tests/​data/​test753 Parameterizes FTP filename.
tests/​data/​test745 Parameterizes helper script name.
tests/​data/​test694 Parameterizes request path.
tests/​data/​test677 Parameterizes IMAP path.
tests/​data/​test676 Parameterizes cookie filename.
tests/​data/​test520 Parameterizes FTP paths and commands.
tests/​data/​test5018 Parameterizes upload filename.
tests/​data/​test464 Parameterizes URL path.
tests/​data/​test463 Parameterizes input filename.
tests/​data/​test399 Parameterizes configuration URL.
tests/​data/​test3500 Parameterizes helper script name.
tests/​data/​test3226 Parameterizes output filenames.
tests/​data/​test3225 Parameterizes output filenames.
tests/​data/​test3224 Parameterizes output filenames.
tests/​data/​test3223 Parameterizes output filenames.
tests/​data/​test2506 Parameterizes netrc and request paths.
tests/​data/​test2501 Parameterizes expected request path.
tests/​data/​test2380 Parameterizes output filename.
tests/​data/​test2102 Incorrectly parameterizes shared ETag.
tests/​data/​test2010 Incorrectly parameterizes HTTP date year.
tests/​data/​test1985 Parameterizes Digest request URIs.
tests/​data/​test1946 Parameterizes expected redirect location.
tests/​data/​test1945 Parameterizes expected redirect location.
tests/​data/​test1862 Parameterizes expected request path.
tests/​data/​test1707 Parameterizes helper script name.
tests/​data/​test1674 Parameterizes test-number comment.
tests/​data/​test1561 Parameterizes cookie path.
tests/​data/​test1544 Parameterizes helper script name.
tests/​data/​test1488 Parameterizes helper script name.
tests/​data/​test1486 Parameterizes helper script name.
tests/​data/​test1477 Parameterizes helper script name.
tests/​data/​test1460 Parameterizes expected error path.
tests/​data/​test1276 Parameterizes helper script name.
tests/​data/​test1275 Parameterizes helper script name.
tests/​data/​test1222 Parameterizes helper script name.
tests/​data/​test1177 Parameterizes helper script name.
tests/​data/​test1175 Parameterizes helper script name.
tests/​data/​test1173 Parameterizes helper script name.
tests/​data/​test1167 Parameterizes helper script name.
tests/​data/​test1165 Parameterizes helper script name.
tests/​data/​test1140 Parameterizes helper script name.
tests/​data/​test1139 Parameterizes helper script name.
tests/​data/​test1135 Parameterizes helper script name.
tests/​data/​test1119 Parameterizes helper script name.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/data/test2010 Resolved
Comment thread tests/data/test2102 Resolved
Comment thread tests/data/test1119 Outdated

<command type="perl">
%SRCDIR/test1119.pl %SRCDIR/.. ../include/curl
%SRCDIR/test%TESTNUMBER.pl %SRCDIR/.. ../include/curl

@vszakats vszakats Oct 14, 2026 •

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.

For in-repo Perl scripts like this and the others below
I fear this makes grepping for these filenames stop
returning their references.

Also these filenames don't change dynamically with
the test itself, meaning they may not help in practice
when cloning them.

For the non-in-source filename cases I like this change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, but when they are numbered as per the test case they are used within, it seems to me that figuring out the test should be easier than grepping! 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

but okay, I can restore the test%TESTNUMBER.pl replacements

@vszakats vszakats Oct 14, 2026 •

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.

Right, but when they are numbered as per the test case they are used within, it seems to me that figuring out the test should be easier than grepping! 😄

If one knows where to look, and if one remembers this when
looking, this is fine, yes. By experience, it's is easy to miss
even if ones know about it.

If there is something bigger in favor that I miss, it may be fine.

E.g. test*.pl scripts could perhaps be moved next to their
test* XML counterparts within data. This'd make the
connection obvious without repeating the name in the XML,
and without looking at all. (assuming alpha-sorted files.)

edit: but this would then make it less much less easy to
serial edit, or pick and edit the test*.pl scripts. So, not
sure if an overall improvement.

but okay, I can restore the test%TESTNUMBER.pl replacements

As-is, I'd prefer it the original way slightly more, I think.

@bagder
bagder force-pushed the bagder/testnumber branch from 6a7c8bb to 91f89c7 Compare October 15, 2026 22:13
@bagder bagder closed this in 8e3722b Oct 17, 2026
@bagder
bagder deleted the bagder/testnumber branch October 17, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants