Skip to content

Commit 49d7016

Browse files
committed
fix: Refactor CONTINUE_DESPITE_FAILURE handling in ETL execution logic
- Changed the declaration of CONTINUE_DESPITE_FAILURE to ensure it is set correctly during execution #4, improving clarity in the script's flow. - Updated the conditional check for CONTINUE_DESPITE_FAILURE to remove unnecessary variable expansion, enhancing readability and maintainability.
1 parent 3fd50b9 commit 49d7016

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/run_processAPINotes_with_etl.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ cleanup_old_logs() {
12161216
execute_processAPINotes_and_etl() {
12171217
local EXECUTION_NUMBER="${1:-1}"
12181218
local EXIT_CODE=0
1219+
local CONTINUE_DESPITE_FAILURE=0
12191220
local EXECUTION_START_TIME
12201221
EXECUTION_START_TIME=$(date +%s)
12211222

@@ -1269,14 +1270,12 @@ execute_processAPINotes_and_etl() {
12691270
log_warn "This may indicate a regression or edge case that needs investigation"
12701271
log_warn "Continuing with ETL execution to test incremental mode with no new notes..."
12711272
# Set a flag to indicate we're continuing despite the failure
1272-
local CONTINUE_DESPITE_FAILURE=1
1273+
CONTINUE_DESPITE_FAILURE=1
12731274
# Mark that there was a partial failure (processAPINotes failed but ETL will run)
12741275
EXIT_CODE=1
12751276
else
12761277
return 1
12771278
fi
1278-
else
1279-
local CONTINUE_DESPITE_FAILURE=0
12801279
fi
12811280
local PROCESS_END_TIME
12821281
PROCESS_END_TIME=$(date +%s)
@@ -1364,7 +1363,7 @@ execute_processAPINotes_and_etl() {
13641363
else
13651364
# For execution #4 (0 notes), if ETL succeeds, consider the execution successful
13661365
# even if processAPINotes.sh failed, because the goal is to test ETL with no new notes
1367-
if [[ ${EXECUTION_NUMBER} -eq 4 ]] && [[ ${CONTINUE_DESPITE_FAILURE:-0} -eq 1 ]]; then
1366+
if [[ ${EXECUTION_NUMBER} -eq 4 ]] && [[ ${CONTINUE_DESPITE_FAILURE} -eq 1 ]]; then
13681367
log_info "Execution #4: ETL completed successfully despite processAPINotes.sh failure"
13691368
log_info "This is acceptable - the goal was to test ETL incremental mode with no new notes"
13701369
EXIT_CODE=0

0 commit comments

Comments
 (0)