I've released version 1.11.0 today, which adds
- a security check to avoid sending empty logs (again)
- a simulation tool so that we could easily test error conditions
- retrying to submit if we get an error
- retrying with another token if we get an InvalidSequenceTokenException
Overall I'm pretty satisfied with how it went together, even though I still don't like the way I am using setInterval
to keep
the process running.
I could benefit from some kind of centralised handling of
logEvents
that still need to be sentgetToken
function
something that would allow me to just say getNext
and don't worry about the details. For example for getToken
it would
give me last known good token or, if a call is under way give me a promise (or a callback or whatever).
So now Cerebro works in a barely minimum way. I should look forward and understand in which direction to expand it, I think I have few options:
- add more mutations
- cover more complex projects
- get src path and test path from the command line
- improve the reporter
I think all of those have some advantages, but before adding mutations I think I have to get paths from the command line so I could handle bigger projects and then decide, by looking at their source code, what are the best mutations to implement, or I could just cheat and have a look at what mutant does.
I think the first option is safer, so, paths and bigger projects.
Paths was easy. Now the difficult part is to mutate other projects, after a brief search it became clear that I need more features in Cerebro:
- mutate only when test covered, because so I could run Cerebro on a wider range of projects without worrying that I get false positives
- build some kind of tool that could tell me which projects use mocha as testing tool, I've had a hard time finding a few
I also think that probably I have to rethink my vm
approach since I'm not exactly sure how Professor X will be able to
arbitrarily take a project and run its test in the sandbox. Again: it would be so much easier to write files to disk, but
then the whole "Professor X runs Cerebro" thing could not be done because of architectural speed limits.