Skip to content

Commit e8b706b

Browse files
committed
Update ci to catch non zero return value for diffs
1 parent 09d2559 commit e8b706b

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,19 +355,32 @@ jobs:
355355
# to run notebooks in it. If you try to run the notebooks before the website is
356356
# ready the ci python script will crash saying ti cannot access the url
357357
sleep 10
358+
echo "Running xeus-cpp in Jupter Lite in Chrome"
358359
python -u scripts/automated-notebook-run-script.py --driver chrome --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }}
360+
echo "Diff Notebooks Chrome"
359361
nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata
360-
rm $HOME/Downloads/${{ matrix.notebook }}
362+
export CHROME_TESTS_RETURN_VALUE=$?
363+
echo "Running xeus-cpp in Jupter Lite in Firefox"
361364
python -u scripts/automated-notebook-run-script.py --driver firefox --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }}
365+
echo "Diff Notebooks Firefox"
362366
nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata
363-
rm $HOME/Downloads/${{ matrix.notebook }}
367+
export FIREFOX_TESTS_RETURN_VALUE=$?
368+
rm $HOME/Downloads/${{ matrix.notebook }}
369+
export SAFARI_TESTS_RETURN_VALUE=0
364370
if [[ "${{ matrix.os }}" == "macos"* ]]; then
365371
python -m pip install PyAutoGUI
366372
python scripts/enable-downloads-safari-github-ci.py
367373
python -u scripts/automated-notebook-run-script.py --driver safari --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }}
374+
echo "Running xeus-cpp in Jupter Lite in Safari"
375+
echo "Diff Notebooks Safari"
368376
nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata
377+
export SAFARI_TESTS_RETURN_VALUE=$?
369378
rm $HOME/Downloads/${{ matrix.notebook }}
370379
fi
380+
if [[ $SAFARI_TESTS_RETURN_VALUE -ne 0 || $FIREFOX_TESTS_RETURN_VALUE -ne 0 || $CHROME_TESTS_RETURN_VALUE -ne 0 ]]; then
381+
echo "Diff for Safari, Chrome or Firefox returned non zero value (could be more than one)"
382+
exit 1
383+
fi
371384
timeout-minutes: 15
372385

373386
- name: Setup tmate session

scripts/automated-notebook-run-script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from selenium.webdriver.common.keys import Keys
1010
import time
1111
import platform
12+
import sys
1213

1314
def cell_is_waiting_for_input(driver):
1415
dialog_selectors = [
@@ -207,7 +208,7 @@ def main():
207208
elapsed = time.time() - start_time
208209
if elapsed > timeout:
209210
print(f"Timeout reached ({elapsed:.1f} seconds). Stopping loop.")
210-
break
211+
sys.exit(1)
211212

212213
spans = driver.find_elements(By.CSS_SELECTOR, "span.jp-StatusBar-TextItem")
213214
status_span = spans[2]

0 commit comments

Comments
 (0)