-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor test scripts, update README for test with exceptions
- Loading branch information
Showing
6 changed files
with
39 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "8.9.0" | ||
- "12.20.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
#!/usr/bin/env bash | ||
STARTTIME=$(date +%s) | ||
# AGENCIES=("dc" "de" "ef" "fd" "nd" "or" "pa" "sc" "va") | ||
# for i in "${AGENCIES[@]}" | ||
# do | ||
# sh ./p2j.one.sh $i | ||
# done | ||
AGENCIES=("dc" "de" "ef" "fd" "nd" "or" "pa" "sc" "va") | ||
for i in "${AGENCIES[@]}" | ||
do | ||
sh ./p2j.one.sh $i form "NO Exception, All Parsed OK" | ||
done | ||
|
||
# Travis CI doesn't seem to support arrays in bash for testing. | ||
# Reverting to a bunch of commands so that build button can be shown. | ||
sh ./p2j.one.sh dc | ||
sh ./p2j.one.sh de | ||
sh ./p2j.one.sh ef | ||
sh ./p2j.one.sh fd | ||
sh ./p2j.one.sh nd | ||
sh ./p2j.one.sh or | ||
sh ./p2j.one.sh pa | ||
sh ./p2j.one.sh sc | ||
sh ./p2j.one.sh va | ||
# sh ./p2j.one.sh dc | ||
# sh ./p2j.one.sh de | ||
# sh ./p2j.one.sh ef | ||
# sh ./p2j.one.sh fd | ||
# sh ./p2j.one.sh nd | ||
# sh ./p2j.one.sh or | ||
# sh ./p2j.one.sh pa | ||
# sh ./p2j.one.sh sc | ||
# sh ./p2j.one.sh va | ||
|
||
ENDTIME=$(date +%s) | ||
echo "It takes $(($ENDTIME - $STARTTIME)) seconds to process all PDFs ..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
#!/usr/bin/env bash | ||
IN_DIR_BASE=./pdf/ | ||
OUT_DIR_BASE=./target/ | ||
DATA_DIR_BASE=./data/ | ||
IN_DIR_BASE=./pdf | ||
OUT_DIR_BASE=./target | ||
DATA_DIR_BASE=./data | ||
PDF2JSON=../pdf2json.js | ||
AGENCY_NAME=$1 | ||
FORM_BASE=$2 | ||
EXPECTED_RESULT=$3 | ||
|
||
echo "-----------------------------------------------------" | ||
echo "Clean up existing $AGENCY_NAME JSON" | ||
echo "-----------------------------------------------------" | ||
rm -rfv $OUT_DIR_BASE$AGENCY_NAME/ | ||
rm -rfv $OUT_DIR_BASE/$AGENCY_NAME | ||
|
||
echo "-----------------------------------------------------" | ||
echo "Update $AGENCY_NAME PDF" | ||
echo "-----------------------------------------------------" | ||
mkdir -p $OUT_DIR_BASE$AGENCY_NAME/form/ | ||
node $PDF2JSON -f $IN_DIR_BASE$AGENCY_NAME/form/ -o $OUT_DIR_BASE$AGENCY_NAME/form/ -s -t -c | ||
diff -rq $OUT_DIR_BASE$AGENCY_NAME/form/ $DATA_DIR_BASE$AGENCY_NAME/form/ | ||
mkdir -p $OUT_DIR_BASE/$AGENCY_NAME/$FORM_BASE | ||
node --trace-deprecation $PDF2JSON -f $IN_DIR_BASE/$AGENCY_NAME/$FORM_BASE -o $OUT_DIR_BASE/$AGENCY_NAME/$FORM_BASE -s -t -c -m | ||
# diff -rq $OUT_DIR_BASE$AGENCY_NAME/$FORM_BASE/ $DATA_DIR_BASE$AGENCY_NAME/$FORM_BASE/ | ||
|
||
echo "-----------------------------------------------------" | ||
echo "All JSON and PDF are updated for $AGENCY_NAME" | ||
echo "Expected for $AGENCY_NAME : $EXPECTED_RESULT" | ||
echo "-----------------------------------------------------" |