File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ jobs:
204204 # manipulating string in expressions.
205205 run : ./scripts/xcode-test.sh ${{matrix.platform}} ${{matrix.test-destination-os}} $GITHUB_REF_NAME ci test-without-building
206206
207+ - name : Slowest Tests
208+ if : ${{ always() }}
209+ run : ./scripts/xcode-slowest-tests.sh
210+
207211 - name : Archiving DerivedData Logs
208212 uses : actions/upload-artifact@v3
209213 if : failure()
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ GIT-REF := $(shell git rev-parse --abbrev-ref HEAD)
4545test :
4646 @echo " --> Running all tests"
4747 ./scripts/xcode-test.sh iOS latest $(GIT-REF ) YES
48+ ./scripts/xcode-slowest-tests.sh
4849.PHONY : test
4950
5051run-test-server :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Finds the x amount of slowest test cases in the raw-test-output.log file.
4+ # Logic copied from https://stanislaw.github.io/2016/08/04/how-to-find-the-slowest-xctest.html.
5+
6+ RAW_TEST_OUTPUT_LOG=${1:- raw-test-output.log}
7+ NUMBER_OF_SLOWEST_TEST=" ${2:- 20} "
8+
9+ echo " The $NUMBER_OF_SLOWEST_TEST slowest test cases:"
10+ cat $RAW_TEST_OUTPUT_LOG | grep ' Test\ Case.*seconds' | awk -F ' [()]' ' {print $2 " -> " $1}' | sort -rn | head -n $NUMBER_OF_SLOWEST_TEST
You can’t perform that action at this time.
0 commit comments