Skip to content

Commit

Permalink
fix(scripts):
Browse files Browse the repository at this point in the history
- remove ansi color escape codes from logs
- remove NULL characters
  • Loading branch information
deemp committed May 21, 2024
1 parent 400ebd9 commit 8169084
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions scripts/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,27 @@ function convert_phi_to_eo {

}

function test_with_logs {
local logs="$1"

local fail=false

eo test | tee "$logs" || fail=true

if [[ "$fail" = true ]]; then
perl -i -pe 's/\x1b\[[0-9;]*[mGKHF]//g' "$logs"
perl -i -pe 's/\x0//g' "$logs"

exit 1
fi
}

function test_without_normalization {

print_message "Test EO without normalization"

cd "$PIPELINE_EO_NON_NORMALIZED_DIR"
eo test | tee "$PIPELINE_LOGS_NON_NORMALIZED"
test_with_logs "$PIPELINE_LOGS_NON_NORMALIZED"
cd "$PIPELINE_DIR"
}

Expand Down Expand Up @@ -184,23 +199,23 @@ function test_with_normalization {

cd "$PIPELINE_EO_NORMALIZED_DIR"
cp -r "$PIPELINE_PHI_NORMALIZED_DIR"/.eoc/print/!(org) .
eo test | tee "$PIPELINE_LOGS_NORMALIZED"
test_with_logs "$PIPELINE_LOGS_NORMALIZED"
cd "$PIPELINE_DIR"
}

check_configs
update_pipeline_lock
install_normalizer
# check_configs
# update_pipeline_lock
# install_normalizer

if [[ "$PIPELINE_LOCK_CHANGED" = true ]]; then
generate_eo_tests
convert_eo_to_phi
update_normalizer_phi_files
convert_phi_to_eo
# generate_eo_tests
# convert_eo_to_phi
# update_normalizer_phi_files
# convert_phi_to_eo
test_without_normalization
fi

normalize
generate_report
convert_normalized_phi_to_eo
test_with_normalization
# normalize
# generate_report
# convert_normalized_phi_to_eo
# test_with_normalization

0 comments on commit 8169084

Please sign in to comment.