Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-03-09 14:28:20 +0300
committerJacob Vosmaer <jacob@gitlab.com>2018-03-09 14:28:20 +0300
commit4f29d1ee7ae1b67ee2b5907ca8ad2911c438d394 (patch)
tree8f6d9b49e18aaa66371302ae2485d0ee1935698e /helpers_test.go
parent796d920a9b7ee631b174acda2bb78348a23808dc (diff)
Use require.NoError to halt tests after errors
Diffstat (limited to 'helpers_test.go')
-rw-r--r--helpers_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/helpers_test.go b/helpers_test.go
index 4d732d81..913cf9c4 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -14,7 +14,7 @@ import (
"time"
log "github.com/sirupsen/logrus"
- "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
type tWriter struct {
@@ -85,17 +85,17 @@ MwE1w2r4Deww
func CreateHTTPSFixtureFiles(t *testing.T) (key string, cert string) {
keyfile, err := ioutil.TempFile("", "https-fixture")
- assert.NoError(t, err)
+ require.NoError(t, err)
key = keyfile.Name()
keyfile.Close()
certfile, err := ioutil.TempFile("", "https-fixture")
- assert.NoError(t, err)
+ require.NoError(t, err)
cert = certfile.Name()
certfile.Close()
- assert.NoError(t, ioutil.WriteFile(key, []byte(KeyFixture), 0644))
- assert.NoError(t, ioutil.WriteFile(cert, []byte(CertificateFixture), 0644))
+ require.NoError(t, ioutil.WriteFile(key, []byte(KeyFixture), 0644))
+ require.NoError(t, ioutil.WriteFile(cert, []byte(CertificateFixture), 0644))
return keyfile.Name(), certfile.Name()
}
@@ -141,7 +141,7 @@ func (l ListenSpec) JoinHostPort() string {
// If run as root via sudo, the gitlab-pages process will drop privileges
func RunPagesProcess(t *testing.T, pagesPath string, listeners []ListenSpec, promPort string, extraArgs ...string) (teardown func()) {
_, err := os.Stat(pagesPath)
- assert.NoError(t, err)
+ require.NoError(t, err)
args, tempfiles := getPagesArgs(t, listeners, promPort, extraArgs)
cmd := exec.Command(pagesPath, args...)