New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make process runner configurable #38
Conversation
Somehow I feel icky about the {
command-runner: {
runner: "sbt"
command: "test -DskipStuff=true"
}
} For sure this will make it usable for all build tools but it has some big downsides. |
Great that you're using the same name here: |
@legopiraat I imagine with a SBT (or other) plugin the syntax would be like this, as it won't be a command-runner:
I'm not opposed to splitting the command and args into separate values. That would also make it easier to put out a warning when we have a plugin to use instead. |
If you don't mind I think it would be a good idea to split it up. And indeed it will be easier for us to putt out the notifications I suppose a lot of users would appreciate that. |
I've split the command and args into separate values |
/** Reads a test-runner from the ConfigReader | ||
* For now, this is always a command-runner object, but in the future can be expanded to include other test-runners | ||
*/ | ||
object TestRunnerReader extends ConfigReader[TestRunner] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the custom ConfigReader
, maintainability is not that good. To get better maintainability we could and should make it an ADT and use option one.
trait TestRunner | ||
|
||
case class CommandRunner(command: Command) extends TestRunner { | ||
override def toString: String = s"""{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make an issue for these toString methods, it's already getting tedious in my opinion.
We should be able to generate this format really easy I guess.
new LogRunReporter() | ||
) | ||
|
||
stryker4s.run() | ||
|
||
def resolveRunner()(implicit config: Config): MutantRunner = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private
Turns out Pureconfig also has a ConfigWriter function, for writing objects to Typesafe config. I've implemented this, which also fixes #39. I've also removed the TestRunnerReader completely, though the configuration is slightly different. Configuring the TestRunner would now look like this:
I'm not completely opposed to the |
Fixes #36
Added the option to configure the test command that the ProcessRunner runs. It can be configured with a
command-runner
test-runner. Future test-runners could be configured in a way similar to Stryker's test-runners and read in the TestReader.I added a new TestRunner config value instead of adding the correct MutantRunner as it made more sense to me to keep configuration in the Config object instead of adding an implementation to it. I am not sure about the naming of the classes yet, I think they are confusing. But also don't know what would be better.