Skip to content

Commit 3fea460

Browse files
committed
Use archive_reader_url function instead of two
1 parent 09d557d commit 3fea460

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

Diff for: tools/circle-publish-github-comment.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function rewrite_log_links_to_s3
7272
local CT_REPORT=big_tests/ct_report
7373
local CT_REPORT_ABS=$(./tools/abs_dirpath.sh "$CT_REPORT")
7474
local CT_REPORTS=$(ct_reports_dir)
75-
local BIG_TESTS_URL="$(zip_reader_big_url ${CT_REPORTS})"
75+
local BIG_TESTS_URL="$(archive_reader_url big ${CT_REPORTS})"
7676
cp /tmp/ct_markdown /tmp/ct_markdown_original
7777
replace_string "$CT_REPORT_ABS" "$BIG_TESTS_URL" /tmp/ct_markdown
7878
# URL escape for s3_reports.html script
@@ -97,15 +97,15 @@ function small_suite_path
9797
function ct_run_url
9898
{
9999
local CT_REPORTS=$(ct_reports_dir)
100-
local BIG_TESTS_URL="$(zip_reader_big_url ${CT_REPORTS})"
100+
local BIG_TESTS_URL="$(archive_reader_url big ${CT_REPORTS})"
101101
local RUN_PART=$(echo "$(last_ct_run_name)" | sed "s/@/%40/g")
102102
echo "$BIG_TESTS_URL/$RUN_PART/index.html"
103103
}
104104

105105
function ct_small_url
106106
{
107107
local CT_REPORTS=$(ct_reports_dir)
108-
local SMALL_TESTS_URL="$(zip_reader_small_url ${CT_REPORTS})"
108+
local SMALL_TESTS_URL="$(archive_reader_url small ${CT_REPORTS})"
109109
local SUFFIX=$(small_suite_path)
110110
echo "$SMALL_TESTS_URL/$SUFFIX"
111111
}

Diff for: tools/helpers.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ direct_s3_url() {
5959
echo "https://circleci-mim-results.s3.eu-central-1.amazonaws.com/${CT_REPORTS}"
6060
}
6161

62-
zip_reader_big_url() {
63-
local CT_REPORTS=${1:-}
64-
echo "https://esl.github.io/html-zip-reader/${CT_REPORTS}/big.tar.gz/"
65-
}
66-
67-
zip_reader_small_url() {
68-
local CT_REPORTS=${1:-}
69-
echo "https://esl.github.io/html-zip-reader/${CT_REPORTS}/small.tar.gz/"
62+
archive_reader_url() {
63+
local TEST_TYPE=$1
64+
local CT_REPORTS=${2:-}
65+
echo "https://esl.github.io/html-zip-reader/${CT_REPORTS}/${TEST_TYPE}.tar.gz/"
7066
}

Diff for: tools/publish-github-comment.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function rewrite_log_links_to_s3
7070
local CT_REPORT=big_tests/ct_report
7171
local CT_REPORT_ABS=$(./tools/abs_dirpath.sh "$CT_REPORT")
7272
local CT_REPORTS=$(ct_reports_dir)
73-
local BIG_TESTS_URL="$(zip_reader_big_url ${CT_REPORTS})"
73+
local BIG_TESTS_URL="$(archive_reader_url big ${CT_REPORTS})"
7474
cp /tmp/ct_markdown /tmp/ct_markdown_original
7575
replace_string "$CT_REPORT_ABS" "$BIG_TESTS_URL" /tmp/ct_markdown
7676
# URL escape for s3_reports.html script
@@ -95,15 +95,15 @@ function small_suite_path
9595
function ct_run_url
9696
{
9797
local CT_REPORTS=$(ct_reports_dir)
98-
local BIG_TESTS_URL="$(zip_reader_big_url ${CT_REPORTS})"
98+
local BIG_TESTS_URL="$(archive_reader_url big ${CT_REPORTS})"
9999
local RUN_PART=$(echo "$(last_ct_run_name)" | sed "s/@/%40/g")
100100
echo "$BIG_TESTS_URL/$RUN_PART/index.html"
101101
}
102102

103103
function ct_small_url
104104
{
105105
local CT_REPORTS=$(ct_reports_dir)
106-
local SMALL_TESTS_URL="$(zip_reader_small_url ${CT_REPORTS})"
106+
local SMALL_TESTS_URL="$(archive_reader_url small ${CT_REPORTS})"
107107
local SUFFIX=$(small_suite_path)
108108
echo "$SMALL_TESTS_URL/$SUFFIX"
109109
}

0 commit comments

Comments
 (0)