Skip to content

Codify runner feature support#441

Merged
malclocke merged 2 commits into
mainfrom
runner-features
May 26, 2026
Merged

Codify runner feature support#441
malclocke merged 2 commits into
mainfrom
runner-features

Conversation

@malclocke

@malclocke malclocke commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

This is a proof of concept of embedding the features supported by each runner in the runner implementation.

Aim here is to solve a few problems:

  • Avoid "type switch" code. One example is fixed in this WIP, switching on split by example support base on runner name in request_param.go. There are others but I haven't implemented all of them in this WIP.
  • Generate to feature support matrix in README.md from code. This has accumulated some drift over time in the past and required manual fixups. To prove the point there is fix for drift included in this PR :)
  • This would give us a way to error when customers try to use a feature that is not supported in the runner, for example setting env vars or cli flags that are not supported by the runner. We've had confusion about this from users in the past.

Fixes TE-5965

// Splitting files by example is only supported for rspec, cucumber, and pytest runners
if runner.Name() != "RSpec" && runner.Name() != "Cucumber" && runner.Name() != "pytest" {
// Short circuit here if the runner doesn't support split by example
if !runner.SupportedFeatures().SplitByExample {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@malclocke malclocke force-pushed the runner-features branch 4 times, most recently from aefc81d to fbeccf3 Compare May 26, 2026 00:34
Comment thread README.md
| Feature | RSpec | Jest | Playwright | Cypress | pytest | pytest-pants | gotest | Cucumber | NUnit | Custom test runner |
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Split tests by file[^1] | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ |
| [Split slow files by individual test example](https://github.com/buildkite/test-engine-client/blob/main/docs/rspec.md#split-slow-files-by-individual-test-example) | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |

@malclocke malclocke May 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table has been updated with the output from go run util/supported_features/main.go

The diff of the 2 tables can be inspected visually with the "Display the rich diff" button in the file header.

The only differences in content are slight changes in the runner names in the header, and "Split by example" is corrected from false to true for Playwright.

@malclocke malclocke marked this pull request as ready for review May 26, 2026 00:49
@malclocke malclocke requested a review from a team as a code owner May 26, 2026 00:49
@malclocke malclocke requested a review from nprizal May 26, 2026 00:49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if cfg.TagFilters != "" && runner.Name() == "pytest" {

That can be replaced with runner.SupportedFeatures().FilterTestsByTag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to keep the touch and time to merge minimal with this PR by just including one cleanup example, and intend on following up over time with others.

I can try and clean everything up in this single PR if you like, LMK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

@nprizal nprizal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice!

@malclocke malclocke merged commit 03fae7e into main May 26, 2026
3 checks passed
@malclocke malclocke deleted the runner-features branch May 26, 2026 02:49
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