Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

imports break revel run myapp test on /@tests #82

Closed
purohit opened this Issue Feb 14, 2013 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

purohit commented Feb 14, 2013

I have a section in app.conf called [test], that has almost the same parameters (except a different db connection string).

If I take the default apptest.go, and add an import:

import  "github.com/robfig/revel"

->

import (
    "github.com/robfig/revel"
    "net/url"
)

and visit localhost:9000/@tests, I get:

Oops, an error occured
This exception has been logged.

but none of the logs show any errors. Running the tests from the command line with revel test myapp test works fine. Commenting out the import makes it work fine in /@tests. But of course, I can't really test anything without imports. It's not a huge deal since command-line tests are preferable anyway.

Contributor

robfig commented Feb 14, 2013

I believe the problem is that the import statement results in a compile error: imported and not used: "net/url". You can see that if you run it in [dev] run mode.

There are two things I should fix:

  1. That compilation error is not being printed to the ERROR logger
  2. The default 500 template only shows the detailed stack trace in the [dev] run mode. Instead, it should either be controllable using a config variable, or there should be some mechanism to allow the harness to just always show the detailed error (since the harness running at all is an indication of development).
Contributor

robfig commented Feb 19, 2013

Well, I fixed 1. in 8fe9547

I'm still thinking about how to fix 2. I guess adding an "app.mode" property which is either "prod" or "dev" would work, which is similar to the Play! approach. That could have a further benefit of setting different defaults for "dev" vs "prod" while still allowing complete configurability.

Contributor

purohit commented Feb 19, 2013

Thanks for fixing 1, before I was switching between revel run myapp and revel run myapp test to see errors 'cause I didn't know it was in TRACE.

@robfig robfig closed this in 1381d14 Mar 25, 2013

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