Skip to content

refactor: Split runner.py into focused modules#6

Merged
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:refactor
Mar 9, 2026
Merged

refactor: Split runner.py into focused modules#6
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:refactor

Conversation

@germainh512
Copy link

Summary

Split the 1130-line monolithic runner.py into 5 focused modules. Pure refactor — no behavior changes.

New module structure

python/gvtest/
├── runner.py        # Runner + Worker only (~300 lines, down from 1130)
├── targets.py       # Target class
├── tests.py         # TestRun, TestCommon, TestImpl, MakeTestImpl,
│                    #   GvrunTestImpl, SdkTestImpl, NetlistPowerSdkTestImpl
├── stats.py         # TestRunStats, TestStats, TestsetStats
├── reporting.py     # bcolors, table_dump_row
├── testset_impl.py  # TestsetImpl
├── config.py        # (unchanged)
└── testsuite.py     # (unchanged)

Backward compatibility

runner.py re-exports all moved classes, so existing code that does from gvtest.runner import Target etc. continues to work unchanged.

Verification

  • 116 unit tests: all passing
  • Real testsuite (gvsoc-sdk examples): 12/12 passing

Split the 1130-line monolithic runner.py into 5 focused modules:

- targets.py      — Target class (config, envvars, properties, sourceme)
- tests.py        — TestRun, TestCommon, TestImpl, MakeTestImpl,
                     GvrunTestImpl, SdkTestImpl, NetlistPowerSdkTestImpl
- stats.py        — TestRunStats, TestStats, TestsetStats
- reporting.py    — bcolors, table_dump_row
- testset_impl.py — TestsetImpl

runner.py now contains only Runner and Worker (~300 lines), with
re-exports for backward compatibility (existing imports from runner
still work).

Pure refactor — no behavior changes. 116 tests pass, real testsuite
(gvsoc-sdk examples) verified: 12/12.
@haugoug haugoug merged commit bf288b4 into gvsoc:main Mar 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants