Skip to content

Add Java / Rust / C# to test-sibling auto-discovery #1

@Lucas2944

Description

@Lucas2944

Context: --include-tests walks each changed file and tries to find an adjacent test file. The detection rules live in guessTestSiblings() in src/pack.js.

Today it covers JS/TS (foo.tsfoo.test.ts, foo.spec.ts, __tests__/foo.test.ts) and Python (foo.pytest_foo.py).

Goal: add the common test-naming conventions for:

  • JavaFoo.javaFooTest.java (in the same dir, or under src/test/java/...)
  • Rustfoo.rstests/foo.rs and the convention of #[cfg(test)] blocks at the bottom of the file (we don't need to extract the test block; just include the file)
  • C#Foo.csFooTests.cs

Acceptance:

  • Each language returns plausible test paths from guessTestSiblings()
  • Returned paths are filtered against actual files-on-disk before being included (this already happens in the caller)
  • No tests added — verify by running node bin/prpack.js --include-tests on a small fixture and checking the output

Comment here before you start so we don't duplicate work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions