Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions reporters/trending.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ if [ ${#TARGET_FILES[@]} -eq 0 ]; then
exit 0
fi

# Use awk to process the tsv files
# Use awk to process the tsv files, then sort the results
awk '
BEGIN {
FS="\t";
OFS="\t";
print "Change\tLast Value\tFirst Value\tMetrics";
print "------\t----------\t-----------\t-------";
}
FNR == 1 { next; } # Skip header row of each file
{
Expand Down Expand Up @@ -104,4 +102,9 @@ END {
print change_str, last_value[metric], first_value[metric], metric;
}
}
}' "${TARGET_FILES[@]}"
}' "${TARGET_FILES[@]}" |
(
echo -e "Change\tLast\tFirst\tmodule\tchannels\tnamespace"
echo -e "------\t----\t-----\t------\t--------\t---------"
sort -k1,1nr
)
2 changes: 1 addition & 1 deletion test/dashboard.bats
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ EOL

teardown() {
# This teardown function is run after each test.
rm -rf config
rm -f config/config.sh
}

@test "dashboard.sh should be executable" {
Expand Down
2 changes: 1 addition & 1 deletion test/discord.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EOF

teardown() {
# This teardown function is run after each test.
rm -rf config
rm -f config/config.sh
rm -rf "/tmp/bats_mocks_$$"
}

Expand Down
2 changes: 1 addition & 1 deletion test/github.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ EOL

teardown() {
# This teardown function is run after each test.
rm -rf config
rm -f config/config.sh
}

@test "github module produces valid tsv" {
Expand Down
2 changes: 1 addition & 1 deletion test/hackernews.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EOL

teardown() {
# This teardown function is run after each test.
rm -rf config
rm -f config/config.sh
}

@test "hackernews module produces valid tsv" {
Expand Down