File tree Expand file tree Collapse file tree 1 file changed +56
-1
lines changed Expand file tree Collapse file tree 1 file changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,61 @@ pip install -c python/requirements_compiled.txt pytest nbval bash_kernel
10
10
python -m bash_kernel.install
11
11
pip install " ray[default]==2.41.0"
12
12
13
+ echo " --- Run a deliberate failure test to ensure the test script fails on error"
14
+ # The following Jupyter notebook only contains a single cell that runs the `date` command.
15
+ # The test script should fail because the output of the `date` command is different everytime.
16
+ cat << EOF > test.ipynb
17
+ {
18
+ "cells": [
19
+ {
20
+ "cell_type": "code",
21
+ "execution_count": 1,
22
+ "id": "43a8bb95-f6f2-45a8-ba48-b16856b2106d",
23
+ "metadata": {},
24
+ "outputs": [
25
+ {
26
+ "name": "stdout",
27
+ "output_type": "stream",
28
+ "text": [
29
+ "Wed Mar 26 06:28:51 PM CST 2025\n"
30
+ ]
31
+ }
32
+ ],
33
+ "source": [
34
+ "date"
35
+ ]
36
+ }
37
+ ],
38
+ "metadata": {
39
+ "kernelspec": {
40
+ "display_name": "Bash",
41
+ "language": "bash",
42
+ "name": "bash"
43
+ },
44
+ "language_info": {
45
+ "codemirror_mode": "shell",
46
+ "file_extension": ".sh",
47
+ "mimetype": "text/x-sh",
48
+ "name": "bash"
49
+ }
50
+ },
51
+ "nbformat": 4,
52
+ "nbformat_minor": 5
53
+ }
54
+ EOF
55
+ set +e
56
+ if pytest --nbval test.ipynb --nbval-kernel-name bash; then
57
+ echo " The test script should have failed but it didn't."
58
+ exit 1
59
+ fi
60
+ set -e
61
+
13
62
echo " --- Run doc tests"
14
63
cd doc/source/cluster/kubernetes
15
- py.test --nbval getting-started/raycluster-quick-start.ipynb --nbval-kernel-name bash --sanitize-with doc_sanitize.cfg
64
+ TESTS=(
65
+ " getting-started/raycluster-quick-start.ipynb"
66
+ )
67
+ for test in " ${TESTS[@]} " ; do
68
+ echo " Running test: ${test} "
69
+ pytest --nbval " ${test} " --nbval-kernel-name bash --sanitize-with doc_sanitize.cfg
70
+ done
You can’t perform that action at this time.
0 commit comments