#364 closed enhancement (fixed)

have "make test" check for freshness every time

Reported by: zooko Owned by: zooko
Priority: minor Milestone: 1.5.0
Component: packaging Version: 0.9.0
Keywords: Cc:
Launchpad Bug:

Description

Currently we have "make build" create a ".built" file, and we have "make test" depend on the ".built" file. This is to short-circuit asking our setup.py if everything is up to date, because that can take seconds.

However, the drawback of using the ".built" is that if you change something about your build (such as by running "darcs pull") and then run "make test", it might fail strangely because the build is stale.

One habit that some programmers have is "if anything fails strangely, then run make clean && make", but I don't like that because:

  1. I like for the appearance of strange failures to reliably indicate a problem that needs to be investigated.
  1. "make clean && make" can waste time, if it turns out that this wasn't the source of the strange failure.
  1. Some programmers aren't in that habit, and may give up once they get a strange test failure.
  1. A vague general principle: "If you ever have to type 'make clean', then your makefile suck."

I have proposed to Brian off-line that we make the "make test" target do a full freshness check, and have a separate target such as "make quick-test" which just looks at the .built file. Brian sort of tentatively agreed, but threatened to lose 3% efficiency by having to retrain his fingers to type "make quick-test" instead of "make test" every time...

Hm... I just tried the build step on my Macbook Pro and it takes less than 1 second. 'make build' takes about 1.3 seconds, but a good portion of that is in launching and running make. The build step itself -- which is just invoking "setup.py develop" -- takes 0.9 seconds. I thought it took several seconds when Brian and I were last discussing this. Maybe our build step got faster?

Okay, I propose:

  1. Brian tests how fast the build step runs on his computer.
  2. We add "make quick-test" and redefine "make test" to depend on the build target.
  3. We write emacs lisp scripts for Brian so that he never has to type "make quick-test" onto a keyboard with his own physical fingers.

P.S. Why am I getting around to posting this ticket just now, when Brian and I had this discussion a couple of weeks ago? Because I just now got confusing test failures which turned out to be due to a stale build.

Change History (2)

comment:1 Changed at 2008-06-01T21:12:53Z by warner

  • Milestone changed from eventually to 1.2.0
  • Owner changed from warner to zooko

this is done, right? Although every time I work on a new feature and get into my "edit; make test;" loop, I hit the relatively slow "make test" behavior and have to edit my command line to use "make quicktest".. but I'm willing to believe that I'm the only one who cares about this and I won't ask for it to be changed.

Moving to 1.2.0 to mean "this might be fixed in 1.1.0 but if it isn't we don't want to block the release for it". Reassigning to zooko for review.. please close if it the current behavior is good enough.

comment:2 Changed at 2008-08-19T18:05:10Z by zooko

  • Resolution set to fixed
  • Status changed from new to closed

Yes, this is done.

Note: See TracTickets for help on using tickets.