1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00

go.tools/dashboard/app: fix integration tests

They had been broken after a few recent changes.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/152150043
This commit is contained in:
Andrew Gerrand 2014-10-04 08:33:52 +10:00
parent d322540ca7
commit fce07d6ae8

View File

@ -72,10 +72,10 @@ var testRequests = []struct {
res interface{}
}{
// Packages
{"/packages?kind=subrepo", nil, nil, []*Package{testPackage}},
{"/packages", url.Values{"kind": {"subrepo"}}, nil, []*Package{testPackage}},
// Go repo
{"/commit", nil, tCommit("0001", "0000", "", true), nil},
{"/commit", nil, tCommit("0001", "", "", true), nil},
{"/commit", nil, tCommit("0002", "0001", "", false), nil},
{"/commit", nil, tCommit("0003", "0002", "", true), nil},
{"/todo", url.Values{"kind": {"build-go-commit"}, "builder": {"linux-386"}}, nil, &Todo{Kind: "build-go-commit", Data: &Commit{Hash: "0003"}}},
@ -119,7 +119,7 @@ var testRequests = []struct {
{"/result", nil, &Result{Builder: "linux-386", Hash: "0003", OK: false, Log: "test"}, nil},
// non-Go repos
{"/commit", nil, tCommit("1001", "1000", testPkg, false), nil},
{"/commit", nil, tCommit("1001", "", testPkg, false), nil},
{"/commit", nil, tCommit("1002", "1001", testPkg, false), nil},
{"/commit", nil, tCommit("1003", "1002", testPkg, false), nil},
{"/todo", url.Values{"kind": {"build-package"}, "builder": {"linux-386"}, "packagePath": {testPkg}, "goHash": {"0001"}}, nil, &Todo{Kind: "build-package", Data: &Commit{Hash: "1003"}}},
@ -256,7 +256,9 @@ func testHandler(w http.ResponseWriter, r *http.Request) {
}
url := "http://" + domain + t.path
if t.vals != nil {
url += "?" + t.vals.Encode()
url += "?" + t.vals.Encode() + "&version=2"
} else {
url += "?version=2"
}
req, err := http.NewRequest("POST", url, body)
if err != nil {