Skip to content

Instantly share code, notes, and snippets.

@lazywithclass
Last active March 21, 2017 23:35
Show Gist options
  • Save lazywithclass/ca6aa383c37303fd00fe022634c29a95 to your computer and use it in GitHub Desktop.
Save lazywithclass/ca6aa383c37303fd00fe022634c29a95 to your computer and use it in GitHub Desktop.
[RC Diary] winston-cloudwatch and cerebro (-70)

[RC Diary] winston-cloudwatch and cerebro (-70)

winston-cloudwatch

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 sent
  • getToken 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).

Cerebro

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment