Skip to content

Commit

Permalink
nix: dev workflow items (#316)
Browse files Browse the repository at this point in the history
Addresses some issues making it more challenging to use the nix dev environment, including documentation and ensuring adequate space to run tests locally.
  • Loading branch information
brianhenn authored Aug 8, 2022
1 parent 34fe16f commit d4c5b35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ test: ## run tests (set COMPILED_TAG_NAME to override default)
pytest tests/pytest --capture=no --verbose --refdir $(shell pwd)/tests/pytest/reference/circleci --image_version $(COMPILED_TAG_NAME)

build_native: ## build FV3 locally (assuming all tools and dependencies are available in the environment)
$(MAKE) -j 8 -C FV3 GCOV=Y
$(MAKE) -j 8 -C FV3


test_native: DIR=coverage_$(shell date -Is)
test_native: ## run native tests (all tools and build dependencies are assumed to be available in the environment)
find FV3 -type f -name '*.gcda' -delete
pytest --native tests/pytest
pytest FV3/wrapper/tests/
pytest -v FV3/wrapper/tests/pytest
pytest -v FV3/wrapper/tests/test_all_mpi_requiring.py
mkdir -p $(DIR) && \
cd $(DIR) && \
gcovr -d -r ../FV3 --html --html-details -o index.html
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Then configure the build to use nix

cd FV3 && ./configure nix

And build the model (with coverage outputs, from the root directory)
And build the model (from the root directory)

make build_native

Expand Down Expand Up @@ -227,7 +227,8 @@ tests like this:
# or manually
pytest --native tests/pytest
# and
pytest FV3/wrapper/tests/
pytest -v FV3/wrapper/tests/pytest
pytest -v FV3/wrapper/tests/test_all_mpi_requiring.py

When using the makefile target, code coverages reports will be saved to the
folder `coverage_<timestamp>`.
Expand Down
1 change: 1 addition & 0 deletions nix/fv3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ installPhase = ''
export PYTHONPATH=$(pwd)/tests/emulation:$(pwd)/FV3/wrapper:$PYTHONPATH
# path to fv3.exe
export PATH=$(pwd)/FV3:$PATH
export TMPDIR=/tmp
'';
}

0 comments on commit d4c5b35

Please sign in to comment.