2023-04-16 12:34:43 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-04-17 14:57:44 -07:00
|
|
|
set -e
|
|
|
|
|
2023-06-29 16:13:41 -07:00
|
|
|
SCRIPT_DIR=$(dirname "$(realpath "$0")")
|
2023-04-16 12:34:43 -07:00
|
|
|
cd "$SCRIPT_DIR"/.. || exit 1
|
2023-06-29 16:13:41 -07:00
|
|
|
OUTPUT_FOLDER_NAME=slack
|
|
|
|
OUTPUT_DIR=$SCRIPT_DIR/structured-output/$OUTPUT_FOLDER_NAME
|
|
|
|
DOWNLOAD_DIR=$SCRIPT_DIR/download/$OUTPUT_FOLDER_NAME
|
2023-04-16 12:34:43 -07:00
|
|
|
|
2023-08-02 14:16:37 -07:00
|
|
|
if [ -z "$SLACK_TOKEN" ]; then
|
|
|
|
echo "Skipping Slack ingest test because the SLACK_TOKEN env var is not set."
|
|
|
|
exit 0
|
|
|
|
fi
|
2023-04-16 12:34:43 -07:00
|
|
|
|
|
|
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
2023-07-31 13:20:10 -04:00
|
|
|
slack \
|
2023-06-29 16:13:41 -07:00
|
|
|
--download-dir "$DOWNLOAD_DIR" \
|
2023-07-31 19:55:43 -07:00
|
|
|
--metadata-exclude coordinates,file_directory,metadata.data_source.date_processed,metadata.last_modified \
|
2023-06-07 21:22:18 -07:00
|
|
|
--partition-strategy hi_res \
|
2023-06-12 15:02:48 -04:00
|
|
|
--preserve-downloads \
|
2023-06-29 16:13:41 -07:00
|
|
|
--reprocess \
|
2023-07-31 13:20:10 -04:00
|
|
|
--structured-output-dir "$OUTPUT_DIR" \
|
|
|
|
--verbose \
|
|
|
|
--channels C052BGT7718 \
|
|
|
|
--token "${SLACK_TOKEN}" \
|
2023-06-07 21:22:18 -07:00
|
|
|
--start-date 2023-04-01 \
|
2023-07-31 13:20:10 -04:00
|
|
|
--end-date 2023-04-08T12:00:00-08:00
|
2023-04-16 12:34:43 -07:00
|
|
|
|
2023-06-29 16:13:41 -07:00
|
|
|
sh "$SCRIPT_DIR"/check-diff-expected-output.sh $OUTPUT_FOLDER_NAME
|