Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,46 @@ Don't edit `~/.config/nix/nix.conf` in your home directory. Don't add users to `

### Development Shell

`cardano.nix` provides a devshell that includes some useful tools and aliases:
Development is supported on linux systems. Virtual machines are run with `qemu` so `kvm` is recommended.

`cardano.nix` provides a devshell that includes various tools to build, test, run and update the project:

```
❯ nix develop
...
❄️ Welcome to the cardano.nix devshell ❄️
...
[Tools]

build-all - Build all the checks
check - Alias of `nix flake check`
fmt - Format the source tree
...
[documentation]

docs-build - build documentation
docs-serve - serve documentation web page

[general commands]

menu - prints this menu

[tests]

build-all - build all packages and checks with `devour-flake`
check - run `nix flake check`
run-vm-test - list and run virtual machine integration tests

[tools]

fmt - format the source tree
update-pre-commit-hooks - update git pre-commit hooks
```

A `.envrc` is also provided, using [direnv]() and [nix-direnv](https://github.com/nix-community/nix-direnv) is suggested.

### Running Integration Tests

From the devshell you can run integration tests with `run-vm-test`, for example the following will start `cardano-node` and `ogmios` on the `preview` testnet and will check for synchronization progress.

```
run-vm-test ogmios
```

## License information

`cardano.nix` released under terms of [Apache-2.0](LICENSES/Apache-2.0.txt) license.
10 changes: 5 additions & 5 deletions checks/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{inputs, ...}: {
imports = [
./nixosTests.nix
./vmTests.nix
./licenses.nix
];
perSystem = {
Expand All @@ -26,15 +26,15 @@

devshells.default.commands = [
{
category = "Tools";
category = "tests";
name = "build-all";
help = "Build all the checks";
help = "build all packages and checks with `devour-flake`";
command = config.apps.nix-build-all.program;
}
{
category = "Tools";
category = "tests";
name = "check";
help = "Alias of `nix flake check`";
help = "run `nix flake check`";
command = "nix flake check";
}
];
Expand Down
145 changes: 0 additions & 145 deletions checks/nixosTests.nix

This file was deleted.

21 changes: 11 additions & 10 deletions checks/run-test.nix → checks/run-vm-test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
...
}:
writeShellApplication {
name = "run-test";
name = "run-vm-test";

runtimeInputs = [];

text = ''
cmd_name=$(basename "$0")

help() {
echo " build and run a test"
echo " Build and run integration test on a network of virtual machines."
echo
echo " usage:"
echo " Usage:"
echo " $cmd_name <name>"
echo " $cmd_name <name> --interactive"
echo " $cmd_name -s <system> <name>"
echo
echo " arguments:"
echo " Arguments:"
echo " <name>"
echo
echo " options:"
echo " -h --help show this screen."
echo " -l --list show available tests."
echo " -s --system specify the target platform [default: ${stdenv.system}]."
echo " -i --interactive run the test interactively."
echo " Options:"
echo " -h --help Show this screen."
echo " -l --list Show available tests."
echo " -s --system Specify the target platform [default: ${stdenv.system}]."
echo " -i --interactive Run the test interactively."
echo
}

Expand Down Expand Up @@ -65,6 +65,7 @@ writeShellApplication {
shift

# build/run the test driver, passing any remaining arguments
nix run ".#checks.$system.testing-$name.driver" "''${nix_args}" -- "''${driver_args[@]}"
# shellcheck disable=SC2068,SC2086
nix run ".#apps.$system.vmTests-$name" ''${nix_args} -- ''${driver_args[@]}
'';
}
Loading