Merge pull request #47 from shxsun/master

add start.sh and start.bat  and python test init scripts
tokarchuk/v1.17
Lunny Xiao 11 years ago
commit dd9fb807a4
  1. 13
      .gitignore
  2. 4
      .gobuild.yml
  3. 2
      start.bat
  4. 6
      start.sh
  5. 9
      tests/.travel.yml
  6. 11
      tests/README.md
  7. 17
      tests/default_test.go
  8. 3
      web.go

13
.gitignore vendored

@ -1,9 +1,3 @@
<<<<<<< HEAD
gogs
*.exe
*.exe~
.DS_Store
*.db
*.log
@ -14,8 +8,6 @@ data/
*.iml
public/img/avatar/
=======
>>>>>>> b4db9f67548a41922f1b337daf9c9d2b975b55c4
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
@ -37,4 +29,7 @@ _cgo_export.*
_testmain.go
*.exe
*.exe
*.exe~
gogs
__pycache__

@ -5,4 +5,6 @@ filesets:
- conf
- LICENSE
- README.md
- README_ZH.md
- README_ZH.md
- start.bat
- start.sh

@ -0,0 +1,2 @@
@echo off
gogs.exe web

@ -0,0 +1,6 @@
#!/bin/bash -
#
# start gogs web
#
cd "$(dirname $0)"
./gogs web

@ -0,0 +1,9 @@
command: go test -v {}
include: ^.+_test\.go$
path: ./
depth: 1
verbose: true
timeout: 1m
reload: false
html: test.html
notify: []

@ -0,0 +1,11 @@
## gogs test
this is for developers
## prepare environment
go get -u github.com/shxsun/travelexec
# start gogs server
gogs web
## start test
travelexec

@ -0,0 +1,17 @@
package test
import (
"net/http"
"testing"
)
func TestMain(t *testing.T) {
r, err := http.Get("http://localhost:3000/")
if err != nil {
t.Fatal(err)
}
defer r.Body.Close()
if r.StatusCode != http.StatusOK {
t.Error(r.StatusCode)
}
}

@ -160,6 +160,7 @@ func runWeb(*cli.Context) {
base.Cfg.MustValue("server", "HTTP_PORT", "3000"))
log.Info("Listen: %s", listenAddr)
if err := http.ListenAndServe(listenAddr, m); err != nil {
log.Critical(err.Error())
fmt.Println(err.Error())
//log.Critical(err.Error()) // not working now
}
}

Loading…
Cancel
Save