Skip to content

Commit 12e5829

Browse files
authored
[doc] improve ci doc (#19307)
Signed-off-by: reidliu41 <[email protected]> Co-authored-by: reidliu41 <[email protected]>
1 parent 3a4d417 commit 12e5829

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

.buildkite/scripts/ci-clean-log.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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"

.buildkite/scripts/rerun-test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

docs/contributing/ci-failures.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ Download the full log file from Buildkite locally.
6464
6565
Strip timestamps and colorization:
6666
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>
7068
71-
# Strip colorization
72-
sed -i -r 's/\x1B\[[0-9;]*[mK]//g' ci.log
69+
```bash
70+
./ci-clean-log.sh ci.log
7371
```
7472

75-
Use a tool for quick copy-pasting:
73+
Use a tool [wl-clipboard](https://github.com/bugaevc/wl-clipboard) for quick copy-pasting:
7674

7775
```bash
7876
tail -525 ci_build.log | wl-copy
@@ -89,10 +87,10 @@ tail -525 ci_build.log | wl-copy
8987

9088
CI test failures may be flaky. Use a bash loop to run repeatedly:
9189

90+
<gh-file:.buildkite/scripts/rerun-test.sh>
91+
9292
```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]
9694
```
9795

9896
## Submitting a PR

0 commit comments

Comments
 (0)