test: Run cli checks in PR workflow

Simplify execution of CLI tests and run them in the CI workflow after
Python tests.
This commit is contained in:
Jon Grace-Cox
2024-12-30 07:25:54 -05:00
committed by Jon Grace-Cox
parent bb9ef961fb
commit 96d102f307
3 changed files with 11 additions and 1 deletions

View File

@@ -32,3 +32,6 @@ jobs:
- name: Run tests
run: pytest --doctest-modules --cov=anybadge --cov-report term --cov-report xml:coverage.xml --cov-report html:htmlcov anybadge tests
- name: CLI tests
run: docker/test/shell_tests.sh

View File

@@ -1,5 +1,12 @@
#!/bin/bash
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
echo "Running shell tests..."
echo "Source directory: ${SOURCE_DIR}"
echo "Project directory: ${PROJECT_DIR}"
source "${SOURCE_DIR:-.}/helpers.sh" || { echo "Failed to load helpers." ; exit 1 ; }
echo -n "Getting installed version... "

View File

@@ -74,6 +74,6 @@ def cli(c, version="latest"):
shell_test = PROJECT_DIR / Path("docker/test/shell_tests.sh")
subprocess.run(
f'SOURCE_DIR="{shell_test.parent}" PROJECT_DIR="{PROJECT_DIR}" {shell_test}',
str(shell_test),
shell=True,
)