aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-08-20 20:58:49 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-08-20 20:58:49 +0100
commit7e29b8a770a45b68638f5dba9ad58b755ccb4749 (patch)
tree8e1a36d970191dfb8d95c86db3f87163f6d15047 /cmd
parent70b5eb8e1f220a2849a6759eda321205fcb79111 (diff)
Run some tests in parallel
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cashier/client_test.go3
-rw-r--r--cmd/cashierd/handlers_test.go5
2 files changed, 8 insertions, 0 deletions
diff --git a/cmd/cashier/client_test.go b/cmd/cashier/client_test.go
index dcf674b..8fe3cd0 100644
--- a/cmd/cashier/client_test.go
+++ b/cmd/cashier/client_test.go
@@ -19,6 +19,7 @@ import (
)
func TestLoadCert(t *testing.T) {
+ t.Parallel()
priv, _ := ssh.ParseRawPrivateKey(testdata.Priv)
key := priv.(*rsa.PrivateKey)
pub, _ := ssh.NewPublicKey(&key.PublicKey)
@@ -58,6 +59,7 @@ func TestLoadCert(t *testing.T) {
}
func TestSignGood(t *testing.T) {
+ t.Parallel()
res := &lib.SignResponse{
Status: "ok",
Response: string(testdata.Cert),
@@ -86,6 +88,7 @@ func TestSignGood(t *testing.T) {
}
func TestSignBad(t *testing.T) {
+ t.Parallel()
res := &lib.SignResponse{
Status: "error",
Response: `{"response": "error"}`,
diff --git a/cmd/cashierd/handlers_test.go b/cmd/cashierd/handlers_test.go
index db5efb4..38251ce 100644
--- a/cmd/cashierd/handlers_test.go
+++ b/cmd/cashierd/handlers_test.go
@@ -51,6 +51,7 @@ func newContext(t *testing.T) *appContext {
}
func TestLoginHandler(t *testing.T) {
+ t.Parallel()
req, _ := http.NewRequest("GET", "/auth/login", nil)
resp := httptest.NewRecorder()
loginHandler(newContext(t), resp, req)
@@ -60,6 +61,7 @@ func TestLoginHandler(t *testing.T) {
}
func TestCallbackHandler(t *testing.T) {
+ t.Parallel()
req, _ := http.NewRequest("GET", "/auth/callback", nil)
req.Form = url.Values{"state": []string{"state"}, "code": []string{"abcdef"}}
resp := httptest.NewRecorder()
@@ -72,6 +74,7 @@ func TestCallbackHandler(t *testing.T) {
}
func TestRootHandler(t *testing.T) {
+ t.Parallel()
req, _ := http.NewRequest("GET", "/", nil)
resp := httptest.NewRecorder()
ctx := newContext(t)
@@ -87,6 +90,7 @@ func TestRootHandler(t *testing.T) {
}
func TestRootHandlerNoSession(t *testing.T) {
+ t.Parallel()
req, _ := http.NewRequest("GET", "/", nil)
resp := httptest.NewRecorder()
ctx := newContext(t)
@@ -97,6 +101,7 @@ func TestRootHandlerNoSession(t *testing.T) {
}
func TestSignRevoke(t *testing.T) {
+ t.Parallel()
s, _ := json.Marshal(&lib.SignRequest{
Key: string(testdata.Pub),
ValidUntil: time.Now().UTC().Add(1 * time.Hour),