Open jeffsaremi opened 1 year ago
@jeffsaremi
Hello there, one of the possible ways is to define your own runner class which will just send the prediction back to output and then exit. Here is some code:
# custom_runner.rb
class CustomRunner < ::Crystalball::RSpec::Runner
class << self
def run(args, err = $stderr, out = $stdout)
return config["runner_class"].run(args, err, out) unless config["runner_class"] == self
out.puts(build_prediction)
end
end
end
and then use this runner via config:
# crystalball.yml
requires:
- './custom_runner.rb'
# Custom RSpec runner class to use. Default: 'Crystalball::RSpec::Runner'
runner_class_name: 'CustomRunner'
.....
or (if some flexibility needed) via ENV var:
$ CRYSTALBALL_RUNNER_CLASS_NAME=CustomRunner bundle exec crystalball
I don't want to run the actual tests using
bundle exec crystalball
And where the tests are running, there is not git sandbox Instead I'd like to run a command likebundle exec crystalball predict
and then get a list of source files or rspec tests that need can be used to runbundle exec rspec ...
Is this possible currently?