toptal / crystalball

Regression Test Selection library for your RSpec test suite

Home Page:https://toptal.github.io/crystalball/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

noralin opened this issue · comments

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?

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

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.

@noralin I guess you can use the same approach we've discussed here: #99

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

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

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