Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Test Updating Project: dist/IO/t/*.t #22617

Open
jkeenan opened this issue Sep 21, 2024 · 6 comments
Open

Proposal for Test Updating Project: dist/IO/t/*.t #22617

jkeenan opened this issue Sep 21, 2024 · 6 comments
Labels
dist-IO issues in the dual-life blead-first IO distribution

Comments

@jkeenan
Copy link
Contributor

jkeenan commented Sep 21, 2024

I'd like to propose a small project aimed at updating tests in the Perl core distribution. This proposal has two intended audiences:

  • Core committers and other veteran committers who might be able to tell us why we should not embark on this project.

  • First-time or new contributors who will actually execute the project as a series of pull requests to be reviewed by core committers.

The focus of the project will be the 8 test files found in dist/IO/t which do not use either Test::More or the core distribution's own t/test.pl to generate TAP output. These test files, which date from the earliest days of Perl 5 (or possibly earlier), each generate output by using manually coded print ok or print not ok statements.

$ ack -L '^use Test::More' ../dist/IO/t/*.t | xargs ack -L 'test\.pl' | xargs ls |sort
../dist/IO/t/io_const.t
../dist/IO/t/io_dup.t
../dist/IO/t/io_pipe.t
../dist/IO/t/io_poll.t
../dist/IO/t/io_sel.t
../dist/IO/t/io_sock.t
../dist/IO/t/io_tell.t
../dist/IO/t/io_unix.t

Since it is cumbersome to include test descriptions (alternatively called 'names' or 'labels') in that approach, 7 of these 8 files have no descriptions whatsoever and the eighth has only a handful. So when a particular unit test fails, all we get is a number.

This is particularly annoying when one of these tests fails during smoke-testing (as io_poll.t did for me within the past week).

A separate pull request should be prepared for each file (in part to encourage multiple participants in this project). The first commit in each p.r. should simply convert a given file to use Test::More without adding any new descriptions. The second commit should add the descriptions. In the course of preparing test descriptions participants will necessarily have to learn a lot about I/O operations whose fundamentals date back to the early days of Unix. (I myself have rarely written Perl code directly using these operations, much less testing them.)

Core Committers: Is there any reason we should not convert these files to Test::More? @toddr @atoomic @ilmari @tonycoz

Once we've handled any objections we'll make a more formal call for volunteers.

@jkeenan jkeenan added Needs Triage dist-IO issues in the dual-life blead-first IO distribution labels Sep 21, 2024
@toddr
Copy link
Member

toddr commented Sep 21, 2024

Sounds good to me

@tonycoz
Copy link
Contributor

tonycoz commented Sep 22, 2024

Some of the tests use fork(), eg. io_sock.t, io_unix.t, and may not be convertible to Test::More.

@toddr
Copy link
Member

toddr commented Sep 23, 2024

Test2 has fork support. I'm unclear how much of it is in core now?

@oodler577
Copy link

@jkeenan I'm interested in helping if y'all move ahead with it

@Grinnz
Copy link
Contributor

Grinnz commented Sep 24, 2024

The whole Test2 core suite is core now, however note that updates to the IO dist could complicate its dual-life CPAN release (which works on many versions where the Test2 suite is not yet core). Though I don't see any reason not to add that dependency if it's useful. (And Test2::IPC, which seems to be the necessary component here, has been core for a decent while, but I don't know if it works with Test::More.)

@exodist
Copy link
Contributor

exodist commented Sep 24, 2024

Test2::IPC does work for Test::More.

I suggest using Test2::V0 over Test::More for debugging, and for performance. However if the deps are a problem Test2::IPC + Test::More will work and are supported on perl versions that include Test2::IPC but not Test2::V0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dist-IO issues in the dual-life blead-first IO distribution
Projects
None yet
Development

No branches or pull requests

6 participants