Compare commits

...

13 Commits

Author SHA1 Message Date
notzippy
7eda33eb71 Merge pull request #93 from notzippy/cmd-fix
Fixed captialization
2017-05-31 20:25:56 -07:00
NotZippy
1c5fb4a6f8 Fixed captialization 2017-05-31 20:25:04 -07:00
Brenden Soares
a699dab33d Merge pull request #61 from krhubert/develop
Use config.http.addr and config.http.ssl for create baseURL local server
2017-05-30 21:46:51 -07:00
NotZippy
e1776bda3c Rollback a change that was committed by mistake to develop branch 2017-04-26 21:04:12 -07:00
notzippy
d68b27ae81 Merge pull request #86 from tw4452852/version
fix version check against devel
2017-04-21 08:55:01 -07:00
Brenden Soares
ce84b78204 Merge pull request #85 from revel/app.conf-cleanup-1
Adding consistent values and example formatting
2017-04-15 18:57:56 -07:00
Tw
19ca52182d fix version check against devel
Signed-off-by: Tw <tw19881113@gmail.com>
2017-04-10 22:31:37 +08:00
Brenden Soares
bf30aab381 Adding consistent values and example formatting 2017-04-07 12:05:14 -07:00
notzippy
bd4663b651 Merge pull request #84 from revel/app.conf-cleanup-1
App.conf cleanup 1
2017-04-07 12:05:08 -07:00
Brenden Soares
b81860de5f Remove unneeded quotes 2017-04-07 11:34:44 -07:00
NotZippy
d2b1730439 Makes it so harness can bootstrap using the new GoRequest / response wrappers 2017-04-04 17:17:23 -07:00
krhubert
0381636044 Typo in httpProto 2016-08-17 10:20:13 +02:00
krhubert
fb3980ce9d Use config.http.addr and config.http.ssl for create baseURL test server 2016-08-11 11:41:48 +02:00
3 changed files with 80 additions and 28 deletions

View File

@@ -88,8 +88,9 @@ func Build(buildFlags ...string) (app *App, compileError *revel.Error) {
revel.ImportPath, appVersion, revel.ImportPath, buildTime)
// TODO remove version check for versionLinkerFlags after Revel becomes Go min version to go1.5
goVersion, _ := strconv.ParseFloat(runtime.Version()[2:5], 64)
if goVersion < 1.5 {
goVersion, err := strconv.ParseFloat(runtime.Version()[2:5], 64)
// runtime.Version() may return commit hash, we assume it is above 1.5
if goVersion < 1.5 && err == nil {
versionLinkerFlags = fmt.Sprintf("-X %s/app.AppVersion \"%s\" -X %s/app.BuildTime \"%s\"",
revel.ImportPath, appVersion, revel.ImportPath, buildTime)
}
@@ -286,7 +287,7 @@ func calcImportAliases(src *SourceInfo) map[string]string {
}
func addAlias(aliases map[string]string, importPath, pkgName string) {
alias, ok := aliases[importPath]
alias, ok := aliases[importPath]
if ok {
return
}
@@ -297,7 +298,7 @@ func addAlias(aliases map[string]string, importPath, pkgName string) {
func makePackageAlias(aliases map[string]string, pkgName string) string {
i := 0
alias := pkgName
for containsValue(aliases, alias) {
for containsValue(aliases, alias) || alias=="revel" {
alias = fmt.Sprintf("%s%d", pkgName, i)
i++
}

View File

@@ -3,7 +3,8 @@
# More info at http://revel.github.io/manual/appconf.html
################################################################################
# Sets the `AppName` variable which can be used in your code as
# Sets `revel.AppName` for use in-app.
# Example:
# `if revel.AppName {...}`
app.name = {{ .AppName }}
@@ -13,7 +14,7 @@ app.name = {{ .AppName }}
# into your application
app.secret = {{ .Secret }}
# Revel running behind proxy like nginx, haproxy, etc
# Revel running behind proxy like nginx, haproxy, etc.
app.behind.proxy = false
@@ -57,10 +58,11 @@ cookie.prefix = REVEL
# as false.
# cookie.secure = false
# Limit cookie access to a given domain
# Limit cookie access to a given domain.
#cookie.domain =
# Define when your session cookie expires. Possible values:
# Define when your session cookie expires.
# Values:
# "720h"
# A time duration (http://golang.org/pkg/time/#ParseDuration) after which
# the cookie expires and the session is invalid.
@@ -82,7 +84,7 @@ format.datetime = 2006-01-02 15:04
results.chunked = false
# Prefixes for each log message line
# Prefixes for each log message line.
# User can override these prefix values within any section
# For e.g: [dev], [prod], etc
log.trace.prefix = "TRACE "
@@ -107,30 +109,57 @@ module.static=github.com/revel/modules/static
################################################################################
# Section: dev
# This section is evaluated when running Revel in dev mode. Like so:
# `revel run path/to/myapp`
[dev]
# This sets `DevMode` variable to `true` which can be used in your code as
# This sets `revel.DevMode` for use in-app.
# Example:
# `if revel.DevMode {...}`
# or in your templates with
# `{{.DevMode}}`
# Values:
# "true"
# Sets `DevMode` to `true`.
# "false"
# Sets `DevMode` to `false`.
mode.dev = true
# Pretty print JSON/XML when calling RenderJSON/RenderXML
# Values:
# "true"
# Enables pretty printing.
# "false"
# Disables pretty printing.
results.pretty = true
# Automatically watches your applicaton files and recompiles on-demand
# Watch your applicaton files for changes and automatically rebuild
# Values:
# "true"
# Enables auto rebuilding.
# "false"
# Disables auto rebuilding.
watch = true
# If you set watch.mode = "eager", the server starts to recompile
# your application every time your application's files change.
watch.mode = "normal"
# Define when to rebuild new changes.
# Values:
# "normal"
# Rebuild when a new request is received and changes have been detected.
# "eager"
# Rebuild as soon as changes are detected.
watch.mode = normal
# Watch the entire $GOPATH for code changes. Default is false.
# Watch the entire `$GOPATH` for changes.
# Values:
# "true"
# Includes `$GOPATH` in watch path.
# "false"
# Excludes `$GOPATH` from watch path. Default value.
#watch.gopath = true
@@ -141,20 +170,34 @@ module.testrunner = github.com/revel/modules/testrunner
# Where to log the various Revel logs
# Values:
# "off"
# Disable log output.
# "stdout"
# Log to OS's standard output.
# "stderr"
# Log to Os's standard error output. Default value.
# "relative/path/to/log"
# Log to file.
log.trace.output = off
log.info.output = stderr
log.warn.output = stderr
log.error.output = stderr
# Revel log flags. Possible flags defined by the Go `log` package,
# please refer https://golang.org/pkg/log/#pkg-constants
# Go log is "Bits or'ed together to control what's printed"
# Examples:
# 0 => just log the message, turn off the flags
# 3 => log.LstdFlags (log.Ldate|log.Ltime)
# 19 => log.Ldate|log.Ltime|log.Lshortfile
# 23 => log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile
# Revel log flags. Possible flags defined by the Go `log` package. Go log is
# "Bits OR'ed together to control what's printed
# See:
# https://golang.org/pkg/log/#pkg-constants
# Values:
# "0"
# Just log the message, turn off the flags.
# "3"
# log.LstdFlags (log.Ldate|log.Ltime)
# "19"
# log.Ldate|log.Ltime|log.Lshortfile
# "23"
# log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile
log.trace.flags = 19
log.info.flags = 19
log.warn.flags = 19
@@ -169,6 +212,7 @@ log.error.flags = 19
log.request.output = stderr
################################################################################
# Section: prod
# This section is evaluated when running Revel in production mode. Like so:
@@ -176,18 +220,15 @@ log.request.output = stderr
# See:
# [dev] section for documentation of the various settings
[prod]
mode.dev = false
mode.dev = false
results.pretty = false
watch = false
module.testrunner =
log.trace.output = off
log.info.output = off
log.warn.output = log/%(app.name)s.log

View File

@@ -97,8 +97,18 @@ func testApp(args []string) {
defer cmd.Kill()
revel.INFO.Printf("Testing %s (%s) in %s mode\n", revel.AppName, revel.ImportPath, mode)
var httpAddr = revel.HTTPAddr
if httpAddr == "" {
httpAddr = "127.0.0.1"
}
var httpProto = "http"
if revel.HTTPSsl {
httpProto = "https"
}
// Get a list of tests
var baseURL = fmt.Sprintf("http://127.0.0.1:%d", revel.HTTPPort)
var baseURL = fmt.Sprintf("%s://%s:%d", httpProto, httpAddr, revel.HTTPPort)
testSuites, _ := getTestsList(baseURL)
// If a specific TestSuite[.Method] is specified, only run that suite/test