Skip to content

Commit

Permalink
docs: adding a testing infos file to guide everyone through tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinFillon committed May 12, 2024
1 parent ef3c90d commit fbcace1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It is strongly recommended that you install Nix for hacking on eza. We leverage
nix as a way to easily test and distribute eza to many users, and it allows us
to provide multiple tools easily for developers. Instead of having to install
each dependency manually and setting up a development environment, Nix allows
you to use the same environment as the devs use.
you to use the same environment as the devs use.

Therefore, it is useful that you have a version of Nix installed with the
"experimental" feature flakes enabled. Further, to make hacking on eza as easy
Expand Down Expand Up @@ -55,21 +55,24 @@ directory.

eza depends on [libgit2](https://github.com/rust-lang/git2-rs) for certain
features. If you’re unable to compile libgit2, you can opt out of Git support
by running `cargo build --no-default-features`. Again, the nix flake should
by running `cargo build --no-default-features`. Again, the nix flake should
have taken care of this for you, if not, please file an issue.

If you intend to compile for musl, you will need to use the flag
`vendored-openssl` if you want to get the Git feature working. The full command
is `cargo build --release --target=x86_64-unknown-linux-musl --features
vendored-openssl,git`.

If you want more information on the tests please read:
[testing on eza](https://github.com/eza-community/eza/blob/main/TESTING.md)

## Creating a PR

First, use the pull request template.

Please make sure that the thing you worked on... actually works. Make sure to
also add how you ensured this in the PR description. Further, it's expected
that you do your best to check for regressions.
that you do your best to check for regressions.

If your PR introduces a flag, you MUST:
- Add completions for bash, zsh, fish, nushell
Expand Down
28 changes: 28 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Testing eza

## Running tests

In order to run the tests in eza you need:
- [just](https://github.com/casey/just)
- [nix](https://nixos.org)

then either run:
- `just itest`
- `nix build -L trycmd-local`

## Modifying tests

In order to test your changes on eza, you will need to do one or multiple things in different cases.
You will need the additional tool
- [powertest](https://github.com/eza-community/powertest)

You will also need to modify the `devtools/dir-generator.sh` file if you want to add some test cases

### You added/modified an option

Please run `just regen` to regenerate powertesting. Then look into `tests/gen` or `tests/cmd` for any tests not passing

### You changed the output of eza

Please run `nix build -L trydump` or `just idump`
And lookout for any test no longer passing

0 comments on commit fbcace1

Please sign in to comment.