toptal / crystalball

Regression Test Selection library for your RSpec test suite
https://toptal.github.io/crystalball/
MIT License
321 stars 41 forks source link

Is there a way to look at diff a different way? Like passing in files? SHA's? #101

Open noralin opened 6 years ago

noralin commented 6 years ago

Right now you support getting diff from unstaged changes, what if we want to run all the specs in our ci? We'd need to commit our changes first. So could you provide guidance on where I would change to be able to look at diff by providing a list of files? or maybe by providing SHA's?

pluff commented 6 years ago

You can specify SHA's in config file https://toptal.github.io/crystalball/runner/#config-file E.g.

# crystalball.yml
diff_from: "origin/master"
diff_to: "HEAD"

or you can set it explicitly with CRYSTALBALL_DIFF_FROM and CRYSTALBALL_DIFF_TO variables

noralin commented 6 years ago

Thanks!! When I specify diff_from: "origin/master", it picks up specs from the gem, because one of my commit introduces this gem, is there a way to exclude them? ex: /vendor/cache/crystalball-bb6941984dbd/spec/logging_spec.rb is in the prediction list.

pluff commented 6 years ago

@noralin I guess you can use the same approach we've discussed here: https://github.com/toptal/crystalball/issues/99

Also PRs are highly appreciated if you want to add support of filtering predictions.

noralin commented 6 years ago

For that one, I ended up extending Crystalball::RSpec::Runner because I wanted to be able to provide a argument on runtime to exclude/include feature specs. So basically being able to run bundle exec crystalball --exclude-feature-specs. Is that a good solution? I can do the same to filter out vendor/cache/...spec

pluff commented 5 years ago

I'm reopening this one to reflect that this feature is waiting for a contributor.