forked from Unstructured-IO/unstructured
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-ingest-github.sh
executable file
·32 lines (27 loc) · 1.26 KB
/
test-ingest-github.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"/.. || exit 1
if [[ "$CI" == "true" ]]; then
if [ "$(( RANDOM % 10))" -lt 1 ] ; then
# NOTE(crag): proper fix is being tracked here: https://github.com/Unstructured-IO/unstructured/issues/306
echo "Skipping ingest 90% of github ingest tests to avoid rate limiting issue."
exit 0
fi
fi
PYTHONPATH=. ./unstructured/ingest/main.py \
--metadata-exclude filename \
--github-url dcneiner/Downloadify \
--git-file-glob '*.html,*.txt' \
--structured-output-dir github-downloadify-output \
--verbose
if ! diff -ru test_unstructured_ingest/expected-structured-output/github-downloadify github-downloadify-output ; then
echo
echo "There are differences from the previously checked-in structured outputs."
echo
echo "If these differences are acceptable, copy the outputs from"
echo "github-downloadify-output/ to test_unstructured_ingest/expected-structured-output/github-downloadify/ after running"
echo
echo " PYTHONPATH=. ./unstructured/ingest/main.py --github-url dcneiner/Downloadify --github-file-glob '*.html,*.txt' --structured-output-dir github-downloadify-output --verbose"
echo
exit 1
fi