From accff4b2453f4df2735fcdaecbc42a65d24cdf41 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 17 Feb 2022 12:31:35 +0100 Subject: [PATCH] add test to verdi.sh --- .github/workflows/verdi.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/verdi.sh b/.github/workflows/verdi.sh index 34f49e5c72..31d9d57b34 100755 --- a/.github/workflows/verdi.sh +++ b/.github/workflows/verdi.sh @@ -37,3 +37,18 @@ done $VERDI devel check-load-time $VERDI devel check-undesired-imports + + +# Test that we can also run the CLI via `python -m aiida`, +# that it returns a 0 exit code, and contains the expected stdout. +OUTPUT=$(python -m aiida 2>&1) +retVal=$? +if [ $retVal -ne 0 ]; then + echo "'python -m aiida' exitted with code $retVal" +fi +if [[ $OUTPUT != *"command line interface of AiiDA"* ]]; then + echo "'python -m aiida' did not contain the expected stdout:" + echo "$OUTPUT" + exit 2 +fi +exit $retVal