Skip to content

Commit d10b41d

Browse files
committed
ci: add fio-tests workflow integration
Integrate fio-tests into the modular GitHub Actions CI infrastructure. The kdevops CI system uses a reusable action-based architecture that makes adding new workflows straightforward through a simple three-step process. The modular CI architecture separates concerns into discrete actions located in the .github/actions directory. The configure action handles defconfig selection and kdevops setup. The bringup action provisions VMs using the configured parameters. The build-test action installs workflow-specific test infrastructure. The test action executes tests and collects results. The archive action stores results for analysis. Finally the cleanup action destroys VMs and cleans up resources. Workflow-specific behavior is controlled through simple mapping files in the .ci directory. Each workflow needs two files. The build-test file specifies the make target for installing test infrastructure. The test file specifies the make target for establishing baselines or running tests. These mapping files are looked up by workflow name at runtime. For fio-tests the build-test mapping executes make fio-tests to install fio and generate test job files. The test mapping executes make fio-tests-baseline to run tests and establish performance baselines. The test action automatically selects appropriate quick tests for kdevops-ci validation mode based on workflow type. For fio-tests it runs a single randread test providing rapid validation in under one minute. For fstests workflows it runs generic/003. For blktests it runs block/003. For selftests it runs kmod/test_001. In linux-ci mode the TESTS variable remains unset allowing full test suite execution. Result collection is workflow-specific with dedicated logic in the test action. The fio-tests implementation parses JSON output files to extract IOPS and bandwidth metrics. This enables performance regression detection across kernel versions. The system reports sample results including job names and read/write performance statistics. Four fio-tests configurations are now available in the CI workflow selection menu. The fio-tests-quick option provides minimal validation for rapid iteration. The fio-tests-fs-xfs option tests XFS with 16K block sizes and modern features. The fio-tests-fs-ext4-bigalloc option tests ext4 with bigalloc and 32K clusters. The fio-tests-fs-btrfs-zstd option tests btrfs with zstd compression. Adding additional fio-tests configurations requires only adding a defconfig file in the defconfigs directory and adding the workflow name to the ci_workflow choice list in kdevops.yml. The existing CI infrastructure automatically handles the rest through the modular action architecture. This demonstrates the power of the modular CI design where workflows share common infrastructure for provisioning, build, test, and cleanup while maintaining workflow-specific customization through simple mapping files and conditional logic in the test action. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent fb84ed4 commit d10b41d

File tree

5 files changed

+54
-9
lines changed

5 files changed

+54
-9
lines changed

.ci/build-test/fio-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
make fio-tests

.ci/test/fio-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
make fio-tests-baseline

.github/actions/test/action.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ runs:
4747
selftests*|*modules*|*kmod*|*firmware*|*mm*)
4848
TESTS="kmod/test_001"
4949
;;
50+
*fio-tests*)
51+
TESTS="randread"
52+
;;
5053
*)
5154
TESTS="generic/003"
5255
;;
@@ -74,6 +77,7 @@ runs:
7477
*ext4*) wpath="workflows/fstests" ;;
7578
tmpfs*) wpath="workflows/fstests" ;;
7679
*xfs*) wpath="workflows/fstests" ;;
80+
*fio-tests*) wpath="workflows/fio-tests" ;;
7781
*) wpath="workflows/selftests" ;;
7882
esac
7983
@@ -88,6 +92,39 @@ runs:
8892
8993
# Workflow-specific result collection
9094
case "${{ inputs.ci_workflow }}" in
95+
*fio-tests*)
96+
# fio-tests workflows: Collect JSON results
97+
echo "Collecting fio-tests results..." > ci.commit_extra
98+
99+
if [ -d "$wpath/results/last-run" ]; then
100+
echo -e "\nfio-tests summary:" >> ci.commit_extra
101+
102+
# Count JSON result files
103+
json_count=$(find "$wpath/results/last-run" -name "*.json" -type f | wc -l)
104+
echo "Found $json_count fio result files" >> ci.commit_extra
105+
106+
# Extract basic metrics from first JSON file as sample
107+
sample_json=$(find "$wpath/results/last-run" -name "*.json" -type f | head -1)
108+
if [ -n "$sample_json" ] && [ -f "$sample_json" ]; then
109+
echo -e "\nSample result:" >> ci.commit_extra
110+
# Extract job name and basic IOPS/BW stats
111+
python3 -c "import json; import sys; data=json.load(open('$sample_json')); print(f\"Job: {data['jobs'][0]['jobname']}\"); print(f\"IOPS: {data['jobs'][0]['read']['iops']:.2f} read, {data['jobs'][0]['write']['iops']:.2f} write\"); print(f\"BW: {data['jobs'][0]['read']['bw']:.2f} KB/s read, {data['jobs'][0]['write']['bw']:.2f} KB/s write\")" >> ci.commit_extra 2>/dev/null || echo "Could not parse JSON" >> ci.commit_extra
112+
fi
113+
114+
# Success if we have at least one JSON result file
115+
if [ $json_count -gt 0 ]; then
116+
echo "ok" > ci.result
117+
else
118+
echo "no results found" > ci.result
119+
echo "::warning::No fio-tests JSON results found"
120+
exit 1
121+
fi
122+
else
123+
echo "no results found" > ci.result
124+
echo "::warning::No fio-tests results directory found"
125+
exit 1
126+
fi
127+
;;
91128
*xfs*|*btrfs*|*ext4*|tmpfs*|*fstests*)
92129
# fstests workflows: Use xunit_results.txt for rich summary
93130
echo "Collecting fstests results..."

.github/workflows/kdevops.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ on:
3030
- blktests_scsi
3131
- blktests_srp
3232
- blktests_zbd
33+
- fio-tests-quick
34+
- fio-tests-fs-xfs
35+
- fio-tests-fs-ext4-bigalloc
36+
- fio-tests-fs-btrfs-zstd
3337
- lbs-xfs
3438
- lbs-xfs-bdev-large-nvme
3539
- lbs-xfs-bdev-nvme

playbooks/roles/fio-tests/tasks/main.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
'btrfs-zstd' if 'btrfs-zstd' in inventory_hostname else
4545
'xfs-4k'
4646
}}
47+
when: fio_tests_requires_filesystem | default(false) | bool
4748

4849
- name: Set filesystem-specific mkfs and mount options
4950
tags: [ 'setup' ]
@@ -67,6 +68,7 @@
6768
fio_tests_fs_device: "{{ fio_tests_fs_device | default('/dev/disk/by-id/virtio-kdevops2') }}"
6869
fio_tests_fs_mount_point: "{{ fio_tests_fs_mount_point | default('/mnt/fio-tests') }}"
6970
fio_tests_fs_label: "{{ fio_tests_fs_label | default('fio-tests') }}"
71+
when: fio_tests_requires_filesystem | default(false) | bool
7072

7173
- name: Set derived configuration variables
7274
tags: [ 'setup' ]
@@ -124,15 +126,15 @@
124126
register: mountpoint_stat
125127
failed_when: false
126128
changed_when: false
127-
when: fio_tests_requires_mkfs_device | bool
129+
when: fio_tests_requires_mkfs_device | default(false) | bool
128130

129131
- name: Unmount {{ fio_tests_fs_device }} if mounted
130132
tags: [ 'setup', 'run_tests' ]
131133
become: yes
132134
become_method: sudo
133135
command: umount {{ fio_tests_fs_device }}
134136
when:
135-
- fio_tests_requires_mkfs_device | bool
137+
- fio_tests_requires_mkfs_device | default(false) | bool
136138
- mountpoint_stat.stdout != ""
137139

138140
- name: Create filesystem on {{ fio_tests_fs_device }}
@@ -144,7 +146,7 @@
144146
{{ fio_tests_mkfs_cmd }}
145147
-L {{ fio_tests_fs_label }}
146148
{{ fio_tests_fs_device }}
147-
when: fio_tests_requires_mkfs_device | bool
149+
when: fio_tests_requires_mkfs_device | default(false) | bool
148150

149151
- name: Create mount point directory
150152
tags: [ 'setup' ]
@@ -154,7 +156,7 @@
154156
path: "{{ fio_tests_fs_mount_point }}"
155157
state: directory
156158
mode: '0755'
157-
when: fio_tests_requires_mkfs_device | bool
159+
when: fio_tests_requires_mkfs_device | default(false) | bool
158160

159161
- name: Mount filesystem
160162
tags: [ 'setup' ]
@@ -166,7 +168,7 @@
166168
fstype: "{{ fio_tests_mkfs_type }}"
167169
opts: "{{ fio_tests_mount_opts }}"
168170
state: mounted
169-
when: fio_tests_requires_mkfs_device | bool
171+
when: fio_tests_requires_mkfs_device | default(false) | bool
170172

171173
- name: Set filesystem mount ownership
172174
tags: [ 'setup' ]
@@ -177,7 +179,7 @@
177179
owner: "{{ data_user }}"
178180
group: "{{ data_group }}"
179181
mode: '0755'
180-
when: fio_tests_requires_mkfs_device | bool
182+
when: fio_tests_requires_mkfs_device | default(false) | bool
181183

182184
- name: Create results directory
183185
tags: [ 'setup' ]
@@ -233,8 +235,8 @@
233235
block_size: "{{ item.1 }}"
234236
io_depth: "{{ item.2 }}"
235237
num_jobs: "{{ item.3 }}"
236-
test_directory: "{{ fio_tests_fs_mount_point if fio_tests_requires_mkfs_device else '' }}"
237-
test_device: "{{ fio_tests_device if not fio_tests_requires_mkfs_device else '' }}"
238+
test_directory: "{{ fio_tests_fs_mount_point if fio_tests_requires_mkfs_device | default(false) else '' }}"
239+
test_device: "{{ fio_tests_device if not (fio_tests_requires_mkfs_device | default(false)) else '' }}"
238240
with_nested:
239241
- "{{ fio_tests_patterns }}"
240242
- "{{ fio_tests_effective_block_sizes }}"
@@ -413,5 +415,5 @@
413415
mount:
414416
path: "{{ fio_tests_fs_mount_point }}"
415417
state: unmounted
416-
when: fio_tests_requires_mkfs_device | bool
418+
when: fio_tests_requires_mkfs_device | default(false) | bool
417419
ignore_errors: yes

0 commit comments

Comments
 (0)