[racket] How to run tests for a package install

From: Greg Hendershott (greghendershott at gmail.com)
Date: Fri Nov 8 16:09:56 EST 2013

On Fri, Nov 8, 2013 at 10:32 AM, Greg Hendershott <greghendershott at gmail.com>
wrote:
> I gave a bad example of a GitHub package URL there. It needs a branch
> on the end. Instead of:
>
> pkg install github://github.com/greghendershott/markdown
>
> should be:
>
> pkg install github://github.com/greghendershott/markdown/master
>
> Although that's N/A to my question, I don't want to mislead anyone
> with a bad example.

Sigh. This is also misleading. This would be fine if Travis CI were always
invoked to test the master branch. But not necessarily. It could be invoked
to test another, "topic" branch. It could be invoked on a branch for a pull
request -- precisely one of the coolest ways Travis CI can help, by testing
other people's PRs even if they forgot to, and showing you the result right
there in the PR UI on GitHub.

So the correct thing to use here is raco pkg install --link. i.e. Install
using whatever source Travis CI `git clone`d earlier in the process.

The only other trick is that --link by itself won't install dependencies.
So we need to add `--deps search-auto`. Which we'd want anyway, for the
`search-auto`, so that this automated thing will proceed without asking
about installing deps.

TL;DR: Adding in Jay's tip re raco test -p means the whole thing would be:

script:
- cd .. # because Travis did a `cd` into our repo dir, and next...
- raco pkg install --deps search-auto --link <pkg>
- raco test -x -p <pkg>

This is the simplest way to handle a package that depends on other
packages. (If you're testing a non-package, you have to use the original
way. Of course that might be another reason to make it a package,
especially if it has deps.)

I have a blog post about this that I'll update accordingly, as well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131108/e832b6a5/attachment.html>

Posted on the users mailing list.