-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Print slowest test cases (#2970)
Print the 20 slowest test cases after running unit tests.
- Loading branch information
1 parent
21fd61f
commit 1db04d8
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Finds the x amount of slowest test cases in the raw-test-output.log file. | ||
# Logic copied from https://stanislaw.github.io/2016/08/04/how-to-find-the-slowest-xctest.html. | ||
|
||
RAW_TEST_OUTPUT_LOG=${1:-raw-test-output.log} | ||
NUMBER_OF_SLOWEST_TEST="${2:-20}" | ||
|
||
echo "The $NUMBER_OF_SLOWEST_TEST slowest test cases:" | ||
cat $RAW_TEST_OUTPUT_LOG | grep 'Test\ Case.*seconds' | awk -F '[()]' '{print $2 " -> " $1}' | sort -rn | head -n $NUMBER_OF_SLOWEST_TEST |