Debugging flaky tests with Bazel

Suppose you have a test that is passing… most of the time. When you start debugging it, you might try running the test and, unhelpfully, it passes: $ bazel test :flaker INFO: Found 1 test target… Target //:flaker up-to-date: bazel-bin/flaker INFO: Elapsed time: 0.223s, Critical Path: 0.04s //:flaker PASSED Executed 1 out of 1 tests:Continue reading “Debugging flaky tests with Bazel”

The Return of the Scala Rule Tutorial: The Execution

This builds on the first part of the tutorial. In this post, we will make the the rule actually produce an executable. Capturing the output from scalac At the end of the tutorial last time, we were calling scalac, but ignoring the result: (cd /private/var/tmp/_bazel_kchodorow/92df5f72e3c78c053575a1a42537d8c3/blerg && exec env – /bin/bash -c ‘external/scala/bin/scalac HelloWorld.scala; echo ”’blah”’Continue reading “The Return of the Scala Rule Tutorial: The Execution”

Tutorial: how to write Scala rules for Bazel

Bazel comes with built-in support for several languages and allows you to write your own support for any other languages in Python. Although you could probably get more abstract, let’s define a rule as something that takes some files, does something to them, and then gives you some output files. Specifically, for this example, weContinue reading “Tutorial: how to write Scala rules for Bazel”

Positive reinforcement learning through barbacoa

Yesterday I had some extra barbacoa that Domino was super excited about and Andrew suggested I use it to teach him (Domino, not Andrew) how to lie down on command. I waited until he lay down on his own, said “yes!” and gave him a piece of barbacoa. He leapt up and ate the barbacoaContinue reading “Positive reinforcement learning through barbacoa”

Pain-free OAuth with AppEngine

I do a lot of side projects (or at least start them) and implementing authentication is always like chewing on razor blades. I started another project recently using AppEngine and, bracing myself with a lot of caffeine and “suck it up, princess” attitude, I started doing “oauth appengine” searches. After digging through some documentation, IContinue reading “Pain-free OAuth with AppEngine”

API changes with extra cheese, hold the fear

When you make a change, how do you know what tests to run? If you’re lucky, no one else depends on your code so you can just run your own tests and you’re done. However, if you’re writing useful code, other people are probably going to start depending on it. Once that happens, it becomesContinue reading “API changes with extra cheese, hold the fear”

Have you ever looked at your build? I mean, really looked at your build?

Bazel has a feature that lets you see a graph of your build dependencies. It could help you debug things, but honestly it’s just really cool to see what your build is doing. To try it out, you’ll need a project that uses Bazel to build. If you don’t have one handy, here’s a tinyContinue reading “Have you ever looked at your build? I mean, really looked at your build?”