Closed ndbroadbent closed 6 years ago
Looking at the config, I can see that "map_path" and "execution_map_path" are actually 2 different things. I ran my test suite and crystalball
generated a file at ./execution_map.yml
, but I don't have any files at tmp/execution_maps
.
I tried copying ./execution_map.yml
to tmp/execution_maps
, and it seemed to get a bit further. I have no idea if that's the correct thing to do, and the documentation is not very clear. But now it crashes with: Repository is not pristine! Please stash all your changes
.
Is it not possible to run crystalball
if you have unstaged changes? I don't want to have to commit all my changes before I run the tests.
OHHH I think the example crystalball.yml
config is out of date: https://github.com/toptal/crystalball/blob/master/spec/fixtures/crystalball.yml
execution_map_path
should be renamed to map_path
.
I finally got something running! The main thing was wrapping the Crystalball config in a condition, so that it doesn't complain about changed files all the time:
if ENV['CRYSTALBALL']
require 'crystalball'
Crystalball::MapGenerator.start! do |config|
config.map_storage_path = 'tmp/execution_map.yml'
config.register Crystalball::MapGenerator::CoverageStrategy.new
end
end
And I also fixed the map_storage_path
in spec_helper
, and set it in config/crystalball.yml
:
map_path: 'tmp/execution_map.yml'
But I should point out that the documentation for examples_limit
in the example config is not accurate:
# Maximum amount of examples which will be run automatically. Default: no limit.
# If prediction size is over the limit Crystalball will prune prediction to fit the limit.
examples_limit: 1
Crystalball doesn't prune the predictions to fit the limit, it just aborts all of the tests and doesn't run anything:
Example group size (14) is over the limit (1)
Aborting spec run
@ndbroadbent hi, thanks for feedback. You are probably using latest master which wasn't released yet. Anyway we'll address issues you pointed out pretty soon.
Oh, I see! That makes sense. Well I've managed to get it working, and it works very well! Thanks for building this!
https://github.com/toptal/crystalball/commit/e97ec75b4572fc9da7f198aa9e4581fd2d53a6c2 should fix this issue
rspec
generates a file at./execution_map.yml
, but thecrystalball
command looks fortmp/execution_maps
by default.How can I keep these in sync?