Skip to content

Codify runner feature support#441

Draft
malclocke wants to merge 1 commit intomainfrom
runner-features
Draft

Codify runner feature support#441
malclocke wants to merge 1 commit intomainfrom
runner-features

Conversation

@malclocke
Copy link
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.
  • This would give us a way to generate to feature support matrix in README.md from code. This has accumulated some drift over time in the past and required manual fixups.
  • 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.

// 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
Contributor

Choose a reason for hiding this comment

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

nice!

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