This repository was archived by the owner on Sep 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-7
lines changed Expand file tree Collapse file tree 1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change 36
36
# --workdir /content/notebooks \
37
37
# gcr.io/cloud-datalab/datalab-gateway
38
38
39
+ EXCLUDE=(
40
+ " Introduction to Python.ipynb"
41
+ " 2. Preprocess.ipynb"
42
+ " 3. Training.ipynb"
43
+ " 6. Evaluation and Batch Prediction.ipynb"
44
+ " 7. HyperParameter Tuning.ipynb"
45
+ )
46
+
39
47
function testNotebooks() {
40
48
DIR=" ${1:- ./ } "
41
49
IFS=$' \n '
42
50
FAILED_NOTEBOOKS=" "
43
51
SEP=$' \n\t '
44
52
COUNT=" 0"
45
- for NOTEBOOK in ` find ${DIR} -name ' *.ipynb' -and -not -name ' Introduction to Python.ipynb' ` ; do
46
- echo " Testing ${NOTEBOOK} "
47
- jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.timeout=300 " ${NOTEBOOK} " || FAILED_NOTEBOOKS=" ${FAILED_NOTEBOOKS}${SEP}${NOTEBOOK} "
48
- COUNT=$( expr ${COUNT} + 1)
53
+ EXCLUDE_ARGS=" "
54
+ for EXCLUDED_NOTEBOOK in " ${EXCLUDE[@]} " ; do
55
+ EXCLUDE_ARGS=" ${EXCLUDE_ARGS} -and -not -name '${EXCLUDED_NOTEBOOK} '"
56
+ done
57
+ SEARCH_CMD=" find ${DIR} -name '*.ipynb'${EXCLUDE_ARGS} "
58
+ echo " Search command: ${SEARCH_CMD} "
59
+ for NOTEBOOK in ` eval " ${SEARCH_CMD} " ` ; do
60
+ echo " Testing ${NOTEBOOK} "
61
+ jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.timeout=300 " ${NOTEBOOK} " || FAILED_NOTEBOOKS=" ${FAILED_NOTEBOOKS}${SEP}${NOTEBOOK} "
62
+ COUNT=$( expr ${COUNT} + 1)
49
63
done
50
64
if [ -n " ${FAILED_NOTEBOOKS} " ]; then
51
- echo " Validation failed for the following notebooks:${FAILED_NOTEBOOKS} "
52
- exit 1
65
+ echo " Validation failed for the following notebooks:${FAILED_NOTEBOOKS} "
66
+ exit 1
53
67
else
54
- echo " Validation passed for ${COUNT} notebooks"
68
+ echo " Validation passed for ${COUNT} notebooks"
55
69
fi
56
70
}
57
71
You can’t perform that action at this time.
0 commit comments