Skip to content

Insufficient test coverage for Stdin::Read on Windows "console mode" #93055

Open
@Patrick-Poitras

Description

@Patrick-Poitras

While implementing #91754, we came across a lack of test coverage for Stdin::Read. The function has two code paths, one of which is triggered when input is piped in, and the other is triggered when the user is calling the executable from the console. This "console mode" code path is, as far as I'm able to tell, entirely ignored by automated tests and the CI.

I was unable to get anything near automated to actually use the console mode. However, manually feeding it inputs is easy, and has been the main method of testing that code path since the path's creation. This is sub-optimal, and should be remedied.

We have a couple approaches that could be attempted, but I seek larger input from the community, since this is not a trivial problem.

  • Finding a way to mock the console mode in Windows
  • Have a toggleable flag that would allow for the console mode path to be diverted during testing. (This one I could implement, but I'd need to make sure it respects policy)
  • Not doing anything. As of now, this approach seems to not have caused very many issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions