Skip to content

Commit d2e735d

Browse files
authored
ci: Allow overriding log level for modules when repeating tests (#5824)
Signed-off-by: Abhijat Malviya <[email protected]>
1 parent 2150e1f commit d2e735d

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.github/actions/repeat/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ inputs:
3232
epoll:
3333
required: true
3434
type: string
35+
vmodule_expression:
36+
required: true
37+
type: string
3538

3639
runs:
3740
using: "composite"
@@ -52,8 +55,13 @@ runs:
5255
else
5356
FORCE_EPOLL=""
5457
fi
55-
echo Running command: timeout ${{ inputs.timeout }} pytest ${{ inputs.expression }} --drop-data-after-each-test ${FORCE_EPOLL} --color=yes --json-report --json-report-file=report.json --log-cli-level=DEBUG --count=${{ inputs.count }}
56-
timeout ${{ inputs.timeout }} pytest ${{ inputs.expression }} --drop-data-after-each-test ${FORCE_EPOLL} --color=yes --json-report --json-report-file=report.json --log-cli-level=DEBUG --count=${{ inputs.count }} || code=$?
58+
if [[ $"{{ inputs.vmodule_expression }}" != "" ]]; then
59+
VMOD="--df vmodule=${{ inputs.vmodule_expression }}"
60+
else
61+
VMOD=""
62+
fi
63+
echo Running command: timeout ${{ inputs.timeout }} pytest ${{ inputs.expression }} --drop-data-after-each-test ${FORCE_EPOLL} ${VMOD} --color=yes --json-report --json-report-file=report.json --log-cli-level=DEBUG --count=${{ inputs.count }}
64+
timeout ${{ inputs.timeout }} pytest ${{ inputs.expression }} --drop-data-after-each-test ${FORCE_EPOLL} ${VMOD} --color=yes --json-report --json-report-file=report.json --log-cli-level=DEBUG --count=${{ inputs.count }} || code=$?
5765
# timeout returns 124 if we exceeded the timeout duration
5866
if [[ $code -eq 124 ]]; then
5967
# Add an extra new line here because when tests timeout the first line below continues from the test failure name

.github/workflows/repeat-tests.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ on:
3131
required: false
3232
type: string
3333
default: "no"
34+
vmodule_expression:
35+
description: "Emit verbose dragonfly logs for modules, eg x=2,y=3"
36+
required: false
37+
type: string
38+
default: ""
3439

3540
jobs:
3641
build:
@@ -61,25 +66,28 @@ jobs:
6166
ulimit -a
6267
env
6368
69+
- name: Fetch release
70+
shell: bash
71+
if: ${{ inputs.use_release == 'yes' }}
72+
run: |
73+
mkdir "${GITHUB_WORKSPACE}"/build
74+
cd "${GITHUB_WORKSPACE}"/build
75+
wget -q https://github.com/dragonflydb/dragonfly/releases/latest/download/dragonfly-x86_64.tar.gz
76+
tar xf dragonfly-x86_64.tar.gz
77+
mv dragonfly-x86_64 dragonfly
78+
ls -l
79+
6480
- name: Configure & Build
6581
shell: bash
82+
if: ${{ inputs.use_release != 'yes' }}
6683
run: |
67-
if [[ "${{ inputs.use_release }}" == "yes" ]]; then
68-
mkdir "${GITHUB_WORKSPACE}"/build
69-
cd "${GITHUB_WORKSPACE}"/build
70-
wget -q https://github.com/dragonflydb/dragonfly/releases/latest/download/dragonfly-x86_64.tar.gz
71-
tar xf dragonfly-x86_64.tar.gz
72-
mv dragonfly-x86_64 dragonfly
73-
ls -l
74-
else
75-
# -no-pie to disable address randomization so we could symbolize stacktraces
76-
cmake -B ${GITHUB_WORKSPACE}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -GNinja \
77-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DPRINT_STACKTRACES_ON_SIGNAL=ON \
78-
-DCMAKE_CXX_FLAGS=-no-pie -DHELIO_STACK_CHECK:STRING=4096
79-
cd ${GITHUB_WORKSPACE}/build && ninja dragonfly
80-
pwd
81-
ls -l ..
82-
fi
84+
# -no-pie to disable address randomization so we could symbolize stacktraces
85+
cmake -B ${GITHUB_WORKSPACE}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -GNinja \
86+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DPRINT_STACKTRACES_ON_SIGNAL=ON \
87+
-DCMAKE_CXX_FLAGS=-no-pie -DHELIO_STACK_CHECK:STRING=4096
88+
cd ${GITHUB_WORKSPACE}/build && ninja dragonfly
89+
pwd
90+
ls -l ..
8391
8492
- name: Run tests on repeat
8593
uses: ./.github/actions/repeat
@@ -94,6 +102,7 @@ jobs:
94102
count: ${{ inputs.count }}
95103
timeout: ${{ inputs.timeout }}
96104
epoll: ${{ inputs.epoll }}
105+
vmodule_expression: ${{ inputs.vmodule_expression }}
97106

98107
- name: Upload logs on failure
99108
if: failure()

0 commit comments

Comments
 (0)