Fix: ingest test fixtures update pr (#2881)

This PR aims to update "Ingest Test Fixtures Update PR" CI to update the
ingest test fixtures only if the OVERWRITE_FIXTURES variable is not
`false` and the OUTPUT_DIR directory is not empty.
This commit is contained in:
Christine Straub 2024-04-15 10:47:22 -07:00 committed by GitHub
parent 0506aff788
commit ba3f374268
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,8 @@ function cleanup() {
trap cleanup EXIT
# to update ingest test fixtures, run scripts/ingest-test-fixtures-update.sh on x86_64
if [ "$OVERWRITE_FIXTURES" != "false" ]; then
# NOTE(christine): only overwrite fixtures if the OUTPUT_DIR directory is not empty (there are potential additions or updates)
if [ "$OVERWRITE_FIXTURES" != "false" ] && [ "$(ls -A "$OUTPUT_DIR")" ]; then
# remove folder if it exists
if [ -d "$EXPECTED_OUTPUT_DIR" ]; then
rm -rf "$EXPECTED_OUTPUT_DIR"