This URL is how to find and run the test command in a GitHub project you just cloned. CONTRIBUTING, package.json scripts, Makefile, pytest.ini, cargo test, go test, Gradle. Then run the smallest relevant suite before you change anything, and the same suite after the patch.
It is not how to pick a labeled test ticket as your first merge. That is tests as a first contribution. It is not how to land a specified issue without reading the whole architecture. That is contribute without knowing the codebase. It is not a11y. It is not writing the issue. It is not ticket search.
You already have a repo on disk and a change in mind. The job is: discover how this project runs tests, then prove the patch with the smallest command that covers the files you touched.
Why the command lives in the repo, not in a blog
Every stack has a default. Projects override it. They pin a runner, they wrap it in make test-unit, they skip integration unless you export a token. If you invent the command from memory, you either miss the suite that would have failed, or you spend an hour installing a tool they do not use.
Contribution guidelines already tell you to extract the test command in ten minutes. This page is the map of where that command hides and how small you can make the run.
Search order
Stop at the first source that names a command. Copy it. Do not mix two sources.
- CONTRIBUTING.md in the root, .github/, or docs/. Headings named Tests, Running tests, Development, Getting started. Copy the exact line they print.
- README Development or Testing section. Same rule: copy, do not paraphrase.
- Scripts in the Node manifest. Names: test, test:unit, test:ci, check. Prefer unit over e2e for a first patch. Infer the package manager from the lockfile.
- Makefile or justfile. Targets named test, check, unit. The test target is often a wrapper; read the recipe.
- Language config files when the docs are silent.
If two files disagree, CONTRIBUTING wins.
Language-shaped clues
You do not need the whole architecture. You need the runner.
JavaScript and TypeScript. Scripts in the Node manifest. Jest, Vitest, Mocha, node:test. A vitest config or jest config confirms the runner. For a patch in one package of a monorepo, run that workspace only. Language-specific issue lists live on the TypeScript and JavaScript hubs; this page is still the command, not the ticket.
Python. pytest.ini, the pytest table in pyproject.toml, tox.ini, noxfile.py, Makefile. Default is often pytest or python -m pytest. If they use tox, a host pytest may miss the env they CI with. Python issues is the hub; the test binary is here.
Go. From module root, go test ./… or a narrower path next to the file you edited. A Makefile may add -race or build tags. The smallest suite is the package directory that holds the change.
Rust. cargo test. Optional package flag or a test name. cargo nextest only if CONTRIBUTING says so.
Java and Kotlin. The Gradle wrapper test task, or Maven test. Android modules often expose a unit-test task. Do not start an emulator for a unit-test patch.
Other. mix test for Elixir, bundle exec rspec or rake test for Ruby, dotnet test for C#. The pattern is the same: named command in docs or the ecosystem default, then narrow it.
Smallest relevant suite
Full CI on a laptop is a trap. Integration tests want Docker, a database, cloud credentials. Your first patch usually does not.
Narrow by path, by name filter, or by package. A single test file next to the change is enough when the project allows it.
Run that command before the patch (baseline). If it already fails, stop. You cannot claim your change caused a red that was already red, and you should not fix unrelated failures in the same pull request.
Run the same command after the patch. Same filter. If you added a test, the filter should include the new name.
If the project forbids skipping the full unit job, run that job instead of inventing a narrower filter. Their guide wins.
What you need installed
Match the version they pin. Node files: .nvmrc, .node-version, engines in the Node manifest. Use nvm, fnm, or asdf if your global Node is wrong. Then install with the tool the lockfile implies. Do not delete the lockfile.
Python: .python-version, requires-python. A venv, then the extra the guide names (dev extras, Poetry, uv). Go, Rust, Java: versions in go.mod, rust-toolchain.toml, or the Gradle wrapper. The wrapper is the point; do not install a random Gradle.
If install fails, that is a setup problem, not a reason to skip tests and hope CI is green. Say so in the PR description: the command you tried, the error, what you ran instead. Do not claim CI will catch it.
Before and after on the same command
Write the command in the PR body exactly. Name the filter. If you could only run unit tests because Docker was not available, say you skipped e2e and why. Honest and narrow is better than a fake all-green claim.
A parser, a CLI flag, or a new table case does not need a screenshot. The command is the evidence.
What this page is not
Picking an add-tests issue, labels, coverage gaps, and what a small test PR looks like: tests as a first contribution.
Bounding how much code to read for a docs string or one function: contribute without knowing the codebase.
Claiming the issue: how to claim a GitHub issue. Filling the PR template: how to write a pull request description.
Hunt live issues on Help Wanted after you can run the suite. The hub does not replace the command in the repo.
Related
- Tests as a first contribution — pick a test or coverage issue
- Contribute without knowing the codebase — bound the read
- How to read contribution guidelines — extract the test line in ten minutes
- How to write a pull request description — put the command in the body
- Documentation as a first contribution — when the change is docs, still run what they ask
- How to pick an issue that will get merged — choose the ticket; this page is the runner
FAQ
I cannot find a test command. Can I skip tests?
No. Look again: CONTRIBUTING, README, scripts in the Node manifest, Makefile, then language defaults. If the repo truly has no tests, say that in the PR and describe the manual check. Do not invent a Node test script on a Go module.
Is the default test script always right for a JS repo?
Only if that script is what CONTRIBUTING or the test key actually runs. Prefer the unit script for a first patch. Use the package manager the lockfile implies.
Should I run the full CI job locally?
Not if it needs Docker, secrets, or a long e2e grid. Run the smallest suite that covers your files, and name what you skipped.
The suite was already red. Do I still patch?
Do not stack your change on a broken baseline unless the issue is that failure. Comment with the command and the error. Unrelated red in your PR looks like you caused it.
Do I paste the whole test log in the PR?
No. The command, the filter, pass or fail. A snippet of a failure you fixed is enough. Maintainers will run CI.
Does a docs-only patch need this?
If CONTRIBUTING asks you to run a docs build or a link checker, run that. If they only ask for unit tests and you did not touch code, say n/a and why. Do not skip a required check because the diff is markdown.