Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit f0f49b4

Browse files
committed
ci: Fix running of examples
Signed-off-by: John Andersen <[email protected]>
1 parent f62bbca commit f0f49b4

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.ci/run.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,14 @@ PYTHON=${PYTHON:-"python3.7"}
1111
TEMP_DIRS=()
1212

1313
function run_plugin_examples() {
14+
if [ ! -d "${SRC_ROOT}/${PLUGIN}/examples" ]; then
15+
return
16+
fi
1417
cd "${SRC_ROOT}/${PLUGIN}/examples"
1518
if [ -f "requirements.txt" ]; then
1619
"${PYTHON}" -m pip install -r requirements.txt
1720
fi
18-
# Run example tests in top level examples directory
19-
for dir in $(find . -type d); do
20-
# Skip shouldi if we're in the root package
21-
set +e
22-
within_shouldi=$(echo "${dir}" | grep "shouldi")
23-
set -e
24-
if [ "x${PLUGIN}" != "x." ] && [ "x${within_shouldi}" != "x" ]; then
25-
continue
26-
fi
27-
# Run example tests in examples subdirectories
28-
cd "${SRC_ROOT}/${PLUGIN}/examples"
29-
cd "${dir}"
30-
"${PYTHON}" -m unittest discover -v
31-
done
21+
"${PYTHON}" -m unittest discover -v
3222
cd "${SRC_ROOT}/${PLUGIN}"
3323
}
3424

@@ -53,7 +43,7 @@ function run_plugin() {
5343
# Run the tests
5444
"${PYTHON}" setup.py test
5545
# Run examples if they exist and we aren't at the root
56-
if [ -d "examples" ] && [ "x${PLUGIN}" != "x." ]; then
46+
if [ "x${PLUGIN}" != "x." ]; then
5747
run_plugin_examples
5848
fi
5949
cd "${SRC_ROOT}"

0 commit comments

Comments
 (0)