@@ -83,6 +83,158 @@ The expunge will will *not* be used if the TESTS argument is used and so
8383running the above will * ensure* the tests are run even if they are known to
8484crash on a system for a target section.
8585
86+ # A/B Testing with Different Kernels
87+
88+ kdevops supports advanced A/B testing workflows that allow you to compare test
89+ results between different kernel versions, branches, or configurations. This is
90+ particularly useful for validating patches, comparing stable releases, or
91+ detecting performance regressions across kernel versions.
92+
93+ ## CLI Environment Variables
94+
95+ You can use environment variables to configure kdevops without modifying your
96+ .config file. This is especially useful for automated testing and quick
97+ configuration changes. The following variables are supported:
98+
99+ ### A/B Testing Variables
100+
101+ - ` TEST_AB=y ` - Enables baseline and development nodes
102+ (sets ` CONFIG_KDEVOPS_BASELINE_AND_DEV=y ` )
103+
104+ ### Host Configuration
105+
106+ - ` KDEVOPS_HOSTS_PREFIX="name" ` - Sets the hostname prefix for all nodes
107+ (sets ` CONFIG_KDEVOPS_HOSTS_PREFIX ` )
108+
109+ ### Baseline Kernel Configuration
110+
111+ - ` LINUX_TREE=/path/to/tree.git ` - Git repository URL or local path for baseline kernel
112+ (sets ` CONFIG_BOOTLINUX_TREE ` )
113+ - ` LINUX_TREE_REF=v6.16 ` - Git reference (tag, branch, or commit) for baseline
114+ (sets ` CONFIG_BOOTLINUX_TREE_REF ` )
115+
116+ ### Development Kernel Configuration (A/B Testing)
117+
118+ - ` LINUX_DEV_TREE=/path/to/tree.git ` - Git repository for development kernel
119+ (sets ` CONFIG_BOOTLINUX_DEV_TREE ` )
120+ - ` LINUX_DEV_TREE_REF=branch-name ` - Git reference for development kernel
121+ (sets ` CONFIG_TARGET_LINUX_DEV_REF ` )
122+
123+ ### Testing Configuration
124+
125+ - ` SOAK_DURATION=432000 ` - Duration in seconds for soak testing (432000 = 5 days)
126+ (sets ` CONFIG_FSTESTS_SOAK_DURATION ` )
127+
128+ ## A/B Testing Workflow Example
129+
130+ Here's a complete example that tests XFS reflink functionality comparing a
131+ stable kernel (v6.16) against a development branch with new patches:
132+
133+ ``` bash
134+ # Configure kdevops with A/B testing enabled
135+ make defconfig-xfs_reflink \
136+ TEST_AB=y \
137+ KDEVOPS_HOSTS_PREFIX=" parallewb" \
138+ LINUX_TREE=/mirror/mcgrof-linus.git/ \
139+ LINUX_TREE_REF=v6.16 \
140+ LINUX_DEV_TREE=/mirror/mcgrof-linus.git/ \
141+ LINUX_DEV_TREE_REF=" 20250807-migrate-folios-stats-pw" \
142+ SOAK_DURATION=432000 -j128
143+
144+ # Build the configuration
145+ make -j$( nproc)
146+
147+ # Provision baseline and dev nodes
148+ make bringup
149+
150+ # Build and install kernels (baseline on baseline node, dev on dev node)
151+ make linux
152+
153+ # Run fstests on baseline and dev
154+ make fstests-tests
155+ ```
156+
157+ ### Understanding the Configuration
158+
159+ This example creates two test nodes:
160+
161+ 1 . ** Baseline node** (` parallewb-xfs-reflink ` ):
162+ - Runs kernel v6.16 from ` /mirror/mcgrof-linus.git/ `
163+ - Provides the reference test results, ie, this is our baseline
164+
165+ 2 . ** Development node** (` parallewb-xfs-reflink-dev ` ):
166+ - Runs kernel from branch ` 20250807-migrate-folios-stats-pw `
167+ - Tests new patches against the baseline
168+
169+ Both nodes run the same XFS reflink test configuration, allowing direct
170+ comparison of test results between kernel versions.
171+
172+ ### Long-term Soak Testing
173+
174+ The ` SOAK_DURATION=432000 ` (5 days) enables extended stress testing:
175+
176+ - Tests designed for soak testing will run for the specified duration
177+ - Helps catch rare race conditions and memory leaks
178+ - More effective than simple test loops for long-term stability validation
179+ - Results are tracked separately for baseline and dev nodes
180+ - This is an insane amount of time as it will take 5 days * per* test
181+ which supports to run with soak duration. So this is just an example.
182+
183+ ### Comparing Results
184+
185+ After tests complete, you can compare results between baseline and dev nodes.
186+ For detailed information on comparing fstests results, including automated
187+ regression detection and side-by-side comparisons, see the
188+ [ Comparing fstests results] ( https://github.com/linux-kdevops/kdevops-results-archive#comparing-fstests-results )
189+ section in the kdevops-results-archive documentation.
190+
191+ The results archive provides the ` bin/compare-results-fstests.py ` script which:
192+ - Automatically detects regressions and fixes between test runs
193+ - Provides verbose side-by-side test comparison
194+ - Handles multiple filesystem test profiles
195+ - Extracts kernel versions from commit messages
196+
197+ Quick example:
198+ ``` bash
199+ # View test results summary
200+ make fstests-results
201+
202+ # For automated comparison using the results archive
203+ cd ../kdevops-results-archive
204+ ./bin/compare-results-fstests.py < baseline-commit> < test-commit>
205+
206+ # Detailed verbose comparison
207+ ./bin/compare-results-fstests.py < baseline-commit> < test-commit> --verbose
208+ ```
209+
210+ ### Using Local Git Mirrors
211+
212+ The example uses local git mirrors (` /mirror/mcgrof-linus.git/ ` ) for faster
213+ kernel builds and reduced network usage. Local mirrors are particularly useful
214+ for:
215+
216+ - ** Repeated testing** : Avoid re-cloning repositories
217+ - ** Offline development** : Work without network access
218+ - ** Custom branches** : Test local development branches
219+ - ** CI/CD environments** : Faster pipeline execution
220+
221+ You can create a local mirror with:
222+
223+ ``` bash
224+ git clone --mirror \
225+ git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git \
226+ /mirror/mcgrof-linus.git
227+ ```
228+
229+ ### Parallel Builds
230+
231+ The ` -j128 ` flag enables parallel processing:
232+
233+ - Applied to both configuration (` make defconfig-xfs_reflink -j128 ` )
234+ - And to the build process (` make -j128 ` )
235+ - Significantly reduces setup and build time
236+ - Adjust based on your system's CPU core count
237+
86238## Review regressions
87239
88240To see regressions:
0 commit comments