From ff0bc7b98b4ac2a289ba396477cae69ba20ffde9 Mon Sep 17 00:00:00 2001 From: "diamondburned (Forefront)" Date: Mon, 20 Jan 2020 03:15:41 -0800 Subject: [PATCH] Tweaks to tests and CI --- .gitlab-ci.yml | 5 +++-- api/rate/majors_test.go | 2 ++ api/rate/rate_test.go | 2 ++ bot/ctx_test.go | 2 ++ bot/nameflag_test.go | 2 ++ bot/subcommand_test.go | 2 ++ handler/handler_test.go | 2 ++ 7 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4b4e91..12d7d80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ stages: unit_test: stage: test script: - - go test -v ./... + - go test -tags unit -v ./... integration_test: stage: test @@ -21,5 +21,6 @@ integration_test: variables: - $BOT_TOKEN script: - - go test -tags integration -v ./... + # Timeout test after 120 seconds (2 minutes) + - timeout 120 go test -tags integration -v ./... diff --git a/api/rate/majors_test.go b/api/rate/majors_test.go index 4f1e09d..810a41e 100644 --- a/api/rate/majors_test.go +++ b/api/rate/majors_test.go @@ -1,3 +1,5 @@ +// +build unit + package rate import "testing" diff --git a/api/rate/rate_test.go b/api/rate/rate_test.go index b20013e..696e213 100644 --- a/api/rate/rate_test.go +++ b/api/rate/rate_test.go @@ -1,3 +1,5 @@ +// +build unit + package rate import ( diff --git a/bot/ctx_test.go b/bot/ctx_test.go index 3164588..5e7c467 100644 --- a/bot/ctx_test.go +++ b/bot/ctx_test.go @@ -1,3 +1,5 @@ +// +build unit + package bot import ( diff --git a/bot/nameflag_test.go b/bot/nameflag_test.go index 915a0b9..29b863b 100644 --- a/bot/nameflag_test.go +++ b/bot/nameflag_test.go @@ -1,3 +1,5 @@ +// +build unit + package bot import "testing" diff --git a/bot/subcommand_test.go b/bot/subcommand_test.go index 57ffe4e..7c5f655 100644 --- a/bot/subcommand_test.go +++ b/bot/subcommand_test.go @@ -1,3 +1,5 @@ +// +build unit + package bot import "testing" diff --git a/handler/handler_test.go b/handler/handler_test.go index 79badc8..c4010db 100644 --- a/handler/handler_test.go +++ b/handler/handler_test.go @@ -1,3 +1,5 @@ +// +build unit + package handler import (