Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
023a7e88
Commit
023a7e88
authored
May 31, 2012
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc/dashboard/app: fix tests
R=golang-dev, dsymonds CC=golang-dev
https://golang.org/cl/6244069
parent
5b2cd445
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
test.go
misc/dashboard/app/build/test.go
+17
-16
No files found.
misc/dashboard/app/build/test.go
View file @
023a7e88
...
...
@@ -43,14 +43,15 @@ var testPackages = []*Package{
var
tCommitTime
=
time
.
Now
()
.
Add
(
-
time
.
Hour
*
24
*
7
)
func
tCommit
(
hash
,
parentHash
string
)
*
Commit
{
func
tCommit
(
hash
,
parentHash
,
path
string
)
*
Commit
{
tCommitTime
.
Add
(
time
.
Hour
)
// each commit should have a different time
return
&
Commit
{
Hash
:
hash
,
ParentHash
:
parentHash
,
Time
:
tCommitTime
,
User
:
"adg"
,
Desc
:
"change description"
,
PackagePath
:
path
,
Hash
:
hash
,
ParentHash
:
parentHash
,
Time
:
tCommitTime
,
User
:
"adg"
,
Desc
:
"change description "
+
hash
,
}
}
...
...
@@ -64,9 +65,9 @@ var testRequests = []struct {
{
"/packages?kind=subrepo"
,
nil
,
nil
,
[]
*
Package
{
testPackage
}},
// Go repo
{
"/commit"
,
nil
,
tCommit
(
"0001"
,
"0000"
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0002"
,
"0001"
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0003"
,
"0002"
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0001"
,
"0000"
,
""
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0002"
,
"0001"
,
""
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0003"
,
"0002"
,
""
),
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-386"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0003"
}}},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-amd64"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0003"
}}},
{
"/result"
,
nil
,
&
Result
{
Builder
:
"linux-386"
,
Hash
:
"0001"
,
OK
:
true
},
nil
},
...
...
@@ -81,12 +82,12 @@ var testRequests = []struct {
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-amd64"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0002"
}}},
// branches
{
"/commit"
,
nil
,
tCommit
(
"0004"
,
"0003"
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0005"
,
"0002"
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0004"
,
"0003"
,
""
),
nil
},
{
"/commit"
,
nil
,
tCommit
(
"0005"
,
"0002"
,
""
),
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-386"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0005"
}}},
{
"/result"
,
nil
,
&
Result
{
Builder
:
"linux-386"
,
Hash
:
"0005"
,
OK
:
true
},
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-386"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0004"
}}},
{
"/result"
,
nil
,
&
Result
{
Builder
:
"linux-386"
,
Hash
:
"0004"
,
OK
:
tru
e
},
nil
},
{
"/result"
,
nil
,
&
Result
{
Builder
:
"linux-386"
,
Hash
:
"0004"
,
OK
:
fals
e
},
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-go-commit"
},
"builder"
:
{
"linux-386"
}},
nil
,
&
Todo
{
Kind
:
"build-go-commit"
,
Data
:
&
Commit
{
Hash
:
"0003"
}}},
// logs
...
...
@@ -98,9 +99,9 @@ var testRequests = []struct {
{
"/result"
,
nil
,
&
Result
{
Builder
:
"linux-386"
,
Hash
:
"0003"
,
OK
:
false
,
Log
:
"test"
},
nil
},
// non-Go repos
{
"/commit"
,
nil
,
&
Commit
{
PackagePath
:
testPkg
,
Hash
:
"1001"
,
ParentHash
:
"1000"
}
,
nil
},
{
"/commit"
,
nil
,
&
Commit
{
PackagePath
:
testPkg
,
Hash
:
"1002"
,
ParentHash
:
"1001"
}
,
nil
},
{
"/commit"
,
nil
,
&
Commit
{
PackagePath
:
testPkg
,
Hash
:
"1003"
,
ParentHash
:
"1002"
}
,
nil
},
{
"/commit"
,
nil
,
tCommit
(
"1001"
,
"1000"
,
testPkg
)
,
nil
},
{
"/commit"
,
nil
,
tCommit
(
"1002"
,
"1001"
,
testPkg
)
,
nil
},
{
"/commit"
,
nil
,
tCommit
(
"1003"
,
"1002"
,
testPkg
)
,
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-package"
},
"builder"
:
{
"linux-386"
},
"packagePath"
:
{
testPkg
},
"goHash"
:
{
"0001"
}},
nil
,
&
Todo
{
Kind
:
"build-package"
,
Data
:
&
Commit
{
Hash
:
"1003"
}}},
{
"/result"
,
nil
,
&
Result
{
PackagePath
:
testPkg
,
Builder
:
"linux-386"
,
Hash
:
"1003"
,
GoHash
:
"0001"
,
OK
:
true
},
nil
},
{
"/todo"
,
url
.
Values
{
"kind"
:
{
"build-package"
},
"builder"
:
{
"linux-386"
},
"packagePath"
:
{
testPkg
},
"goHash"
:
{
"0001"
}},
nil
,
&
Todo
{
Kind
:
"build-package"
,
Data
:
&
Commit
{
Hash
:
"1002"
}}},
...
...
@@ -230,7 +231,7 @@ func testHandler(w http.ResponseWriter, r *http.Request) {
return
}
}
fmt
.
Fprint
(
w
,
"PASS"
)
fmt
.
Fprint
(
w
,
"PASS
\n
You should see only one mail notification (for 0003/linux-386) in the dev_appserver logs.
"
)
}
func
nukeEntities
(
c
appengine
.
Context
,
kinds
[]
string
)
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment