Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Jun 2, 2023
1 parent 27b27c0 commit d9a2cc8
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 73 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## v0.2.0 - 2023-06-02

### Breaking Changes

- `namaka review` now runs `nix eval .#checks` by default instead of `nix flake check`.
You can override this behavior by editing `namaka.toml` or using the `--cmd` flag.
- When provided a directory, namaka now changes the working directory to it,
instead of modifying the `nix` commands it runs.
This can make a difference if you specify both the directory and `--cmd`.

### Features

- Local configuration with `namaka.toml`
- `namaka clean` to remove unused and pending snapshots
- Add `subflake` template for using namaka in a subflake

### Improvements

- `namaka review` now runs faster by default,
since the default command has been changed to `nix eval .#checks`.

## v0.1.1 - 2023-05-02

### Features
Expand Down
100 changes: 41 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "namaka"
version = "0.1.1"
version = "0.2.0"
authors = ["figsoda <[email protected]>"]
edition = "2021"
description = "Snapshot testing for Nix based on haumea"
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ A list of available versions can be found on the
## Usage

```
Usage: namaka [OPTIONS] <COMMAND>
Usage: namaka [OPTIONS] [DIR] <COMMAND>
Commands:
check Wrapper around `nix flake check` to prepare snapshots for failed tests [aliases: c]
clean Remove unused and pending snapshots [aliases: cl]
review Review pending snapshots and selectively accept or reject them [aliases: r]
help Print this message or the help of the given subcommand(s)
Arguments:
[DIR] Change to this working directory
Options:
-c, --cmd <CMD>... Command to run instead of `nix flake check`
-h, --help Print help (see more with '--help')
Expand Down Expand Up @@ -77,6 +81,30 @@ Ignore the `_snapshots` directory, as it is automatically generated by namaka.
The rest of the available options are documented in [`haumea.load`],
as they will function exactly the same.

## Configuration

`namaka` will try to read `namaka.toml` in the working directory.
Here is an example configuration file (all fields are optional):

```toml
# namaka.toml

# change the working directory
# this stacks with the command line option
#`namaka check bar` will read `bar/namaka.toml` and change the working directory to `bar/foo`
dir = "foo"

[check]
# the command to run with `namaka check`
# defaults to `nix flake check --extra-experimental-features "flakes nix-command"`
cmd = ["nix", "eval", "./dev#checks"]

[eval]
# the command to run with `namaka review` and `namaka clean`
# defaults to `nix eval ./checks --extra-experimental-features "flakes nix-command"`
cmd = ["nix", "flake", "check"]
```

## Snapshot Testing

Snapshot testing is a strategy that allows you to write tests without manually writing reference values.
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
haumea = {
url = "github:nix-community/haumea/v0.2.1";
url = "github:nix-community/haumea/v0.2.2";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
Expand Down
Loading

0 comments on commit d9a2cc8

Please sign in to comment.