Skip to content

Commit

Permalink
Moving a group formatting test to a separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Raleksan committed Oct 8, 2024
1 parent 6fb8850 commit 0da2399
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/steps/test-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ echo "👍🏻 A PDF report generated correctly"
echo "👍🏻 A list of metrics is properly formatted"

{
mkdir -p "${TARGET}/temp/test_metric"
test_metric_sh="#!/bin/bash\n\n"
test_metric_sh+="output=\$(realpath \"\$2\")\n"
test_metric_sh+="for idx in {2..5}; do\n"
test_metric_sh+=" echo \"Test-\${idx} 0 [Test group \$((idx % 2))] Test metrics\" >> \"\${output}\"\n"
test_metric_sh+="done\n"
printf "%b" "$test_metric_sh" > "${LOCAL}/metrics/group_test.sh"
chmod +x "${LOCAL}/metrics/group_test.sh"
"${LOCAL}/steps/report.sh"
printf "%b" "$test_metric_sh" > "${TARGET}/temp/test_metric/group_test.sh"
chmod +x "${TARGET}/temp/test_metric/group_test.sh"
LOCAL_METRICS="${TARGET}/temp/test_metric" "${LOCAL}/steps/report.sh"
test -e "${TARGET}/report.pdf"
pdftotext "${TARGET}/report.pdf" "${TARGET}/report.txt"
txt=$(cat "${TARGET}/report.txt")
Expand Down

0 comments on commit 0da2399

Please sign in to comment.