File tree Expand file tree Collapse file tree 3 files changed +42
-9
lines changed Expand file tree Collapse file tree 3 files changed +42
-9
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Usage: ./ci_clean_log.sh ci.log
3
+ # This script strips timestamps and color codes from CI log files.
4
+
5
+ # Check if argument is given
6
+ if [ $# -lt 1 ]; then
7
+ echo " Usage: $0 ci.log"
8
+ exit 1
9
+ fi
10
+
11
+ INPUT_FILE=" $1 "
12
+
13
+ # Strip timestamps
14
+ sed -i ' s/^\[[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z\] //' " $INPUT_FILE "
15
+
16
+ # Strip colorization
17
+ sed -i -r ' s/\x1B\[[0-9;]*[mK]//g' " $INPUT_FILE "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Usage: ./rerun_test.sh path/to/test.py::test_name
4
+
5
+ # Check if argument is given
6
+ if [ $# -lt 1 ]; then
7
+ echo " Usage: $0 path/to/test.py::test_name"
8
+ echo " Example: $0 tests/v1/engine/test_engine_core_client.py::test_kv_cache_events[True-tcp]"
9
+ exit 1
10
+ fi
11
+
12
+ TEST=$1
13
+ COUNT=1
14
+
15
+ while pytest -sv " $TEST " ; do
16
+ COUNT=$(( COUNT + 1 ))
17
+ echo " RUN NUMBER ${COUNT} "
18
+ done
Original file line number Diff line number Diff line change @@ -64,15 +64,13 @@ Download the full log file from Buildkite locally.
64
64
65
65
Strip timestamps and colorization:
66
66
67
- ```bash
68
- # Strip timestamps
69
- sed -i 's/^\[[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z\] //' ci.log
67
+ <gh-file:.buildkite/scripts/ci-clean-log.sh>
70
68
71
- # Strip colorization
72
- sed -i -r 's/\x1B\[[0-9;]*[mK]//g' ci.log
69
+ ```bash
70
+ ./ci-clean-log.sh ci.log
73
71
```
74
72
75
- Use a tool for quick copy-pasting:
73
+ Use a tool [ wl-clipboard ] ( https://github.com/bugaevc/wl-clipboard ) for quick copy-pasting:
76
74
77
75
``` bash
78
76
tail -525 ci_build.log | wl-copy
@@ -89,10 +87,10 @@ tail -525 ci_build.log | wl-copy
89
87
90
88
CI test failures may be flaky. Use a bash loop to run repeatedly:
91
89
90
+ < gh-file:.buildkite/scripts/rerun-test.sh >
91
+
92
92
``` bash
93
- COUNT=1; while pytest -sv tests/v1/engine/test_engine_core_client.py::test_kv_cache_events[True-tcp]; do
94
- COUNT=$[$COUNT + 1]; echo " RUN NUMBER ${COUNT} " ;
95
- done
93
+ ./rerun-test.sh tests/v1/engine/test_engine_core_client.py::test_kv_cache_events[True-tcp]
96
94
```
97
95
98
96
## Submitting a PR
You can’t perform that action at this time.
0 commit comments