Universal, language-aware unit test runner.
Project description
universal-test-runner
The universal test runner is a zero-configuration, language-aware way to run your unit tests.
If you've run pytest
in this folder before, this tool invokes pytest
. Rust project? cargo test
coming right up. Is also clever about running all your go
module tests (regardless of how they're organized). No matter the command, all args are passed directly into the test runner.
Currently supports 5 languages, with more on the way.
Installation
UTR is available on PyPi:
pipx install universal-test-runner
Design Philosophy
- The runner itself should need no configuration - it Just Works
- It should pass all arguments through to the underlying test command
- It should have wide language and test runner support; please open an issue if your use case isn't supported!
Usage
Once installed, the command t
will be available. Run that in a folder with tests and it'll do its best to run your unit tests.
t
% t
====================== test session starts ======================
platform darwin -- Python 3.11.0, pytest-7.3.1, pluggy-1.0.0
rootdir: /Users/david/projects/universal-test-runner
collected 37 items
tests/test_matchers.py ......................... [ 67%]
tests/test_runner.py ............ [100%]
====================== 37 passed in 0.04s =======================
If it can't find
Supported Languages
- Python
- uses
pytest
if you've runpytest
before - looks for a
tests.py
file if not
- uses
- Rust
cargo test
- Go
- if there's a
X_test.go
, then runs a plaingo test
- if you pass any args at all, runs
go test your-args-here
- otherwise, runs
go test ./...
- if there's a
- Elixir
- runs
mix test
- runs
- Clojure
- runs
lein test
- runs
Upcoming Languages
- JS/TS
- if there's a
package.json
and it has atest
script, runs[package manager] test
, where[package manager]
is:yarn
if there's ayarn.lock
pnpm
if there's apnpm-lock.yaml
npm
otherwise
- if there's a
- Makefile
- looks for a line that starts with
test:
- looks for a line that starts with
Motivation
I work in a few languages at a time, so I've actually had a version of this in my dotfiles for a while. Also, as I've been doing Exercism's #12in23 program, I'm really switching languages. It's nice not to have to re-learn any muscle memory. Plus, increasingly complex bash
was holding me back.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file universal_test_runner-0.1.0.tar.gz
.
File metadata
- Download URL: universal_test_runner-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfe6511d8434aa42b382e3e2c78aabce7f1ea1c703febe8f8a29fde3301789ba |
|
MD5 | 085e46790edba5fa9bbf291a843f37f7 |
|
BLAKE2b-256 | 03930934a152510f16b422732de2c670517ebb7f16f5e05ff7ea71d4ec853cce |
File details
Details for the file universal_test_runner-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: universal_test_runner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3f5be033ec93512b0885b46a75427c5079e021e75c30262a17a16fe72d9446 |
|
MD5 | cecddd1d9a3c766701a8526cf747e1d4 |
|
BLAKE2b-256 | 82e4d3a6b5515bbfd91a2113adcfab2be4bcfab29345d20f60dac877342d9b6e |