florence / cover

a code coverage tool for racket
MIT License
38 stars 7 forks source link

Raco cover fails with "hash-ref - no value found for key" #80

Closed jackfirth closed 9 years ago

jackfirth commented 9 years ago

I am getting the following error with raco cover in my generic-syntax-expanders package in Travis CI:

hash-ref: no value found for key
  key: '("/home/travis/build/jackfirth/generic-syntax-expanders/generic-syntax-expanders/expander-types.rkt" #f #f 76 272)
  context...:
   /home/travis/build/jackfirth/generic-syntax-expanders/generic-syntax-expanders/expander-types.rkt: [running body]
   /home/travis/.racket/6.1.1/pkgs/cover/cover.rkt:171:4: cover-compile
   standard-module-name-resolver
   /home/travis/.racket/6.1.1/pkgs/cover/cover.rkt:53:0: test-files!7
   (submod /home/travis/.racket/6.1.1/pkgs/cover/raco.rkt main): [running body]
   /home/travis/racket/collects/raco/raco.rkt: [running body]
   /home/travis/racket/collects/raco/main.rkt: [running body]

I can't make heads or tails of what this error means or how to resolve it, nor what caused it. Repo is here, travis build logs are here

florence commented 9 years ago

Yeah, this is an internal error. This happens when something compiled by cover is used at compile time (either by (require (for-syntax ...)) or by begin-for-syntax). Roughly this is because racket separates its compile and runtime environments, so at anything above phase 0 the coverage environment is improperly initialized.

This as a duplicate of #77. I have a potential good fix, but I haven't gotten the new instrumentation to work right. In the mean time I've pushed a repair that will stop the build from crashing. Your coverage reports may be inaccurate (compile-time-only expressions wont get marked as covered), but at least the build wont explode. If you install Cover directly from github you'll have the patch now, otherwise you will need to wait for the pkg build server to get around to updating.