Skip to content

Instantly share code, notes, and snippets.

@kourtni
Created May 14, 2024 02:43
Show Gist options
  • Save kourtni/7ee2749b0bb75253e0d29d2deab1b4fb to your computer and use it in GitHub Desktop.
Save kourtni/7ee2749b0bb75253e0d29d2deab1b4fb to your computer and use it in GitHub Desktop.
devenv test swallows errors and test failures if enterTest ends with a command that exits normally
{ pkgs, lib, config, inputs, ... }:
{
# https://devenv.sh/basics/
env.GREET = "devenv";
# https://devenv.sh/packages/
packages = [
pkgs.git
];
# https://devenv.sh/scripts/
scripts.hello.exec = "echo hello from $GREET";
enterShell = ''
hello
git --version
'';
# https://devenv.sh/tests/
# The error for not having poetry installed is surpressed by adding the final echo statement.
enterTest = ''
echo "Running tests"
poetry run coverage run -m pytest --setup-show && poetry run coverage report -i
echo "*** Finished UNIT TEST! ***"
'';
}
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment