Repository: weaveworks/flagger
Pull request #475 (2020-03-04 12:40:43)

refactor tests: simplify assertion


Patch:
diff --git a/cmd/flagger/main.go b/cmd/flagger/main.go
index 05f1e0aa..f12fa83c 100644
--- a/cmd/flagger/main.go
+++ b/cmd/flagger/main.go
@@ -9,7 +9,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/Masterminds/semver/v3"
+	semver "github.com/Masterminds/semver/v3"
 	"go.uber.org/zap"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/util/uuid"
diff --git a/go.mod b/go.mod
index af241319..514a1f61 100644
--- a/go.mod
+++ b/go.mod
@@ -12,6 +12,7 @@ require (
 	github.com/imdario/mergo v0.3.7 // indirect
 	github.com/pkg/errors v0.9.1
 	github.com/prometheus/client_golang v1.0.0
+	github.com/stretchr/testify v1.5.1
 	go.uber.org/atomic v1.3.2 // indirect
 	go.uber.org/multierr v1.1.0 // indirect
 	go.uber.org/zap v1.10.0
diff --git a/go.sum b/go.sum
index ffef16e1..92348998 100644
--- a/go.sum
+++ b/go.sum
@@ -181,6 +181,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
 go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=


Test patch:
diff --git a/pkg/canary/config_tracker_test.go b/pkg/canary/config_tracker_test.go
index c45a1bd6..c8d017a6 100644
--- a/pkg/canary/config_tracker_test.go
+++ b/pkg/canary/config_tracker_test.go
@@ -3,6 +3,9 @@ package canary
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -13,59 +16,35 @@ func TestConfigTracker_ConfigMaps(t *testing.T) {
 		configMapProjected := newDeploymentControllerTestConfigProjected()
 
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		depPrimary, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		configPrimaryVolName := depPrimary.Spec.Template.Spec.Volumes[0].VolumeSource.ConfigMap.LocalObjectReference.Name
-		if configPrimaryVolName != "podinfo-config-vol-primary" {
-			t.Errorf("Got config name %v wanted %v", configPrimaryVolName, "podinfo-config-vol-primary")
-		}
+		assert.Equal(t, "podinfo-config-vol-primary", configPrimaryVolName)
 
 		configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimary.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimary.Data["color"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimary.Data["color"])
 		}
 
 		configPrimaryEnv, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-all-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryEnv.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap %s wanted %s", configPrimaryEnv.Data["a"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimaryEnv.Data["color"])
 		}
 
 		configPrimaryVol, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryVol.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimary.Data["color"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimaryVol.Data["color"])
 		}
 
 		configProjectedName := depPrimary.Spec.Template.Spec.Volumes[2].VolumeSource.Projected.Sources[0].ConfigMap.Name
-		if configProjectedName != "podinfo-config-projected-primary" {
-			t.Errorf("Got config name %v wanted %v", configProjectedName, "podinfo-config-projected-primary")
-		}
+		assert.Equal(t, "podinfo-config-projected-primary", configProjectedName)
 
 		configPrimaryProjected, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryProjected.Data["color"] != configMapProjected.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimaryProjected.Data["color"], configMapProjected.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMapProjected.Data["color"], configPrimaryProjected.Data["color"])
 		}
 	})
 
@@ -75,59 +54,35 @@ func TestConfigTracker_ConfigMaps(t *testing.T) {
 		configMapProjected := newDaemonSetControllerTestConfigProjected()
 
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		depPrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		configPrimaryVolName := depPrimary.Spec.Template.Spec.Volumes[0].VolumeSource.ConfigMap.LocalObjectReference.Name
-		if configPrimaryVolName != "podinfo-config-vol-primary" {
-			t.Errorf("Got config name %v wanted %v", configPrimaryVolName, "podinfo-config-vol-primary")
-		}
+		assert.Equal(t, "podinfo-config-vol-primary", configPrimaryVolName)
 
 		configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimary.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimary.Data["color"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimary.Data["color"])
 		}
 
 		configPrimaryEnv, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-all-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryEnv.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap %s wanted %s", configPrimaryEnv.Data["a"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimaryEnv.Data["color"])
 		}
 
 		configPrimaryVol, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryVol.Data["color"] != configMap.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimary.Data["color"], configMap.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMap.Data["color"], configPrimaryVol.Data["color"])
 		}
 
 		configProjectedName := depPrimary.Spec.Template.Spec.Volumes[2].VolumeSource.Projected.Sources[0].ConfigMap.Name
-		if configProjectedName != "podinfo-config-projected-primary" {
-			t.Errorf("Got config name %v wanted %v", configProjectedName, "podinfo-config-projected-primary")
-		}
+		assert.Equal(t, "podinfo-config-projected-primary", configProjectedName)
 
 		configPrimaryProjected, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if configPrimaryProjected.Data["color"] != configMapProjected.Data["color"] {
-			t.Errorf("Got ConfigMap color %s wanted %s", configPrimaryProjected.Data["color"], configMapProjected.Data["color"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, configMapProjected.Data["color"], configPrimaryProjected.Data["color"])
 		}
 	})
 }
@@ -139,59 +94,35 @@ func TestConfigTracker_Secrets(t *testing.T) {
 		secretProjected := newDeploymentControllerTestSecretProjected()
 
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		depPrimary, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		secretPrimaryVolName := depPrimary.Spec.Template.Spec.Volumes[1].VolumeSource.Secret.SecretName
-		if secretPrimaryVolName != "podinfo-secret-vol-primary" {
-			t.Errorf("Got config name %v wanted %v", secretPrimaryVolName, "podinfo-secret-vol-primary")
+		if assert.NoError(t, err) {
+			assert.Equal(t, "podinfo-secret-vol-primary",
+				depPrimary.Spec.Template.Spec.Volumes[1].VolumeSource.Secret.SecretName)
 		}
 
 		secretPrimary, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimary.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimary.Data["apiKey"]))
 		}
 
 		secretPrimaryEnv, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-all-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimaryEnv.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimaryEnv.Data["apiKey"]))
 		}
 
 		secretPrimaryVol, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimaryVol.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimaryVol.Data["apiKey"]))
 		}
 
 		secretProjectedName := depPrimary.Spec.Template.Spec.Volumes[2].VolumeSource.Projected.Sources[1].Secret.Name
-		if secretProjectedName != "podinfo-secret-projected-primary" {
-			t.Errorf("Got config name %v wanted %v", secretProjectedName, "podinfo-secret-projected-primary")
-		}
+		assert.Equal(t, "podinfo-secret-projected-primary", secretProjectedName)
 
 		secretPrimaryProjected, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-projected-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimaryProjected.Data["apiKey"]) != string(secretProjected.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimaryProjected.Data["apiKey"], secretProjected.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secretProjected.Data["apiKey"]), string(secretPrimaryProjected.Data["apiKey"]))
 		}
 	})
 
@@ -201,59 +132,35 @@ func TestConfigTracker_Secrets(t *testing.T) {
 		secretProjected := newDaemonSetControllerTestSecretProjected()
 
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
-		depPrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		secretPrimaryVolName := depPrimary.Spec.Template.Spec.Volumes[1].VolumeSource.Secret.SecretName
-		if secretPrimaryVolName != "podinfo-secret-vol-primary" {
-			t.Errorf("Got config name %v wanted %v", secretPrimaryVolName, "podinfo-secret-vol-primary")
+		daePrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+		if assert.NoError(t, err) {
+			assert.Equal(t, "podinfo-secret-vol-primary",
+				daePrimary.Spec.Template.Spec.Volumes[1].VolumeSource.Secret.SecretName)
 		}
 
 		secretPrimary, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimary.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimary.Data["apiKey"]))
 		}
 
 		secretPrimaryEnv, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-all-env-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimaryEnv.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimaryEnv.Data["apiKey"]))
 		}
 
 		secretPrimaryVol, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-vol-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secret.Data["apiKey"]), string(secretPrimaryVol.Data["apiKey"]))
 		}
 
-		if string(secretPrimaryVol.Data["apiKey"]) != string(secret.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret.Data["apiKey"])
-		}
-
-		secretProjectedName := depPrimary.Spec.Template.Spec.Volumes[2].VolumeSource.Projected.Sources[1].Secret.Name
-		if secretProjectedName != "podinfo-secret-projected-primary" {
-			t.Errorf("Got config name %v wanted %v", secretProjectedName, "podinfo-secret-projected-primary")
-		}
+		secretProjectedName := daePrimary.Spec.Template.Spec.Volumes[2].VolumeSource.Projected.Sources[1].Secret.Name
+		assert.Equal(t, "podinfo-secret-projected-primary", secretProjectedName)
 
 		secretPrimaryProjected, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-projected-primary", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
-
-		if string(secretPrimaryProjected.Data["apiKey"]) != string(secretProjected.Data["apiKey"]) {
-			t.Errorf("Got primary secret %s wanted %s", secretPrimaryProjected.Data["apiKey"], secretProjected.Data["apiKey"])
+		if assert.NoError(t, err) {
+			assert.Equal(t, string(secretProjected.Data["apiKey"]), string(secretPrimaryProjected.Data["apiKey"]))
 		}
 	})
 }
diff --git a/pkg/canary/daemonset_controller_test.go b/pkg/canary/daemonset_controller_test.go
index 997441ee..9bd5bc53 100644
--- a/pkg/canary/daemonset_controller_test.go
+++ b/pkg/canary/daemonset_controller_test.go
@@ -3,6 +3,8 @@ package canary
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/errors"
 	"k8s.io/apimachinery/pkg/api/resource"
@@ -14,66 +16,43 @@ import (
 func TestDaemonSetController_Sync(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	depPrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	dep := newDaemonSetControllerTestPodInfo()
+	daePrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+	require.NoError(t, err)
 
-	primaryImage := depPrimary.Spec.Template.Spec.Containers[0].Image
-	sourceImage := dep.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != sourceImage {
-		t.Errorf("Got image %s wanted %s", primaryImage, sourceImage)
-	}
+	dae := newDaemonSetControllerTestPodInfo()
+	primaryImage := daePrimary.Spec.Template.Spec.Containers[0].Image
+	sourceImage := dae.Spec.Template.Spec.Containers[0].Image
+	assert.Equal(t, primaryImage, sourceImage)
 }
 
 func TestDaemonSetController_Promote(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	dep2 := newDaemonSetControllerTestPodInfoV2()
-	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetControllerTestPodInfoV2()
+	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	config2 := newDaemonSetControllerTestConfigMapV2()
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Update(config2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.Promote(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	depPrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	daePrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+	require.NoError(t, err)
 
-	primaryImage := depPrimary.Spec.Template.Spec.Containers[0].Image
-	sourceImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != sourceImage {
-		t.Errorf("Got image %s wanted %s", primaryImage, sourceImage)
-	}
+	primaryImage := daePrimary.Spec.Template.Spec.Containers[0].Image
+	sourceImage := dae2.Spec.Template.Spec.Containers[0].Image
+	assert.Equal(t, primaryImage, sourceImage)
 
 	configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if configPrimary.Data["color"] != config2.Data["color"] {
-		t.Errorf("Got primary ConfigMap color %s wanted %s", configPrimary.Data["color"], config2.Data["color"])
+	if assert.NoError(t, err) {
+		assert.Equal(t, configPrimary.Data["color"], config2.Data["color"])
 	}
 }
 
@@ -82,57 +61,39 @@ func TestDaemonSetController_NoConfigTracking(t *testing.T) {
 	mocks.controller.configTracker = &NopTracker{}
 
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	depPrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	daePrimary, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+	require.NoError(t, err)
 
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if !errors.IsNotFound(err) {
-		t.Fatalf("Primary ConfigMap shouldn't have been created")
-	}
+	require.True(t, errors.IsNotFound(err), "Primary ConfigMap shouldn't have been created")
 
-	configName := depPrimary.Spec.Template.Spec.Volumes[0].VolumeSource.ConfigMap.LocalObjectReference.Name
-	if configName != "podinfo-config-vol" {
-		t.Errorf("Got config name %v wanted %v", configName, "podinfo-config-vol")
-	}
+	configName := daePrimary.Spec.Template.Spec.Volumes[0].VolumeSource.ConfigMap.LocalObjectReference.Name
+	assert.Equal(t, "podinfo-config-vol", configName)
 }
 
 func TestDaemonSetController_HasTargetChanged(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// save last applied hash
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	err = mocks.controller.SyncStatus(canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseInitializing})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// save last promoted hash
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	err = mocks.controller.SetStatusPhase(canary, flaggerv1.CanaryPhaseInitialized)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depClone := dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -143,34 +104,22 @@ func TestDaemonSetController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect change in last applied spec
 	isNew, err := mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !isNew {
-		t.Errorf("Got %v wanted %v", isNew, true)
-	}
+	require.NoError(t, err)
+	assert.True(t, isNew)
 
 	// save hash
 	err = mocks.controller.SyncStatus(canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep, err = mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depClone = dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -181,23 +130,15 @@ func TestDaemonSetController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// ignore change as hash should be the same with last promoted
 	isNew, err = mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if isNew {
-		t.Errorf("Got %v wanted %v", isNew, false)
-	}
+	require.NoError(t, err)
+	assert.False(t, isNew)
 
 	depClone = dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -208,60 +149,48 @@ func TestDaemonSetController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect change
 	isNew, err = mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !isNew {
-		t.Errorf("Got %v wanted %v", isNew, true)
-	}
+	require.NoError(t, err)
+	assert.True(t, isNew)
 }
 
 func TestDaemonSetController_Scale(t *testing.T) {
 	t.Run("Scale", func(t *testing.T) {
 		mocks := newDaemonSetFixture()
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
+
 		err = mocks.controller.Scale(mocks.canary, 0)
+		require.NoError(t, err)
+
 		c, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		for k := range daemonSetScaleDownNodeSelector {
-			if _, ok := c.Spec.Template.Spec.NodeSelector[k]; !ok {
-				t.Errorf("%s should exist in node selector", k)
-			}
+			_, ok := c.Spec.Template.Spec.NodeSelector[k]
+			assert.True(t, ok, "%s should exist in node selector", k)
 		}
 	})
 	t.Run("ScaleFromZeo", func(t *testing.T) {
 		mocks := newDaemonSetFixture()
 		err := mocks.controller.Initialize(mocks.canary, true)
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
+
 		err = mocks.controller.ScaleFromZero(mocks.canary)
+		require.NoError(t, err)
+
 		c, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo", metav1.GetOptions{})
-		if err != nil {
-			t.Fatal(err.Error())
-		}
+		require.NoError(t, err)
 
 		for k := range daemonSetScaleDownNodeSelector {
-			if _, ok := c.Spec.Template.Spec.NodeSelector[k]; ok {
-				t.Errorf("%s should not exist in node selector", k)
-			}
+			_, ok := c.Spec.Template.Spec.NodeSelector[k]
+			assert.False(t, ok, "%s should not exist in node selector", k)
 		}
 	})
 }
diff --git a/pkg/canary/daemonset_ready_test.go b/pkg/canary/daemonset_ready_test.go
index 16b8f824..9754b866 100644
--- a/pkg/canary/daemonset_ready_test.go
+++ b/pkg/canary/daemonset_ready_test.go
@@ -3,6 +3,8 @@ package canary
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	appsv1 "k8s.io/api/apps/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
@@ -12,19 +14,13 @@ import (
 func TestDaemonSetController_IsReady(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Error("Expected primary readiness check to fail")
-	}
+	assert.NoError(t, err, "Expected primary readiness check to fail")
 
 	_, err = mocks.controller.IsPrimaryReady(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	_, err = mocks.controller.IsCanaryReady(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestDaemonSetController_isDaemonSetReady(t *testing.T) {
@@ -42,38 +38,25 @@ func TestDaemonSetController_isDaemonSetReady(t *testing.T) {
 	// ready
 	mocks := newDaemonSetFixture()
 	_, err := mocks.controller.isDaemonSetReady(cd, ds)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// not ready but retriable
 	ds.Status.NumberUnavailable++
 	retrieable, err := mocks.controller.isDaemonSetReady(cd, ds)
-	if err == nil {
-		t.Fatal("expected error")
-	}
-	if !retrieable {
-		t.Fatal("expected retriable")
-	}
+	require.Error(t, err)
+	require.True(t, retrieable)
 	ds.Status.NumberUnavailable--
 
 	ds.Status.DesiredNumberScheduled++
 	retrieable, err = mocks.controller.isDaemonSetReady(cd, ds)
-	if err == nil {
-		t.Fatal("expected error")
-	}
-	if !retrieable {
-		t.Fatal("expected retriable")
-	}
+	require.Error(t, err)
+	require.True(t, retrieable)
 
 	// not ready and not retriable
 	cd.Status.LastTransitionTime = metav1.Now()
 	cd.Spec.ProgressDeadlineSeconds = int32p(-1e5)
 	retrieable, err = mocks.controller.isDaemonSetReady(cd, ds)
-	if err == nil {
-		t.Fatal("expected error")
-	}
-	if retrieable {
-		t.Fatal("expected not retriable")
-	}
+	require.Error(t, err)
+	require.False(t, retrieable)
+
 }
diff --git a/pkg/canary/daemonset_status_test.go b/pkg/canary/daemonset_status_test.go
index 9c4425f3..c8d8e182 100644
--- a/pkg/canary/daemonset_status_test.go
+++ b/pkg/canary/daemonset_status_test.go
@@ -3,6 +3,8 @@ package canary
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
@@ -11,82 +13,49 @@ import (
 func TestDaemonSetController_SyncStatus(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	status := flaggerv1.CanaryStatus{
 		Phase:        flaggerv1.CanaryPhaseProgressing,
 		FailedChecks: 2,
 	}
 	err = mocks.controller.SyncStatus(mocks.canary, status)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.Phase != status.Phase {
-		t.Errorf("Got state %v wanted %v", res.Status.Phase, status.Phase)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, status.Phase, res.Status.Phase)
+	assert.Equal(t, status.FailedChecks, res.Status.FailedChecks)
+	require.NotNil(t, res.Status.TrackedConfigs)
 
-	if res.Status.FailedChecks != status.FailedChecks {
-		t.Errorf("Got failed checks %v wanted %v", res.Status.FailedChecks, status.FailedChecks)
-	}
-
-	if res.Status.TrackedConfigs == nil {
-		t.Fatalf("Status tracking configs are empty")
-	}
 	configs := *res.Status.TrackedConfigs
 	secret := newDaemonSetControllerTestSecret()
-	if _, exists := configs["secret/"+secret.GetName()]; !exists {
-		t.Errorf("Secret %s not found in status", secret.GetName())
-	}
+	_, exists := configs["secret/"+secret.GetName()]
+	assert.True(t, exists, "Secret %s not found in status", secret.GetName())
 }
 
 func TestDaemonSetController_SetFailedChecks(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.SetStatusFailedChecks(mocks.canary, 1)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.FailedChecks != 1 {
-		t.Errorf("Got %v wanted %v", res.Status.FailedChecks, 1)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 1, res.Status.FailedChecks)
 }
 
 func TestDaemonSetController_SetState(t *testing.T) {
 	mocks := newDaemonSetFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.SetStatusPhase(mocks.canary, flaggerv1.CanaryPhaseProgressing)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.Phase != flaggerv1.CanaryPhaseProgressing {
-		t.Errorf("Got %v wanted %v", res.Status.Phase, flaggerv1.CanaryPhaseProgressing)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseProgressing, res.Status.Phase)
 }
diff --git a/pkg/canary/deployment_controller_test.go b/pkg/canary/deployment_controller_test.go
index 7fc2975e..06958e3f 100644
--- a/pkg/canary/deployment_controller_test.go
+++ b/pkg/canary/deployment_controller_test.go
@@ -3,6 +3,8 @@ package canary
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/errors"
 	"k8s.io/apimachinery/pkg/api/resource"
@@ -14,217 +16,135 @@ import (
 func TestDeploymentController_Sync(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depPrimary, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep := newDeploymentControllerTest()
-
 	primaryImage := depPrimary.Spec.Template.Spec.Containers[0].Image
 	sourceImage := dep.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != sourceImage {
-		t.Errorf("Got image %s wanted %s", primaryImage, sourceImage)
-	}
+	assert.Equal(t, sourceImage, primaryImage)
 
 	hpaPrimary, err := mocks.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if hpaPrimary.Spec.ScaleTargetRef.Name != depPrimary.Name {
-		t.Errorf("Got HPA target %s wanted %s", hpaPrimary.Spec.ScaleTargetRef.Name, depPrimary.Name)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, depPrimary.Name, hpaPrimary.Spec.ScaleTargetRef.Name)
 }
 
 func TestDeploymentController_Promote(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep2 := newDeploymentControllerTestV2()
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	config2 := newDeploymentControllerTestConfigMapV2()
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Update(config2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	hpa, err := mocks.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	hpaClone := hpa.DeepCopy()
 	hpaClone.Spec.MaxReplicas = 2
 
 	_, err = mocks.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers("default").Update(hpaClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.Promote(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depPrimary, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryImage := depPrimary.Spec.Template.Spec.Containers[0].Image
 	sourceImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != sourceImage {
-		t.Errorf("Got image %s wanted %s", primaryImage, sourceImage)
-	}
+	assert.Equal(t, sourceImage, primaryImage)
 
 	configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if configPrimary.Data["color"] != config2.Data["color"] {
-		t.Errorf("Got primary ConfigMap color %s wanted %s", configPrimary.Data["color"], config2.Data["color"])
-	}
+	require.NoError(t, err)
+	assert.Equal(t, config2.Data["color"], configPrimary.Data["color"])
 
 	hpaPrimary, err := mocks.kubeClient.AutoscalingV2beta1().HorizontalPodAutoscalers("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if hpaPrimary.Spec.MaxReplicas != 2 {
-		t.Errorf("Got primary HPA MaxReplicas %v wanted %v", hpaPrimary.Spec.MaxReplicas, 2)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, int32(2), hpaPrimary.Spec.MaxReplicas)
 }
 
 func TestDeploymentController_IsReady(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Error("Expected primary readiness check to fail")
-	}
+	require.NoError(t, err, "Expected primary readiness check to fail")
 
 	_, err = mocks.controller.IsPrimaryReady(mocks.canary)
-	if err == nil {
-		t.Fatal(err.Error())
-	}
+	require.Error(t, err)
 
 	_, err = mocks.controller.IsCanaryReady(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestDeploymentController_SetFailedChecks(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.SetStatusFailedChecks(mocks.canary, 1)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.FailedChecks != 1 {
-		t.Errorf("Got %v wanted %v", res.Status.FailedChecks, 1)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 1, res.Status.FailedChecks)
 }
 
 func TestDeploymentController_SetState(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.SetStatusPhase(mocks.canary, flaggerv1.CanaryPhaseProgressing)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.Phase != flaggerv1.CanaryPhaseProgressing {
-		t.Errorf("Got %v wanted %v", res.Status.Phase, flaggerv1.CanaryPhaseProgressing)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseProgressing, res.Status.Phase)
 }
 
 func TestDeploymentController_SyncStatus(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	status := flaggerv1.CanaryStatus{
 		Phase:        flaggerv1.CanaryPhaseProgressing,
 		FailedChecks: 2,
 	}
 	err = mocks.controller.SyncStatus(mocks.canary, status)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	res, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if res.Status.Phase != status.Phase {
-		t.Errorf("Got state %v wanted %v", res.Status.Phase, status.Phase)
-	}
-
-	if res.Status.FailedChecks != status.FailedChecks {
-		t.Errorf("Got failed checks %v wanted %v", res.Status.FailedChecks, status.FailedChecks)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, status.Phase, res.Status.Phase)
+	assert.Equal(t, status.FailedChecks, res.Status.FailedChecks)
 
-	if res.Status.TrackedConfigs == nil {
-		t.Fatalf("Status tracking configs are empty")
-	}
+	require.NotNil(t, res.Status.TrackedConfigs)
 	configs := *res.Status.TrackedConfigs
 	secret := newDeploymentControllerTestSecret()
-	if _, exists := configs["secret/"+secret.GetName()]; !exists {
-		t.Errorf("Secret %s not found in status", secret.GetName())
-	}
+	_, exists := configs["secret/"+secret.GetName()]
+	assert.True(t, exists, "Secret %s not found in status", secret.GetName())
 }
 
 func TestDeploymentController_Scale(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = mocks.controller.Scale(mocks.canary, 2)
+	require.NoError(t, err)
 
 	c, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if *c.Spec.Replicas != 2 {
-		t.Errorf("Got replicas %v wanted %v", *c.Spec.Replicas, 2)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, int32(2), *c.Spec.Replicas)
 }
 
 func TestDeploymentController_NoConfigTracking(t *testing.T) {
@@ -232,57 +152,39 @@ func TestDeploymentController_NoConfigTracking(t *testing.T) {
 	mocks.controller.configTracker = &NopTracker{}
 
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depPrimary, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if !errors.IsNotFound(err) {
-		t.Fatalf("Primary ConfigMap shouldn't have been created")
-	}
+	require.True(t, errors.IsNotFound(err), "Primary ConfigMap shouldn't have been created")
 
 	configName := depPrimary.Spec.Template.Spec.Volumes[0].VolumeSource.ConfigMap.LocalObjectReference.Name
-	if configName != "podinfo-config-vol" {
-		t.Errorf("Got config name %v wanted %v", configName, "podinfo-config-vol")
-	}
+	assert.Equal(t, "podinfo-config-vol", configName)
 }
 
 func TestDeploymentController_HasTargetChanged(t *testing.T) {
 	mocks := newDeploymentFixture()
 	err := mocks.controller.Initialize(mocks.canary, true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// save last applied hash
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	err = mocks.controller.SyncStatus(canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseInitializing})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// save last promoted hash
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	err = mocks.controller.SetStatusPhase(canary, flaggerv1.CanaryPhaseInitialized)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depClone := dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -293,34 +195,22 @@ func TestDeploymentController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect change in last applied spec
 	isNew, err := mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !isNew {
-		t.Errorf("Got %v wanted %v", isNew, true)
-	}
+	require.NoError(t, err)
+	assert.True(t, isNew)
 
 	// save hash
 	err = mocks.controller.SyncStatus(canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	dep, err = mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	depClone = dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -331,23 +221,15 @@ func TestDeploymentController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// ignore change as hash should be the same with last promoted
 	isNew, err = mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if isNew {
-		t.Errorf("Got %v wanted %v", isNew, false)
-	}
+	require.NoError(t, err)
+	assert.False(t, isNew)
 
 	depClone = dep.DeepCopy()
 	depClone.Spec.Template.Spec.Containers[0].Resources = corev1.ResourceRequirements{
@@ -358,21 +240,13 @@ func TestDeploymentController_HasTargetChanged(t *testing.T) {
 
 	// update pod spec
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(depClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect change
 	isNew, err = mocks.controller.HasTargetChanged(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !isNew {
-		t.Errorf("Got %v wanted %v", isNew, true)
-	}
+	require.NoError(t, err)
+	assert.True(t, isNew)
 }
diff --git a/pkg/controller/scheduler_common_test.go b/pkg/controller/scheduler_common_test.go
index 01f06865..9bda8fb1 100644
--- a/pkg/controller/scheduler_common_test.go
+++ b/pkg/controller/scheduler_common_test.go
@@ -3,9 +3,10 @@ package controller
 import (
 	"fmt"
 
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	clientset "github.com/weaveworks/flagger/pkg/client/clientset/versioned"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
 func assertPhase(flaggerClient clientset.Interface, canary string, phase flaggerv1.CanaryPhase) error {
@@ -15,7 +16,7 @@ func assertPhase(flaggerClient clientset.Interface, canary string, phase flagger
 	}
 
 	if c.Status.Phase != phase {
-		return fmt.Errorf("Got canary state %v wanted %v", c.Status.Phase, phase)
+		return fmt.Errorf("Got canary state %s wanted %s", c.Status.Phase, phase)
 	}
 
 	return nil
diff --git a/pkg/controller/scheduler_daemonset_test.go b/pkg/controller/scheduler_daemonset_test.go
index 89dfef51..4ed0ea33 100644
--- a/pkg/controller/scheduler_daemonset_test.go
+++ b/pkg/controller/scheduler_daemonset_test.go
@@ -8,6 +8,8 @@ import (
 	"net/http/httptest"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/util/intstr"
 
@@ -20,9 +22,7 @@ func TestScheduler_DaemonSetInit(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestScheduler_DaemonSetNewRevision(t *testing.T) {
@@ -30,19 +30,15 @@ func TestScheduler_DaemonSetNewRevision(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestScheduler_DaemonSetRollback(t *testing.T) {
@@ -52,15 +48,12 @@ func TestScheduler_DaemonSetRollback(t *testing.T) {
 
 	// update failed checks to max
 	err := mocks.deployer.SyncStatus(mocks.canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing, FailedChecks: 10})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// set a metric check to fail
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	cd := c.DeepCopy()
 	cd.Spec.CanaryAnalysis.Metrics = append(c.Spec.CanaryAnalysis.Metrics, flaggerv1.CanaryMetric{
 		Name:     "fail",
@@ -72,9 +65,7 @@ func TestScheduler_DaemonSetRollback(t *testing.T) {
 		Query: "fail",
 	})
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// run metric checks
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -84,13 +75,8 @@ func TestScheduler_DaemonSetRollback(t *testing.T) {
 
 	// check status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFailed {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFailed)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFailed, c.Status.Phase)
 }
 
 func TestScheduler_DaemonSetSkipAnalysis(t *testing.T) {
@@ -100,21 +86,16 @@ func TestScheduler_DaemonSetSkipAnalysis(t *testing.T) {
 
 	// enable skip
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
+
 	cd.Spec.SkipAnalysis = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -122,16 +103,9 @@ func TestScheduler_DaemonSetSkipAnalysis(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !c.Spec.SkipAnalysis {
-		t.Errorf("Got skip analysis %v wanted %v", c.Spec.SkipAnalysis, true)
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.True(t, c.Spec.SkipAnalysis)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DaemonSetNewRevisionReset(t *testing.T) {
@@ -140,11 +114,9 @@ func TestScheduler_DaemonSetNewRevisionReset(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// first update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -152,48 +124,24 @@ func TestScheduler_DaemonSetNewRevisionReset(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 90 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 90)
-	}
-
-	if canaryWeight != 10 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 10)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 90, primaryWeight)
+	assert.Equal(t, 10, canaryWeight)
+	assert.False(t, mirrored)
 
 	// second update
-	dep2.Spec.Template.Spec.ServiceAccountName = "test"
-	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2.Spec.Template.Spec.ServiceAccountName = "test"
+	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.False(t, mirrored)
 }
 
 func TestScheduler_DaemonSetPromotion(t *testing.T) {
@@ -204,147 +152,87 @@ func TestScheduler_DaemonSetPromotion(t *testing.T) {
 
 	// check initialized status
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseInitialized {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseInitialized)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseInitialized, c.Status.Phase)
 
 	// update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err = mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	config2 := newDaemonSetTestConfigMapV2()
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Update(config2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	secret2 := newDaemonSetTestSecretV2()
 	_, err = mocks.kubeClient.CoreV1().Secrets("default").Update(secret2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect configs changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryWeight = 60
 	canaryWeight = 40
 	err = mocks.router.SetRoutes(mocks.canary, primaryWeight, canaryWeight, mirrored)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check progressing status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseProgressing {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseProgressing)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseProgressing, c.Status.Phase)
 
 	// promote
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check promoting status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhasePromoting {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhasePromoting)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhasePromoting, c.Status.Phase)
 
 	// finalise
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.False(t, mirrored)
 
-	primaryDep, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	primaryDae, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+	require.NoError(t, err)
 
-	primaryImage := primaryDep.Spec.Template.Spec.Containers[0].Image
-	canaryImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != canaryImage {
-		t.Errorf("Got primary image %v wanted %v", primaryImage, canaryImage)
-	}
+	primaryImage := primaryDae.Spec.Template.Spec.Containers[0].Image
+	canaryImage := dae2.Spec.Template.Spec.Containers[0].Image
+	assert.Equal(t, canaryImage, primaryImage)
 
 	configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if configPrimary.Data["color"] != config2.Data["color"] {
-		t.Errorf("Got primary ConfigMap color %s wanted %s", configPrimary.Data["color"], config2.Data["color"])
-	}
+	require.NoError(t, err)
+	assert.Equal(t, config2.Data["color"], configPrimary.Data["color"])
 
 	secretPrimary, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if string(secretPrimary.Data["apiKey"]) != string(secret2.Data["apiKey"]) {
-		t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret2.Data["apiKey"])
-	}
+	require.NoError(t, err)
+	assert.Equal(t, string(secret2.Data["apiKey"]), string(secretPrimary.Data["apiKey"]))
 
 	// check finalising status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFinalising {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFinalising)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFinalising, c.Status.Phase)
 
 	// scale canary to zero
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DaemonSetMirroring(t *testing.T) {
@@ -353,11 +241,9 @@ func TestScheduler_DaemonSetMirroring(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -367,42 +253,20 @@ func TestScheduler_DaemonSetMirroring(t *testing.T) {
 
 	// check if traffic is mirrored to canary
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != true {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, true)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.True(t, mirrored)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check if traffic is mirrored to canary
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 90 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 90)
-	}
-
-	if canaryWeight != 10 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 10)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 90, primaryWeight)
+	assert.Equal(t, 10, canaryWeight)
+	assert.False(t, mirrored)
 }
 
 func TestScheduler_DaemonSetABTesting(t *testing.T) {
@@ -411,11 +275,9 @@ func TestScheduler_DaemonSetABTesting(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// update
-	dep2 := newDaemonSetTestDaemonSetV2()
-	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	dae2 := newDaemonSetTestDaemonSetV2()
+	_, err := mocks.kubeClient.AppsV1().DaemonSets("default").Update(dae2)
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -425,31 +287,17 @@ func TestScheduler_DaemonSetABTesting(t *testing.T) {
 
 	// check if traffic is routed to canary
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 0 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 0)
-	}
-
-	if canaryWeight != 100 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 100)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 0, primaryWeight)
+	assert.Equal(t, 100, canaryWeight)
+	assert.False(t, mirrored)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// set max iterations
-	if err := mocks.deployer.SetStatusIterations(cd, 10); err != nil {
-		t.Fatal(err.Error())
-	}
+	err = mocks.deployer.SetStatusIterations(cd, 10)
+	require.NoError(t, err)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -459,38 +307,24 @@ func TestScheduler_DaemonSetABTesting(t *testing.T) {
 
 	// check finalising status
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFinalising {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFinalising)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFinalising, c.Status.Phase)
 
 	// check if the container image tag was updated
-	primaryDep, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	primaryDae, err := mocks.kubeClient.AppsV1().DaemonSets("default").Get("podinfo-primary", metav1.GetOptions{})
+	require.NoError(t, err)
 
-	primaryImage := primaryDep.Spec.Template.Spec.Containers[0].Image
-	canaryImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != canaryImage {
-		t.Errorf("Got primary image %v wanted %v", primaryImage, canaryImage)
-	}
+	primaryImage := primaryDae.Spec.Template.Spec.Containers[0].Image
+	canaryImage := dae2.Spec.Template.Spec.Containers[0].Image
+	assert.Equal(t, canaryImage, primaryImage)
 
 	// shutdown canary
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check rollout status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DaemonSetPortDiscovery(t *testing.T) {
@@ -498,25 +332,16 @@ func TestScheduler_DaemonSetPortDiscovery(t *testing.T) {
 
 	// enable port discovery
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -530,10 +355,7 @@ func TestScheduler_DaemonSetPortDiscovery(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
@@ -541,27 +363,18 @@ func TestScheduler_DaemonSetTargetPortNumber(t *testing.T) {
 	mocks := newDaemonSetFixture(nil)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.Port = 80
 	cd.Spec.Service.TargetPort = intstr.FromInt(9898)
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -575,10 +388,7 @@ func TestScheduler_DaemonSetTargetPortNumber(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
@@ -586,27 +396,18 @@ func TestScheduler_DaemonSetTargetPortName(t *testing.T) {
 	mocks := newDaemonSetFixture(nil)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.Port = 8080
 	cd.Spec.Service.TargetPort = intstr.FromString("http")
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -620,27 +421,18 @@ func TestScheduler_DaemonSetTargetPortName(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
 func TestScheduler_DaemonSetAlerts(t *testing.T) {
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
 		var payload = notifier.SlackPayload{}
 		err = json.Unmarshal(b, &payload)
-		if err != nil {
-			t.Fatal(err)
-		}
-		if payload.Attachments[0].AuthorName != "podinfo.default" {
-			t.Fatal("wrong author name")
-		}
+		require.NoError(t, err)
+		require.Equal(t, "podinfo.default", payload.Attachments[0].AuthorName)
 	}))
 	defer ts.Close()
 
@@ -669,9 +461,7 @@ func TestScheduler_DaemonSetAlerts(t *testing.T) {
 		"address": []byte(ts.URL),
 	}
 	_, err := mocks.kubeClient.CoreV1().Secrets("default").Update(secret)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// init canary and send alerts
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
diff --git a/pkg/controller/scheduler_deployment_test.go b/pkg/controller/scheduler_deployment_test.go
index b1171942..d518956e 100644
--- a/pkg/controller/scheduler_deployment_test.go
+++ b/pkg/controller/scheduler_deployment_test.go
@@ -8,6 +8,8 @@ import (
 	"net/http/httptest"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/util/intstr"
 
@@ -20,9 +22,7 @@ func TestScheduler_DeploymentInit(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestScheduler_DeploymentNewRevision(t *testing.T) {
@@ -32,21 +32,14 @@ func TestScheduler_DeploymentNewRevision(t *testing.T) {
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if *c.Spec.Replicas != 1 {
-		t.Errorf("Got canary replicas %v wanted %v", *c.Spec.Replicas, 1)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, int32(1), *c.Spec.Replicas)
 }
 
 func TestScheduler_DeploymentRollback(t *testing.T) {
@@ -56,15 +49,11 @@ func TestScheduler_DeploymentRollback(t *testing.T) {
 
 	// update failed checks to max
 	err := mocks.deployer.SyncStatus(mocks.canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing, FailedChecks: 10})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// set a metric check to fail
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd := c.DeepCopy()
 	cd.Spec.CanaryAnalysis.Metrics = append(c.Spec.CanaryAnalysis.Metrics, flaggerv1.CanaryMetric{
 		Name:     "fail",
@@ -76,31 +65,21 @@ func TestScheduler_DeploymentRollback(t *testing.T) {
 		Query: "fail",
 	})
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// run metric checks
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// finalise analysis
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if c.Status.Phase != flaggerv1.CanaryPhaseFailed {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFailed)
-	}
+	assert.Equal(t, flaggerv1.CanaryPhaseFailed, c.Status.Phase)
 }
 
 func TestScheduler_DeploymentSkipAnalysis(t *testing.T) {
@@ -110,21 +89,15 @@ func TestScheduler_DeploymentSkipAnalysis(t *testing.T) {
 
 	// enable skip
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.SkipAnalysis = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -132,16 +105,9 @@ func TestScheduler_DeploymentSkipAnalysis(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if !c.Spec.SkipAnalysis {
-		t.Errorf("Got skip analysis %v wanted %v", c.Spec.SkipAnalysis, true)
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.True(t, c.Spec.SkipAnalysis)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DeploymentAnalysisPhases(t *testing.T) {
@@ -154,46 +120,32 @@ func TestScheduler_DeploymentAnalysisPhases(t *testing.T) {
 
 	// init
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseInitialized); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseInitialized))
 
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing))
 
 	// progressing
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing))
 
 	// promoting
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhasePromoting); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhasePromoting))
 
 	// finalising
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseFinalising); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseFinalising))
 
 	// succeeded
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseSucceeded); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseSucceeded))
 }
 
 func TestScheduler_DeploymentBlueGreenAnalysisPhases(t *testing.T) {
@@ -206,52 +158,36 @@ func TestScheduler_DeploymentBlueGreenAnalysisPhases(t *testing.T) {
 
 	// init
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseInitialized); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseInitialized))
 
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes (progressing)
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing))
 
 	// advance (progressing)
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing))
 
 	// route traffic to primary (progressing)
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseProgressing))
 
 	// promoting
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhasePromoting); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhasePromoting))
 
 	// finalising
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseFinalising); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseFinalising))
 
 	// succeeded
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
-	if err := assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseSucceeded); err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, assertPhase(mocks.flaggerClient, "podinfo", flaggerv1.CanaryPhaseSucceeded))
 }
 
 func TestScheduler_DeploymentNewRevisionReset(t *testing.T) {
@@ -262,9 +198,7 @@ func TestScheduler_DeploymentNewRevisionReset(t *testing.T) {
 	// first update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -272,48 +206,24 @@ func TestScheduler_DeploymentNewRevisionReset(t *testing.T) {
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 90 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 90)
-	}
-
-	if canaryWeight != 10 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 10)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 90, primaryWeight)
+	assert.Equal(t, 10, canaryWeight)
+	assert.False(t, mirrored)
 
 	// second update
 	dep2.Spec.Template.Spec.ServiceAccountName = "test"
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.False(t, mirrored)
 }
 
 func TestScheduler_DeploymentPromotion(t *testing.T) {
@@ -324,147 +234,87 @@ func TestScheduler_DeploymentPromotion(t *testing.T) {
 
 	// check initialized status
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseInitialized {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseInitialized)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseInitialized, c.Status.Phase)
 
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err = mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	config2 := newDeploymentTestConfigMapV2()
 	_, err = mocks.kubeClient.CoreV1().ConfigMaps("default").Update(config2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	secret2 := newDeploymentTestSecretV2()
 	_, err = mocks.kubeClient.CoreV1().Secrets("default").Update(secret2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect configs changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryWeight = 60
 	canaryWeight = 40
 	err = mocks.router.SetRoutes(mocks.canary, primaryWeight, canaryWeight, mirrored)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check progressing status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseProgressing {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseProgressing)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseProgressing, c.Status.Phase)
 
 	// promote
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check promoting status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhasePromoting {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhasePromoting)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhasePromoting, c.Status.Phase)
 
 	// finalise
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.False(t, mirrored)
 
 	primaryDep, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryImage := primaryDep.Spec.Template.Spec.Containers[0].Image
 	canaryImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != canaryImage {
-		t.Errorf("Got primary image %v wanted %v", primaryImage, canaryImage)
-	}
+	assert.Equal(t, canaryImage, primaryImage)
 
 	configPrimary, err := mocks.kubeClient.CoreV1().ConfigMaps("default").Get("podinfo-config-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if configPrimary.Data["color"] != config2.Data["color"] {
-		t.Errorf("Got primary ConfigMap color %s wanted %s", configPrimary.Data["color"], config2.Data["color"])
-	}
+	require.NoError(t, err)
+	assert.Equal(t, config2.Data["color"], configPrimary.Data["color"])
 
 	secretPrimary, err := mocks.kubeClient.CoreV1().Secrets("default").Get("podinfo-secret-env-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if string(secretPrimary.Data["apiKey"]) != string(secret2.Data["apiKey"]) {
-		t.Errorf("Got primary secret %s wanted %s", secretPrimary.Data["apiKey"], secret2.Data["apiKey"])
-	}
+	require.NoError(t, err)
+	assert.Equal(t, string(secret2.Data["apiKey"]), string(secretPrimary.Data["apiKey"]))
 
 	// check finalising status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFinalising {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFinalising)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFinalising, c.Status.Phase)
 
 	// scale canary to zero
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DeploymentMirroring(t *testing.T) {
@@ -475,9 +325,7 @@ func TestScheduler_DeploymentMirroring(t *testing.T) {
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -487,42 +335,20 @@ func TestScheduler_DeploymentMirroring(t *testing.T) {
 
 	// check if traffic is mirrored to canary
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != true {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, true)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.True(t, mirrored)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check if traffic is mirrored to canary
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 90 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 90)
-	}
-
-	if canaryWeight != 10 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 10)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 90, primaryWeight)
+	assert.Equal(t, 10, canaryWeight)
+	assert.False(t, mirrored)
 }
 
 func TestScheduler_DeploymentABTesting(t *testing.T) {
@@ -533,9 +359,7 @@ func TestScheduler_DeploymentABTesting(t *testing.T) {
 	// update
 	dep2 := newDeploymentTestDeploymentV2()
 	_, err := mocks.kubeClient.AppsV1().Deployments("default").Update(dep2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect pod spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -545,31 +369,17 @@ func TestScheduler_DeploymentABTesting(t *testing.T) {
 
 	// check if traffic is routed to canary
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 0 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 0)
-	}
-
-	if canaryWeight != 100 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 100)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 0, primaryWeight)
+	assert.Equal(t, 100, canaryWeight)
+	assert.False(t, mirrored)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// set max iterations
-	if err := mocks.deployer.SetStatusIterations(cd, 10); err != nil {
-		t.Fatal(err.Error())
-	}
+	err = mocks.deployer.SetStatusIterations(cd, 10)
+	require.NoError(t, err)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
@@ -579,38 +389,24 @@ func TestScheduler_DeploymentABTesting(t *testing.T) {
 
 	// check finalising status
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFinalising {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFinalising)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFinalising, c.Status.Phase)
 
 	// check if the container image tag was updated
 	primaryDep, err := mocks.kubeClient.AppsV1().Deployments("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryImage := primaryDep.Spec.Template.Spec.Containers[0].Image
 	canaryImage := dep2.Spec.Template.Spec.Containers[0].Image
-	if primaryImage != canaryImage {
-		t.Errorf("Got primary image %v wanted %v", primaryImage, canaryImage)
-	}
+	assert.Equal(t, canaryImage, primaryImage)
 
 	// shutdown canary
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check rollout status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func TestScheduler_DeploymentPortDiscovery(t *testing.T) {
@@ -618,25 +414,16 @@ func TestScheduler_DeploymentPortDiscovery(t *testing.T) {
 
 	// enable port discovery
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -650,10 +437,7 @@ func TestScheduler_DeploymentPortDiscovery(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
@@ -661,27 +445,18 @@ func TestScheduler_DeploymentTargetPortNumber(t *testing.T) {
 	mocks := newDeploymentFixture(nil)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.Port = 80
 	cd.Spec.Service.TargetPort = intstr.FromInt(9898)
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -695,10 +470,7 @@ func TestScheduler_DeploymentTargetPortNumber(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
@@ -706,27 +478,18 @@ func TestScheduler_DeploymentTargetPortName(t *testing.T) {
 	mocks := newDeploymentFixture(nil)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	cd.Spec.Service.Port = 8080
 	cd.Spec.Service.TargetPort = intstr.FromString("http")
 	cd.Spec.Service.PortDiscovery = true
 	_, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(canarySvc.Spec.Ports) != 3 {
-		t.Fatalf("Got svc port count %v wanted %v", len(canarySvc.Spec.Ports), 3)
-	}
+	require.NoError(t, err)
+	require.Len(t, canarySvc.Spec.Ports, 3)
 
 	matchPorts := func(lookup string) bool {
 		switch lookup {
@@ -740,27 +503,18 @@ func TestScheduler_DeploymentTargetPortName(t *testing.T) {
 	}
 
 	for _, port := range canarySvc.Spec.Ports {
-		if !matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)) {
-			t.Fatalf("Got wrong svc port %v", port.Name)
-		}
-
+		require.True(t, matchPorts(fmt.Sprintf("%s %v", port.Name, port.Port)))
 	}
 }
 
 func TestScheduler_DeploymentAlerts(t *testing.T) {
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
 		var payload = notifier.SlackPayload{}
 		err = json.Unmarshal(b, &payload)
-		if err != nil {
-			t.Fatal(err)
-		}
-		if payload.Attachments[0].AuthorName != "podinfo.default" {
-			t.Fatal("wrong author name")
-		}
+		require.NoError(t, err)
+		require.Equal(t, "podinfo.default", payload.Attachments[0].AuthorName)
 	}))
 	defer ts.Close()
 
@@ -789,9 +543,7 @@ func TestScheduler_DeploymentAlerts(t *testing.T) {
 		"address": []byte(ts.URL),
 	}
 	_, err := mocks.kubeClient.CoreV1().Secrets("default").Update(secret)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// init canary and send alerts
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
diff --git a/pkg/controller/scheduler_svc_test.go b/pkg/controller/scheduler_svc_test.go
index 0db42439..e552906b 100644
--- a/pkg/controller/scheduler_svc_test.go
+++ b/pkg/controller/scheduler_svc_test.go
@@ -3,6 +3,8 @@ package controller
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
@@ -16,114 +18,68 @@ func TestScheduler_ServicePromotion(t *testing.T) {
 
 	// check initialized status
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseInitialized {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseInitialized)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseInitialized, c.Status.Phase)
 
 	// update
 	svc2 := newDeploymentTestServiceV2()
 	_, err = mocks.kubeClient.CoreV1().Services("default").Update(svc2)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// detect service spec changes
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err := mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryWeight = 60
 	canaryWeight = 40
 	err = mocks.router.SetRoutes(mocks.canary, primaryWeight, canaryWeight, mirrored)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// advance
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check progressing status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseProgressing {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseProgressing)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseProgressing, c.Status.Phase)
 
 	// promote
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	// check promoting status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhasePromoting {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhasePromoting)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhasePromoting, c.Status.Phase)
 
 	// finalise
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	primaryWeight, canaryWeight, mirrored, err = mocks.router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primaryWeight != 100 {
-		t.Errorf("Got primary route %v wanted %v", primaryWeight, 100)
-	}
-
-	if canaryWeight != 0 {
-		t.Errorf("Got canary route %v wanted %v", canaryWeight, 0)
-	}
-
-	if mirrored != false {
-		t.Errorf("Got mirrored %v wanted %v", mirrored, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, primaryWeight)
+	assert.Equal(t, 0, canaryWeight)
+	assert.False(t, mirrored)
 
 	primarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryLabelValue := primarySvc.Spec.Selector["app"]
 	canaryLabelValue := svc2.Spec.Selector["app"]
-	if primaryLabelValue != canaryLabelValue {
-		t.Errorf("Got primary selector label value %v wanted %v", primaryLabelValue, canaryLabelValue)
-	}
+	assert.Equal(t, canaryLabelValue, primaryLabelValue)
 
 	// check finalising status
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseFinalising {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseFinalising)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseFinalising, c.Status.Phase)
 
 	// scale canary to zero
 	mocks.ctrl.advanceCanary("podinfo", "default", true)
 
 	c, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if c.Status.Phase != flaggerv1.CanaryPhaseSucceeded {
-		t.Errorf("Got canary state %v wanted %v", c.Status.Phase, flaggerv1.CanaryPhaseSucceeded)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, flaggerv1.CanaryPhaseSucceeded, c.Status.Phase)
 }
 
 func newTestServiceCanary() *flaggerv1.Canary {
diff --git a/pkg/controller/webhook_test.go b/pkg/controller/webhook_test.go
index 96750148..f0caba18 100644
--- a/pkg/controller/webhook_test.go
+++ b/pkg/controller/webhook_test.go
@@ -7,6 +7,8 @@ import (
 	"net/http/httptest"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	corev1 "k8s.io/api/core/v1"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
@@ -26,9 +28,7 @@ func TestCallWebhook(t *testing.T) {
 	}
 
 	err := CallWebhook("podinfo", v1.NamespaceDefault, flaggerv1.CanaryPhaseProgressing, hook)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestCallWebhook_StatusCode(t *testing.T) {
@@ -42,9 +42,7 @@ func TestCallWebhook_StatusCode(t *testing.T) {
 	}
 
 	err := CallWebhook("podinfo", v1.NamespaceDefault, flaggerv1.CanaryPhaseProgressing, hook)
-	if err == nil {
-		t.Errorf("Got no error wanted %v", http.StatusInternalServerError)
-	}
+	assert.Error(t, err)
 }
 
 func TestCallEventWebhook(t *testing.T) {
@@ -99,9 +97,7 @@ func TestCallEventWebhook(t *testing.T) {
 	}
 
 	err := CallEventWebhook(canary, ts.URL, canaryMessage, canaryEventType)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 }
 
 func TestCallEventWebhookStatusCode(t *testing.T) {
@@ -126,7 +122,5 @@ func TestCallEventWebhookStatusCode(t *testing.T) {
 	}
 
 	err := CallEventWebhook(canary, ts.URL, canaryMessage, canaryEventType)
-	if err == nil {
-		t.Errorf("Got no error wanted %v", http.StatusInternalServerError)
-	}
+	assert.Error(t, err)
 }
diff --git a/pkg/loadtester/runner_test.go b/pkg/loadtester/runner_test.go
index 1ab72487..3a64371e 100644
--- a/pkg/loadtester/runner_test.go
+++ b/pkg/loadtester/runner_test.go
@@ -4,6 +4,8 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+
 	"github.com/weaveworks/flagger/pkg/logger"
 )
 
@@ -31,9 +33,7 @@ func TestTaskRunner_Start(t *testing.T) {
 	tr.Add(task1)
 	tr.Add(task2)
 
-	if tr.GetTotalExecs() != 2 {
-		t.Errorf("Got total executed commands %v wanted %v", tr.GetTotalExecs(), 2)
-	}
+	assert.Equal(t, uint64(2), tr.GetTotalExecs())
 
 	time.Sleep(time.Second)
 
@@ -41,8 +41,5 @@ func TestTaskRunner_Start(t *testing.T) {
 	tr.Add(task2)
 
 	time.Sleep(time.Second)
-
-	if tr.GetTotalExecs() != 4 {
-		t.Errorf("Got total executed commands %v wanted %v", tr.GetTotalExecs(), 4)
-	}
+	assert.Equal(t, uint64(4), tr.GetTotalExecs())
 }
diff --git a/pkg/loadtester/task_ngrinder_test.go b/pkg/loadtester/task_ngrinder_test.go
index b7917763..60af180e 100644
--- a/pkg/loadtester/task_ngrinder_test.go
+++ b/pkg/loadtester/task_ngrinder_test.go
@@ -6,8 +6,11 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+	gock "gopkg.in/h2non/gock.v1"
+
 	"github.com/weaveworks/flagger/pkg/logger"
-	"gopkg.in/h2non/gock.v1"
 )
 
 func TestTaskNGrinder(t *testing.T) {
@@ -16,9 +19,7 @@ func TestTaskNGrinder(t *testing.T) {
 	logger, _ := logger.NewLoggerWithEncoding("debug", "console")
 	canary := "podinfo.default"
 	taskFactory, ok := GetTaskFactory(TaskTypeNGrinder)
-	if !ok {
-		t.Errorf("Failed to get ngrinder task factory")
-	}
+	assert.True(t, ok, "Failed to get ngrinder task factory")
 
 	defer gock.Off()
 	gock.New(server).Post(fmt.Sprintf("perftest/api/%s/clone_and_start", cloneId)).
@@ -36,10 +37,7 @@ func TestTaskNGrinder(t *testing.T) {
 			"passwd":       "YWRtaW4=",
 			"pollInterval": "1s",
 		}, canary, logger)
-		if err != nil {
-			t.Fatalf("Failed to create ngrinder task: %s", err.Error())
-			return
-		}
+		require.NoError(t, err, "Failed to create ngrinder task")
 		ctx, _ := context.WithTimeout(context.Background(), time.Second*3)
 		task.Run(ctx)
 		<-ctx.Done()
diff --git a/pkg/metrics/observers/appmesh_test.go b/pkg/metrics/observers/appmesh_test.go
index 22154201..0329a0a0 100644
--- a/pkg/metrics/observers/appmesh_test.go
+++ b/pkg/metrics/observers/appmesh_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestAppMeshObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestAppMeshObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &AppMeshObserver{
 		client: client,
@@ -44,13 +43,8 @@ func TestAppMeshObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, float64(100), val)
 }
 
 func TestAppMeshObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +52,7 @@ func TestAppMeshObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +64,7 @@ func TestAppMeshObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &AppMeshObserver{
 		client: client,
@@ -87,11 +77,7 @@ func TestAppMeshObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/contour_test.go b/pkg/metrics/observers/contour_test.go
index 4afdb69f..0b79bf3a 100644
--- a/pkg/metrics/observers/contour_test.go
+++ b/pkg/metrics/observers/contour_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestContourObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestContourObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &ContourObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestContourObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestContourObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestContourObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestContourObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &ContourObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestContourObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/crossover_service_test.go b/pkg/metrics/observers/crossover_service_test.go
index efae05aa..b0c9fc4e 100644
--- a/pkg/metrics/observers/crossover_service_test.go
+++ b/pkg/metrics/observers/crossover_service_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestCrossoverServiceObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestCrossoverServiceObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &CrossoverServiceObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestCrossoverServiceObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestCrossoverServiceObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestCrossoverServiceObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestCrossoverServiceObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &CrossoverServiceObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestCrossoverServiceObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/crossover_test.go b/pkg/metrics/observers/crossover_test.go
index 218fbecd..7cf6ed65 100644
--- a/pkg/metrics/observers/crossover_test.go
+++ b/pkg/metrics/observers/crossover_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestCrossoverObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestCrossoverObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &CrossoverObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestCrossoverObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestCrossoverObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestCrossoverObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestCrossoverObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &CrossoverObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestCrossoverObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/gloo_test.go b/pkg/metrics/observers/gloo_test.go
index 27045b7b..75e64949 100644
--- a/pkg/metrics/observers/gloo_test.go
+++ b/pkg/metrics/observers/gloo_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestGlooObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestGlooObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &GlooObserver{
 		client: client,
@@ -44,13 +43,8 @@ func TestGlooObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, float64(100), val)
 }
 
 func TestGlooObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +52,7 @@ func TestGlooObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +64,7 @@ func TestGlooObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &GlooObserver{
 		client: client,
@@ -87,11 +77,6 @@ func TestGlooObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/http_test.go b/pkg/metrics/observers/http_test.go
index 53612b51..87ebd058 100644
--- a/pkg/metrics/observers/http_test.go
+++ b/pkg/metrics/observers/http_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestHttpObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestHttpObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &HttpObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestHttpObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestHttpObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestHttpObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"0.100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestHttpObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &HttpObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestHttpObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/istio_test.go b/pkg/metrics/observers/istio_test.go
index 107b34c7..2bd829d6 100644
--- a/pkg/metrics/observers/istio_test.go
+++ b/pkg/metrics/observers/istio_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestIstioObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestIstioObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &IstioObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestIstioObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestIstioObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestIstioObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"0.100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestIstioObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &IstioObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestIstioObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/linkerd_test.go b/pkg/metrics/observers/linkerd_test.go
index a66a69d6..7401dc87 100644
--- a/pkg/metrics/observers/linkerd_test.go
+++ b/pkg/metrics/observers/linkerd_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestLinkerdObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestLinkerdObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &LinkerdObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestLinkerdObserver_GetRequestSuccessRate(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestLinkerdObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestLinkerdObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestLinkerdObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &LinkerdObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestLinkerdObserver_GetRequestDuration(t *testing.T) {
 		Service:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/observers/nginx_test.go b/pkg/metrics/observers/nginx_test.go
index 974ec66f..10724c0d 100644
--- a/pkg/metrics/observers/nginx_test.go
+++ b/pkg/metrics/observers/nginx_test.go
@@ -6,6 +6,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 	"github.com/weaveworks/flagger/pkg/metrics/providers"
 )
@@ -15,9 +18,7 @@ func TestNginxObserver_GetRequestSuccessRate(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -29,9 +30,7 @@ func TestNginxObserver_GetRequestSuccessRate(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &NginxObserver{
 		client: client,
@@ -44,13 +43,9 @@ func TestNginxObserver_GetRequestSuccessRate(t *testing.T) {
 		Ingress:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestNginxObserver_GetRequestDuration(t *testing.T) {
@@ -58,9 +53,7 @@ func TestNginxObserver_GetRequestDuration(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1,"100"]}]}}`
 		w.Write([]byte(json))
@@ -72,9 +65,7 @@ func TestNginxObserver_GetRequestDuration(t *testing.T) {
 		Address:   ts.URL,
 		SecretRef: nil,
 	}, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	observer := &NginxObserver{
 		client: client,
@@ -87,11 +78,7 @@ func TestNginxObserver_GetRequestDuration(t *testing.T) {
 		Ingress:   "podinfo",
 		Interval:  "1m",
 	})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100*time.Millisecond {
-		t.Errorf("Got %v wanted %v", val, 100*time.Millisecond)
-	}
+	assert.Equal(t, 100*time.Millisecond, val)
 }
diff --git a/pkg/metrics/providers/cloudwatch_test.go b/pkg/metrics/providers/cloudwatch_test.go
index 58cfb3e2..ed51b70d 100644
--- a/pkg/metrics/providers/cloudwatch_test.go
+++ b/pkg/metrics/providers/cloudwatch_test.go
@@ -10,6 +10,8 @@ import (
 	"github.com/aws/aws-sdk-go/aws/awserr"
 	"github.com/aws/aws-sdk-go/service/cloudwatch"
 	"github.com/aws/aws-sdk-go/service/costandusagereportservice"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 )
@@ -31,20 +33,13 @@ func TestNewCloudWatchProvider(t *testing.T) {
 				Region: costandusagereportservice.AWSRegionApEast1,
 			})
 
-		if err != nil {
-			t.Fatal(err)
-		}
-
-		if exp := 5 * 60 * time.Second * cloudWatchStartDeltaMultiplierOnMetricInterval; p.startDelta != exp {
-			t.Fatalf("expected %d but got %d", exp, p.startDelta)
-		}
+		assert.NoError(t, err)
+		assert.Equal(t, 5*60*time.Second*cloudWatchStartDeltaMultiplierOnMetricInterval, p.startDelta)
 	})
 
 	t.Run("ng", func(t *testing.T) {
 		_, err := NewCloudWatchProvider("5m", flaggerv1.MetricTemplateProvider{})
-		if err == nil {
-			t.Fatal("error expected since region was not specified")
-		}
+		assert.Error(t, err, "error expected since region was not specified")
 	})
 }
 
@@ -56,35 +51,23 @@ func TestCloudWatchProvider_IsOnline(t *testing.T) {
 		}}
 
 		actual, err := p.IsOnline()
-		if err == nil {
-			t.Error("error expected")
-		}
-		if actual {
-			t.Error("false expected")
-		}
+		assert.Error(t, err)
+		assert.False(t, actual)
 	})
 
 	t.Run("ok", func(t *testing.T) {
 		// no error
 		p := CloudWatchProvider{client: cloudWatchClientMock{}}
 		actual, err := p.IsOnline()
-		if err != nil {
-			t.Errorf("no error expected but got %v", err)
-		}
-		if !actual {
-			t.Error("true expected")
-		}
+		assert.NoError(t, err)
+		assert.True(t, actual)
 
 		// with error but bad request
 		p = CloudWatchProvider{client: cloudWatchClientMock{
 			err: awserr.NewRequestFailure(nil, http.StatusBadRequest, "request-id"),
 		}}
-		if err != nil {
-			t.Errorf("no error expected but got %v", err)
-		}
-		if !actual {
-			t.Error("true expected")
-		}
+		assert.NoError(t, err)
+		assert.True(t, actual)
 	})
 }
 
@@ -148,25 +131,11 @@ func TestCloudWatchProvider_RunQuery(t *testing.T) {
 		}}
 
 		actual, err := p.RunQuery(query)
-		if err != nil {
-			t.Fatalf("no error expected but got %v", err)
-		}
-
-		if actual != exp {
-			t.Errorf("expected %f but got %f", exp, actual)
-		}
+		assert.NoError(t, err)
+		assert.Equal(t, exp, actual)
 	})
 
 	t.Run("no values", func(t *testing.T) {
-		assert := func(err error) {
-			if err == nil {
-				t.Fatal("error expected")
-			}
-			if !strings.Contains(err.Error(), "no values") {
-				t.Fatalf("no values expected in %v", err)
-			}
-		}
-
 		p := CloudWatchProvider{client: cloudWatchClientMock{
 			o: &cloudwatch.GetMetricDataOutput{
 				MetricDataResults: []*cloudwatch.MetricDataResult{
@@ -176,12 +145,14 @@ func TestCloudWatchProvider_RunQuery(t *testing.T) {
 		}}
 
 		_, err := p.RunQuery(query)
-		assert(err)
+		require.Error(t, err)
+		require.True(t, strings.Contains(err.Error(), "no values"))
 
 		p = CloudWatchProvider{client: cloudWatchClientMock{
 			o: &cloudwatch.GetMetricDataOutput{}}}
 
 		_, err = p.RunQuery(query)
-		assert(err)
+		require.Error(t, err)
+		require.True(t, strings.Contains(err.Error(), "no values"))
 	})
 }
diff --git a/pkg/metrics/providers/datadog_test.go b/pkg/metrics/providers/datadog_test.go
index c87a225a..d863a2a3 100644
--- a/pkg/metrics/providers/datadog_test.go
+++ b/pkg/metrics/providers/datadog_test.go
@@ -8,6 +8,9 @@ import (
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1beta1"
 )
 
@@ -21,35 +24,15 @@ func TestNewDatadogProvider(t *testing.T) {
 
 	mi := "100s"
 	md, err := time.ParseDuration(mi)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	dp, err := NewDatadogProvider("100s", flaggerv1.MetricTemplateProvider{}, cs)
-
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	if exp := "https://api.datadoghq.com/api/v1/validate"; dp.apiKeyValidationEndpoint != exp {
-		t.Fatalf("apiKeyValidationEndpoint expected %s but got %s", exp, dp.apiKeyValidationEndpoint)
-	}
-
-	if exp := "https://api.datadoghq.com/api/v1/query"; dp.metricsQueryEndpoint != exp {
-		t.Fatalf("metricsQueryEndpoint expected %s but got %s", exp, dp.metricsQueryEndpoint)
-	}
-
-	if exp := int64(md.Seconds() * datadogFromDeltaMultiplierOnMetricInterval); dp.fromDelta != exp {
-		t.Fatalf("fromDelta expected %d but got %d", exp, dp.fromDelta)
-	}
-
-	if dp.applicationKey != appKey {
-		t.Fatalf("application key expected %s but got %s", appKey, dp.applicationKey)
-	}
-
-	if dp.apiKey != apiKey {
-		t.Fatalf("api key expected %s but got %s", apiKey, dp.apiKey)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "https://api.datadoghq.com/api/v1/validate", dp.apiKeyValidationEndpoint)
+	assert.Equal(t, "https://api.datadoghq.com/api/v1/query", dp.metricsQueryEndpoint)
+	assert.Equal(t, int64(md.Seconds()*datadogFromDeltaMultiplierOnMetricInterval), dp.fromDelta)
+	assert.Equal(t, appKey, dp.applicationKey)
+	assert.Equal(t, apiKey, dp.apiKey)
 }
 
 func TestDatadogProvider_RunQuery(t *testing.T) {
@@ -61,29 +44,18 @@ func TestDatadogProvider_RunQuery(t *testing.T) {
 	now := time.Now().Unix()
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		aq := r.URL.Query().Get("query")
-		if aq != eq {
-			t.Errorf("\nquery expected %s bug got %s", eq, aq)
-		}
-
-		if vs := r.Header.Get(datadogApplicationKeyHeaderKey); vs != appKey {
-			t.Errorf("\n%s header expected %s but got %s", datadogApplicationKeyHeaderKey, appKey, vs)
-		}
-		if vs := r.Header.Get(datadogAPIKeyHeaderKey); vs != apiKey {
-			t.Errorf("\n%s header expected %s but got %s", datadogAPIKeyHeaderKey, apiKey, vs)
-		}
+		assert.Equal(t, eq, aq)
+		assert.Equal(t, appKey, r.Header.Get(datadogApplicationKeyHeaderKey))
+		assert.Equal(t, apiKey, r.Header.Get(datadogAPIKeyHeaderKey))
 
-		rf := r.URL.Query().Get("from")
-		if from, err := strconv.ParseInt(rf, 10, 64); err == nil && from >= now {
-			t.Errorf("\nfrom %d should be less than %d", from, now)
-		} else if err != nil {
-			t.Errorf("\nfailed to parse from: %v", err)
+		from, err := strconv.ParseInt(r.URL.Query().Get("from"), 10, 64)
+		if assert.NoError(t, err) {
+			assert.Less(t, from, now)
 		}
 
-		rt := r.URL.Query().Get("to")
-		if to, err := strconv.ParseInt(rt, 10, 64); err == nil && to < now {
-			t.Errorf("\nto %d should be greater than or equals %d", to, now)
-		} else if err != nil {
-			t.Errorf("\nfailed to parse to: %v", err)
+		to, err := strconv.ParseInt(r.URL.Query().Get("to"), 10, 64)
+		if assert.NoError(t, err) {
+			assert.GreaterOrEqual(t, to, now)
 		}
 
 		json := fmt.Sprintf(`{"series": [{"pointlist": [[1577232000000,29325.102158814265],[1577318400000,56294.46758591842],[1577404800000,%f]]}]}`, expected)
@@ -98,18 +70,11 @@ func TestDatadogProvider_RunQuery(t *testing.T) {
 			datadogAPIKeySecretKey:         []byte(apiKey),
 		},
 	)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	f, err := dp.RunQuery(eq)
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	if f != expected {
-		t.Fatalf("metric value expected %f but got %f", expected, f)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, expected, f)
 }
 
 func TestDatadogProvider_IsOnline(t *testing.T) {
@@ -124,12 +89,8 @@ func TestDatadogProvider_IsOnline(t *testing.T) {
 			appKey := "app-key"
 			apiKey := "api-key"
 			ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-				if vs := r.Header.Get(datadogApplicationKeyHeaderKey); vs != appKey {
-					t.Errorf("\n%s header expected %s but got %s", datadogApplicationKeyHeaderKey, appKey, vs)
-				}
-				if vs := r.Header.Get(datadogAPIKeyHeaderKey); vs != apiKey {
-					t.Errorf("\n%s header expected %s but got %s", datadogAPIKeyHeaderKey, apiKey, vs)
-				}
+				assert.Equal(t, appKey, r.Header.Get(datadogApplicationKeyHeaderKey))
+				assert.Equal(t, apiKey, r.Header.Get(datadogAPIKeyHeaderKey))
 				w.WriteHeader(c.code)
 			}))
 			defer ts.Close()
@@ -141,15 +102,13 @@ func TestDatadogProvider_IsOnline(t *testing.T) {
 					datadogAPIKeySecretKey:         []byte(apiKey),
 				},
 			)
-			if err != nil {
-				t.Fatal(err)
-			}
+			require.NoError(t, err)
 
 			_, err = dp.IsOnline()
-			if c.errExpected && err == nil {
-				t.Fatal("error expected but got no error")
-			} else if !c.errExpected && err != nil {
-				t.Fatalf("no error expected but got %v", err)
+			if c.errExpected {
+				require.Error(t, err)
+			} else {
+				require.NoError(t, err)
 			}
 		})
 	}
diff --git a/pkg/metrics/providers/prometheus_test.go b/pkg/metrics/providers/prometheus_test.go
index 2c23d785..effe82f5 100644
--- a/pkg/metrics/providers/prometheus_test.go
+++ b/pkg/metrics/providers/prometheus_test.go
@@ -6,6 +6,8 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/client-go/kubernetes"
@@ -67,43 +69,30 @@ func TestNewPrometheusProvider(t *testing.T) {
 	clients := prometheusFake()
 
 	template, err := clients.flaggerClient.FlaggerV1beta1().MetricTemplates("default").Get("prometheus", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	secret, err := clients.kubeClient.CoreV1().Secrets("default").Get("prometheus", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	prom, err := NewPrometheusProvider(template.Spec.Provider, secret.Data)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if prom.url.String() != "http://prometheus:9090" {
-		t.Errorf("Got URL %s wanted %s", prom.url.String(), "http://prometheus:9090")
-	}
+	require.NoError(t, err)
 
-	if prom.password != "password" {
-		t.Errorf("Got password %s wanted %s", prom.password, "password")
-	}
+	assert.Equal(t, "http://prometheus:9090", prom.url.String())
+	assert.Equal(t, "password", prom.password)
 }
 
 func TestPrometheusProvider_RunQueryWithBasicAuth(t *testing.T) {
 	expected := `sum(envoy_cluster_upstream_rq)`
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		promql := r.URL.Query()["query"][0]
-		if promql != expected {
-			t.Errorf("\nGot %s \nWanted %s", promql, expected)
-		}
+		assert.Equal(t, expected, promql)
+
+		if assert.Contains(t, r.Header, "Authorization") {
 
-		if header, ok := r.Header["Authorization"]; ok {
-			if !strings.Contains(header[0], "Basic") {
-				t.Error("Basic authorization header not found")
-			}
-		} else {
-			t.Error("Authorization header not found")
+		}
+		header, ok := r.Header["Authorization"]
+		if assert.True(t, ok, "Authorization header not found") {
+			assert.True(t, strings.Contains(header[0], "Basic"), "Basic authorization header not found")
 		}
 
 		json := `{"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1545905245.458,"100"]}]}}`
@@ -114,29 +103,19 @@ func TestPrometheusProvider_RunQueryWithBasicAuth(t *testing.T) {
 	clients := prometheusFake()
 
 	template, err := clients.flaggerClient.FlaggerV1beta1().MetricTemplates("default").Get("prometheus", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	template.Spec.Provider.Address = ts.URL
 
 	secret, err := clients.kubeClient.CoreV1().Secrets("default").Get("prometheus", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	prom, err := NewPrometheusProvider(template.Spec.Provider, secret.Data)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	val, err := prom.RunQuery(template.Spec.Query)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if val != 100 {
-		t.Errorf("Got %v wanted %v", val, 100)
-	}
+	assert.Equal(t, float64(100), val)
 }
 
 func TestPrometheusProvider_IsOnline(t *testing.T) {
@@ -148,23 +127,14 @@ func TestPrometheusProvider_IsOnline(t *testing.T) {
 	clients := prometheusFake()
 
 	template, err := clients.flaggerClient.FlaggerV1beta1().MetricTemplates("default").Get("prometheus", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	template.Spec.Provider.Address = ts.URL
 	template.Spec.Provider.SecretRef = nil
 
 	prom, err := NewPrometheusProvider(template.Spec.Provider, nil)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	ok, err := prom.IsOnline()
-	if err == nil {
-		t.Errorf("Got no error wanted %v", http.StatusBadGateway)
-	}
-
-	if ok {
-		t.Errorf("Got %v wanted %v", ok, false)
-	}
+	assert.Error(t, err, "Got no error wanted %v", http.StatusBadGateway)
+	assert.False(t, ok)
 }
diff --git a/pkg/notifier/client_test.go b/pkg/notifier/client_test.go
index 3695f087..09bf192a 100644
--- a/pkg/notifier/client_test.go
+++ b/pkg/notifier/client_test.go
@@ -6,25 +6,22 @@ import (
 	"net/http"
 	"net/http/httptest"
 	"testing"
+
+	"github.com/stretchr/testify/require"
 )
 
 func Test_postMessage(t *testing.T) {
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
+
 		var payload = make(map[string]string)
 		err = json.Unmarshal(b, &payload)
 
-		if payload["status"] != "success" {
-			t.Fatal("wrong payload")
-		}
+		require.Equal(t, "success", payload["status"])
 	}))
 	defer ts.Close()
 
 	err := postMessage(ts.URL, map[string]string{"status": "success"})
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 }
diff --git a/pkg/notifier/discord_test.go b/pkg/notifier/discord_test.go
index b74b6673..e409dac6 100644
--- a/pkg/notifier/discord_test.go
+++ b/pkg/notifier/discord_test.go
@@ -7,6 +7,9 @@ import (
 	"net/http/httptest"
 	"strings"
 	"testing"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 )
 
 func TestDiscord_Post(t *testing.T) {
@@ -17,33 +20,19 @@ func TestDiscord_Post(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
 		var payload = SlackPayload{}
 		err = json.Unmarshal(b, &payload)
-
-		if payload.Attachments[0].AuthorName != "podinfo.test" {
-			t.Fatal("wrong author name")
-		}
-
-		if len(payload.Attachments[0].Fields) != len(fields) {
-			t.Fatal("wrong facts")
-		}
+		require.NoError(t, err)
+		require.Equal(t, "podinfo.test", payload.Attachments[0].AuthorName)
+		require.Equal(t, len(fields), len(payload.Attachments[0].Fields))
 	}))
 	defer ts.Close()
 
 	discord, err := NewDiscord(ts.URL, "test", "test")
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	if !strings.HasSuffix(discord.URL, "/slack") {
-		t.Error("Invalid Discord URL, expected to have /slack prefix")
-	}
+	require.NoError(t, err)
+	assert.True(t, strings.HasSuffix(discord.URL, "/slack"))
 
 	err = discord.Post("podinfo", "test", "test", fields, "warn")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 }
diff --git a/pkg/notifier/rocket_test.go b/pkg/notifier/rocket_test.go
index 2d4daab8..085e63f1 100644
--- a/pkg/notifier/rocket_test.go
+++ b/pkg/notifier/rocket_test.go
@@ -6,6 +6,8 @@ import (
 	"net/http"
 	"net/http/httptest"
 	"testing"
+
+	"github.com/stretchr/testify/require"
 )
 
 func TestSlack_Post(t *testing.T) {
@@ -16,29 +18,19 @@ func TestSlack_Post(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
+
 		var payload = SlackPayload{}
 		err = json.Unmarshal(b, &payload)
-
-		if payload.Attachments[0].AuthorName != "podinfo.test" {
-			t.Fatal("wrong author name")
-		}
-
-		if len(payload.Attachments[0].Fields) != len(fields) {
-			t.Fatal("wrong facts")
-		}
+		require.NoError(t, err)
+		require.Equal(t, "podinfo.test", payload.Attachments[0].AuthorName)
+		require.Equal(t, len(fields), len(payload.Attachments[0].Fields))
 	}))
 	defer ts.Close()
 
 	slack, err := NewSlack(ts.URL, "test", "test")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	err = slack.Post("podinfo", "test", "test", fields, "error")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 }
diff --git a/pkg/notifier/slack_test.go b/pkg/notifier/slack_test.go
index 4399f2a6..23e9f232 100644
--- a/pkg/notifier/slack_test.go
+++ b/pkg/notifier/slack_test.go
@@ -6,6 +6,8 @@ import (
 	"net/http"
 	"net/http/httptest"
 	"testing"
+
+	"github.com/stretchr/testify/require"
 )
 
 func TestRocket_Post(t *testing.T) {
@@ -16,29 +18,20 @@ func TestRocket_Post(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
+
 		var payload = SlackPayload{}
 		err = json.Unmarshal(b, &payload)
-
-		if payload.Attachments[0].AuthorName != "podinfo.test" {
-			t.Fatal("wrong author name")
-		}
-
-		if len(payload.Attachments[0].Fields) != len(fields) {
-			t.Fatal("wrong field")
-		}
+		require.NoError(t, err)
+		require.Equal(t, "podinfo.test", payload.Attachments[0].AuthorName)
+		require.Equal(t, len(fields), len(payload.Attachments[0].Fields))
 	}))
 	defer ts.Close()
 
 	rocket, err := NewRocket(ts.URL, "test", "test")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	err = rocket.Post("podinfo", "test", "test", fields, "error")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
+
 }
diff --git a/pkg/notifier/teams_test.go b/pkg/notifier/teams_test.go
index 75d08d6b..270d492e 100644
--- a/pkg/notifier/teams_test.go
+++ b/pkg/notifier/teams_test.go
@@ -6,6 +6,8 @@ import (
 	"net/http"
 	"net/http/httptest"
 	"testing"
+
+	"github.com/stretchr/testify/require"
 )
 
 func TestTeams_Post(t *testing.T) {
@@ -17,28 +19,19 @@ func TestTeams_Post(t *testing.T) {
 
 	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		b, err := ioutil.ReadAll(r.Body)
-		if err != nil {
-			t.Fatal(err)
-		}
+		require.NoError(t, err)
 		var payload = MSTeamsPayload{}
 		err = json.Unmarshal(b, &payload)
+		require.NoError(t, err)
 
-		if payload.Sections[0].ActivitySubtitle != "podinfo.test" {
-			t.Fatal("wrong activity subtitle")
-		}
-		if len(payload.Sections[0].Facts) != len(fields) {
-			t.Fatal("wrong facts")
-		}
+		require.Equal(t, "podinfo.test", payload.Sections[0].ActivitySubtitle)
+		require.Equal(t, len(fields), len(payload.Sections[0].Facts))
 	}))
 	defer ts.Close()
 
 	teams, err := NewMSTeams(ts.URL)
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 
 	err = teams.Post("podinfo", "test", "test", fields, "info")
-	if err != nil {
-		t.Fatal(err)
-	}
+	require.NoError(t, err)
 }
diff --git a/pkg/router/appmesh_test.go b/pkg/router/appmesh_test.go
index bae70620..6b5fc3c1 100644
--- a/pkg/router/appmesh_test.go
+++ b/pkg/router/appmesh_test.go
@@ -6,6 +6,9 @@ import (
 	"strings"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -19,135 +22,82 @@ func TestAppmeshRouter_Reconcile(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.appmeshCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check virtual service
 	vsName := fmt.Sprintf("%s.%s", mocks.appmeshCanary.Spec.TargetRef.Name, mocks.appmeshCanary.Namespace)
 	vs, err := router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	meshName := mocks.appmeshCanary.Spec.Service.MeshName
-	if vs.Spec.MeshName != meshName {
-		t.Errorf("Got mesh name %v wanted %v", vs.Spec.MeshName, meshName)
-	}
-
-	targetsCount := len(vs.Spec.Routes[0].Http.Action.WeightedTargets)
-	if targetsCount != 2 {
-		t.Errorf("Got routes %v wanted %v", targetsCount, 2)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, mocks.appmeshCanary.Spec.Service.MeshName, vs.Spec.MeshName)
+	assert.Len(t, vs.Spec.Routes[0].Http.Action.WeightedTargets, 2)
 
 	// check canary virtual service
 	vsCanaryName := fmt.Sprintf("%s-canary.%s", mocks.appmeshCanary.Spec.TargetRef.Name, mocks.appmeshCanary.Namespace)
 	vsCanary, err := router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsCanaryName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check if the canary virtual service routes all traffic to the canary virtual node
 	target := vsCanary.Spec.Routes[0].Http.Action.WeightedTargets[0]
 	canaryVirtualNodeName := fmt.Sprintf("%s-canary", mocks.appmeshCanary.Spec.TargetRef.Name)
-	if target.VirtualNodeName != canaryVirtualNodeName {
-		t.Errorf("Got VirtualNodeName %v wanted %v", target.VirtualNodeName, canaryVirtualNodeName)
-	}
-	if target.Weight != 100 {
-		t.Errorf("Got weight %v wanted %v", target.Weight, 100)
-	}
+	assert.Equal(t, canaryVirtualNodeName, target.VirtualNodeName)
+	assert.Equal(t, int64(100), target.Weight)
 
 	// check virtual node
 	vnName := mocks.appmeshCanary.Spec.TargetRef.Name
 	vn, err := router.appmeshClient.AppmeshV1beta1().VirtualNodes("default").Get(vnName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primaryDNS := fmt.Sprintf("%s-primary.%s", mocks.appmeshCanary.Spec.TargetRef.Name, mocks.appmeshCanary.Namespace)
-	vnHostName := vn.Spec.ServiceDiscovery.Dns.HostName
-	if vnHostName != primaryDNS {
-		t.Errorf("Got DNS host name %v wanted %v", vnHostName, primaryDNS)
-	}
+	assert.Equal(t, primaryDNS, vn.Spec.ServiceDiscovery.Dns.HostName)
 
 	// test backends update
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("appmesh", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	cdClone := cd.DeepCopy()
 	hosts := cdClone.Spec.Service.Backends
 	hosts = append(hosts, "test.example.com")
 	cdClone.Spec.Service.Backends = hosts
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cdClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// verify
 	vnCanaryName := fmt.Sprintf("%s-canary", mocks.appmeshCanary.Spec.TargetRef.Name)
 	vnCanary, err := router.appmeshClient.AppmeshV1beta1().VirtualNodes("default").Get(vnCanaryName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(vnCanary.Spec.Backends) != 2 {
-		t.Errorf("Got backends %v wanted %v", len(vnCanary.Spec.Backends), 2)
-	}
+	require.NoError(t, err)
+	require.Len(t, vnCanary.Spec.Backends, 2)
 
 	// test weight update
 	vsClone := vs.DeepCopy()
 	vsClone.Spec.Routes[0].Http.Action.WeightedTargets[0].Weight = 50
 	vsClone.Spec.Routes[0].Http.Action.WeightedTargets[1].Weight = 50
 	vs, err = mocks.meshClient.AppmeshV1beta1().VirtualServices("default").Update(vsClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	vs, err = router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	weight := vs.Spec.Routes[0].Http.Action.WeightedTargets[0].Weight
-	if weight != 50 {
-		t.Errorf("Got weight %v wanted %v", weight, 50)
-	}
+	vs, err = router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
+	require.NoError(t, err)
+	assert.Equal(t, int64(50), vs.Spec.Routes[0].Http.Action.WeightedTargets[0].Weight)
 
 	// test URI update
 	vsClone = vs.DeepCopy()
 	vsClone.Spec.Routes[0].Http.Match.Prefix = "api"
 	vs, err = mocks.meshClient.AppmeshV1beta1().VirtualServices("default").Update(vsClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	vs, err = router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	prefix := vs.Spec.Routes[0].Http.Match.Prefix
-	if prefix != "/" {
-		t.Errorf("Got prefix %v wanted %v", prefix, "/")
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "/", vs.Spec.Routes[0].Http.Match.Prefix)
 }
 
 func TestAppmeshRouter_GetSetRoutes(t *testing.T) {
@@ -160,31 +110,16 @@ func TestAppmeshRouter_GetSetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.appmeshCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = router.SetRoutes(mocks.appmeshCanary, 60, 40, false)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.appmeshCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if p != 60 {
-		t.Errorf("Got primary weight %v wanted %v", p, 60)
-	}
-
-	if c != 40 {
-		t.Errorf("Got canary weight %v wanted %v", c, 40)
-	}
-
-	if m != false {
-		t.Errorf("Got mirror %v wanted %v", m, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 60, p)
+	assert.Equal(t, 40, c)
+	assert.False(t, m)
 }
 
 func TestAppmeshRouter_ABTest(t *testing.T) {
@@ -197,36 +132,20 @@ func TestAppmeshRouter_ABTest(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.abtest)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check virtual service
 	vsName := fmt.Sprintf("%s.%s", mocks.abtest.Spec.TargetRef.Name, mocks.abtest.Namespace)
 	vs, err := router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check virtual service
-	if len(vs.Spec.Routes) != 2 {
-		t.Errorf("Got routes %v wanted %v", len(vs.Spec.Routes), 2)
-	}
+	assert.Len(t, vs.Spec.Routes, 2)
 
 	// check headers
-	if len(vs.Spec.Routes[0].Http.Match.Headers) < 1 {
-		t.Errorf("Got no http match headers")
-	}
-
-	header := vs.Spec.Routes[0].Http.Match.Headers[0].Name
-	if header != "x-user-type" {
-		t.Errorf("Got http match header %v wanted %v", header, "x-user-type")
-	}
-
-	exactMatch := *vs.Spec.Routes[0].Http.Match.Headers[0].Match.Exact
-	if exactMatch != "test" {
-		t.Errorf("Got http match header exact %v wanted %v", exactMatch, "test")
-	}
+	assert.GreaterOrEqual(t, len(vs.Spec.Routes[0].Http.Match.Headers), 1, "Got no http match headers")
+	assert.Equal(t, "x-user-type", vs.Spec.Routes[0].Http.Match.Headers[0].Name)
+	assert.Equal(t, "test", *vs.Spec.Routes[0].Http.Match.Headers[0].Match.Exact)
 }
 
 func TestAppmeshRouter_Gateway(t *testing.T) {
@@ -239,34 +158,17 @@ func TestAppmeshRouter_Gateway(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.appmeshCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// check virtual service
 	vsName := fmt.Sprintf("%s.%s", mocks.appmeshCanary.Spec.TargetRef.Name, mocks.appmeshCanary.Namespace)
 	vs, err := router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	expose := vs.Annotations["gateway.appmesh.k8s.aws/expose"]
-	if expose != "true" {
-		t.Errorf("Got gateway expose annotation %v wanted %v", expose, "true")
-	}
-
-	domain := vs.Annotations["gateway.appmesh.k8s.aws/domain"]
-	if !strings.Contains(domain, mocks.appmeshCanary.Spec.Service.Hosts[0]) {
-		t.Errorf("Got gateway domain annotation %v wanted %v", domain, mocks.appmeshCanary.Spec.Service.Hosts[0])
-	}
-
-	timeout := vs.Annotations["gateway.appmesh.k8s.aws/timeout"]
-	if timeout != mocks.appmeshCanary.Spec.Service.Timeout {
-		t.Errorf("Got gateway timeout annotation %v wanted %v", timeout, mocks.appmeshCanary.Spec.Service.Timeout)
-	}
+	assert.Equal(t, "true", vs.Annotations["gateway.appmesh.k8s.aws/expose"])
+	assert.True(t, strings.Contains(vs.Annotations["gateway.appmesh.k8s.aws/domain"], mocks.appmeshCanary.Spec.Service.Hosts[0]))
+	assert.Equal(t, mocks.appmeshCanary.Spec.Service.Timeout, vs.Annotations["gateway.appmesh.k8s.aws/timeout"])
 
 	retries := vs.Annotations["gateway.appmesh.k8s.aws/retries"]
-	if retries != strconv.Itoa(mocks.appmeshCanary.Spec.Service.Retries.Attempts) {
-		t.Errorf("Got gateway retries annotation %v wanted %v", retries, strconv.Itoa(mocks.appmeshCanary.Spec.Service.Retries.Attempts))
-	}
+	assert.Equal(t, strconv.Itoa(mocks.appmeshCanary.Spec.Service.Retries.Attempts), retries)
 }
diff --git a/pkg/router/contour_test.go b/pkg/router/contour_test.go
index 5c828ac6..064073c1 100644
--- a/pkg/router/contour_test.go
+++ b/pkg/router/contour_test.go
@@ -3,6 +3,9 @@ package router
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -17,102 +20,55 @@ func TestContourRouter_Reconcile(t *testing.T) {
 
 	// init
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test insert
 	proxy, err := router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	services := proxy.Spec.Routes[0].Services
-	if len(services) != 2 {
-		t.Errorf("Got Services %v wanted %v", len(services), 2)
-	}
-
-	if services[0].Weight != 100 {
-		t.Errorf("Primary weight should is %v wanted 100", services[0].Weight)
-	}
-	if services[1].Weight != 0 {
-		t.Errorf("Canary weight should is %v wanted 0", services[0].Weight)
-	}
+	require.Len(t, services, 2)
+	assert.Equal(t, uint32(100), services[0].Weight)
+	assert.Equal(t, uint32(0), services[1].Weight)
 
 	// test update
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	cdClone := cd.DeepCopy()
 	cdClone.Spec.Service.Port = 8080
 	cdClone.Spec.Service.Timeout = "1m"
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cdClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	proxy, err = router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	port := proxy.Spec.Routes[0].Services[0].Port
-	if port != 8080 {
-		t.Errorf("Service port is %v wanted %v", port, 8080)
-	}
-
-	timeout := proxy.Spec.Routes[0].TimeoutPolicy.Response
-	if timeout != "1m" {
-		t.Errorf("HTTPProxy timeout is %v wanted %v", timeout, "1m")
-	}
-
-	prefix := proxy.Spec.Routes[0].Conditions[0].Prefix
-	if prefix != "/podinfo" {
-		t.Errorf("HTTPProxy prefix is %v wanted %v", prefix, "podinfo")
-	}
-
-	retry := proxy.Spec.Routes[0].RetryPolicy.NumRetries
-	if retry != 10 {
-		t.Errorf("HTTPProxy NumRetries is %v wanted %v", retry, 10)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 8080, proxy.Spec.Routes[0].Services[0].Port)
+	assert.Equal(t, "1m", proxy.Spec.Routes[0].TimeoutPolicy.Response)
+	assert.Equal(t, "/podinfo", proxy.Spec.Routes[0].Conditions[0].Prefix)
+	assert.Equal(t, uint32(10), proxy.Spec.Routes[0].RetryPolicy.NumRetries)
 
 	// test headers update
 	cd, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	cdClone = cd.DeepCopy()
 	cdClone.Spec.CanaryAnalysis.Iterations = 5
 	cdClone.Spec.CanaryAnalysis.Match = newTestABTest().Spec.CanaryAnalysis.Match
 	canary, err = mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cdClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	proxy, err = router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	header := proxy.Spec.Routes[0].Conditions[0].Header.Exact
-	if header != "test" {
-		t.Errorf("Route header condition is %v wanted %v", header, "test")
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "test", proxy.Spec.Routes[0].Conditions[0].Header.Exact)
 }
 
 func TestContourRouter_Routes(t *testing.T) {
@@ -126,88 +82,55 @@ func TestContourRouter_Routes(t *testing.T) {
 
 	// init
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test set routers
 	err = router.SetRoutes(mocks.canary, 50, 50, false)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	proxy, err := router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primary := proxy.Spec.Routes[0].Services[0]
-	if primary.Weight != 50 {
-		t.Errorf("Got primary weight %v wanted %v", primary.Weight, 50)
-	}
+	assert.Equal(t, uint32(50), primary.Weight)
 
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test get routers
 	_, cw, _, err := router.GetRoutes(cd)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if cw != 50 {
-		t.Errorf("Got canary weight %v wanted %v", cw, 50)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 50, cw)
 
 	// test update to A/B
 	cdClone := cd.DeepCopy()
 	cdClone.Spec.CanaryAnalysis.Iterations = 5
 	cdClone.Spec.CanaryAnalysis.Match = newTestABTest().Spec.CanaryAnalysis.Match
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cdClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	proxy, err = router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primary = proxy.Spec.Routes[0].Services[0]
-	if primary.Weight != 100 {
-		t.Errorf("Got primary weight %v wanted %v", primary.Weight, 100)
-	}
+	assert.Equal(t, uint32(100), primary.Weight)
 
 	primary = proxy.Spec.Routes[1].Services[0]
-	if primary.Weight != 100 {
-		t.Errorf("Got primary weight %v wanted %v", primary.Weight, 100)
-	}
+	assert.Equal(t, uint32(100), primary.Weight)
 
 	// test set routers for A/B
 	err = router.SetRoutes(canary, 0, 100, false)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	proxy, err = router.contourClient.ProjectcontourV1().HTTPProxies("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	primary = proxy.Spec.Routes[0].Services[0]
-	if primary.Weight != 0 {
-		t.Errorf("Got primary weight %v wanted %v", primary.Weight, 0)
-	}
+	assert.Equal(t, uint32(0), primary.Weight)
 
 	primary = proxy.Spec.Routes[1].Services[0]
-	if primary.Weight != 100 {
-		t.Errorf("Got primary weight %v wanted %v", primary.Weight, 100)
-	}
+	assert.Equal(t, uint32(100), primary.Weight)
 }
diff --git a/pkg/router/gloo_test.go b/pkg/router/gloo_test.go
index 69d4da5f..beeece26 100644
--- a/pkg/router/gloo_test.go
+++ b/pkg/router/gloo_test.go
@@ -4,6 +4,8 @@ import (
 	"fmt"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	gloov1 "github.com/weaveworks/flagger/pkg/apis/gloo/v1"
@@ -19,27 +21,15 @@ func TestGlooRouter_Sync(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test insert
 	ug, err := router.glooClient.GlooV1().UpstreamGroups("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	dests := ug.Spec.Destinations
-	if len(dests) != 2 {
-		t.Errorf("Got Destinations %v wanted %v", len(dests), 2)
-	}
-
-	if dests[0].Weight != 100 {
-		t.Errorf("Primary weight should is %v wanted 100", dests[0].Weight)
-	}
-	if dests[1].Weight != 0 {
-		t.Errorf("Canary weight should is %v wanted 0", dests[0].Weight)
-	}
-
+	assert.Len(t, dests, 2)
+	assert.Equal(t, uint32(100), dests[0].Weight)
+	assert.Equal(t, uint32(0), dests[1].Weight)
 }
 
 func TestGlooRouter_SetRoutes(t *testing.T) {
@@ -52,28 +42,20 @@ func TestGlooRouter_SetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p = 50
 	c = 50
 	m = false
 
 	err = router.SetRoutes(mocks.canary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	ug, err := router.glooClient.GlooV1().UpstreamGroups("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	var pRoute gloov1.WeightedDestination
 	var cRoute gloov1.WeightedDestination
@@ -89,14 +71,8 @@ func TestGlooRouter_SetRoutes(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight != uint32(p) {
-		t.Errorf("Got primary weight %v wanted %v", pRoute.Weight, p)
-	}
-
-	if cRoute.Weight != uint32(c) {
-		t.Errorf("Got canary weight %v wanted %v", cRoute.Weight, c)
-	}
-
+	assert.Equal(t, uint32(p), pRoute.Weight)
+	assert.Equal(t, uint32(c), cRoute.Weight)
 }
 
 func TestGlooRouter_GetRoutes(t *testing.T) {
@@ -109,24 +85,12 @@ func TestGlooRouter_GetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if p != 100 {
-		t.Errorf("Got primary weight %v wanted %v", p, 100)
-	}
-
-	if c != 0 {
-		t.Errorf("Got canary weight %v wanted %v", c, 0)
-	}
-
-	if m != false {
-		t.Errorf("Got mirror %v wanted %v", m, false)
-	}
+	assert.Equal(t, 100, p)
+	assert.Equal(t, 0, c)
+	assert.False(t, m)
 }
diff --git a/pkg/router/ingress_test.go b/pkg/router/ingress_test.go
index 200999c8..05505c27 100644
--- a/pkg/router/ingress_test.go
+++ b/pkg/router/ingress_test.go
@@ -4,6 +4,9 @@ import (
 	"fmt"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -16,31 +19,18 @@ func TestIngressRouter_Reconcile(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.ingressCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canaryAn := "custom.ingress.kubernetes.io/canary"
 	canaryWeightAn := "custom.ingress.kubernetes.io/canary-weight"
 
 	canaryName := fmt.Sprintf("%s-canary", mocks.ingressCanary.Spec.IngressRef.Name)
 	inCanary, err := router.kubeClient.ExtensionsV1beta1().Ingresses("default").Get(canaryName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if _, ok := inCanary.Annotations[canaryAn]; !ok {
-		t.Errorf("Canary annotation missing")
-	}
+	require.NoError(t, err)
 
 	// test initialisation
-	if inCanary.Annotations[canaryAn] != "false" {
-		t.Errorf("Got canary annotation %v wanted false", inCanary.Annotations[canaryAn])
-	}
-
-	if inCanary.Annotations[canaryWeightAn] != "0" {
-		t.Errorf("Got canary weight annotation %v wanted 0", inCanary.Annotations[canaryWeightAn])
-	}
+	assert.Equal(t, "false", inCanary.Annotations[canaryAn])
+	assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn])
 }
 
 func TestIngressRouter_GetSetRoutes(t *testing.T) {
@@ -52,66 +42,40 @@ func TestIngressRouter_GetSetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.ingressCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.ingressCanary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p = 50
 	c = 50
 	m = false
 
 	err = router.SetRoutes(mocks.ingressCanary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canaryAn := "prefix1.nginx.ingress.kubernetes.io/canary"
 	canaryWeightAn := "prefix1.nginx.ingress.kubernetes.io/canary-weight"
 
 	canaryName := fmt.Sprintf("%s-canary", mocks.ingressCanary.Spec.IngressRef.Name)
 	inCanary, err := router.kubeClient.ExtensionsV1beta1().Ingresses("default").Get(canaryName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if _, ok := inCanary.Annotations[canaryAn]; !ok {
-		t.Errorf("Canary annotation missing")
-	}
+	require.NoError(t, err)
 
 	// test rollout
-	if inCanary.Annotations[canaryAn] != "true" {
-		t.Errorf("Got canary annotation %v wanted true", inCanary.Annotations[canaryAn])
-	}
-
-	if inCanary.Annotations[canaryWeightAn] != "50" {
-		t.Errorf("Got canary weight annotation %v wanted 50", inCanary.Annotations[canaryWeightAn])
-	}
+	assert.Equal(t, "true", inCanary.Annotations[canaryAn])
+	assert.Equal(t, "50", inCanary.Annotations[canaryWeightAn])
 
 	p = 100
 	c = 0
 	m = false
 
 	err = router.SetRoutes(mocks.ingressCanary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	inCanary, err = router.kubeClient.ExtensionsV1beta1().Ingresses("default").Get(canaryName, metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test promotion
-	if inCanary.Annotations[canaryAn] != "false" {
-		t.Errorf("Got canary annotation %v wanted false", inCanary.Annotations[canaryAn])
-	}
-
-	if inCanary.Annotations[canaryWeightAn] != "0" {
-		t.Errorf("Got canary weight annotation %v wanted 0", inCanary.Annotations[canaryWeightAn])
-	}
+	assert.Equal(t, "false", inCanary.Annotations[canaryAn])
+	assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn])
 }
diff --git a/pkg/router/istio_test.go b/pkg/router/istio_test.go
index a917237b..e48967f0 100644
--- a/pkg/router/istio_test.go
+++ b/pkg/router/istio_test.go
@@ -4,6 +4,8 @@ import (
 	"fmt"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	istiov1alpha3 "github.com/weaveworks/flagger/pkg/apis/istio/v1alpha3"
@@ -19,63 +21,39 @@ func TestIstioRouter_Sync(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test insert
 	_, err = mocks.meshClient.NetworkingV1alpha3().DestinationRules("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	_, err = mocks.meshClient.NetworkingV1alpha3().DestinationRules("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(vs.Spec.Http) != 1 {
-		t.Errorf("Got Istio VS Http %v wanted %v", len(vs.Spec.Http), 1)
-	}
-
-	if len(vs.Spec.Http[0].Route) != 2 {
-		t.Errorf("Got Istio VS routes %v wanted %v", len(vs.Spec.Http[0].Route), 2)
-	}
+	require.NoError(t, err)
+	require.Len(t, vs.Spec.Http, 1)
+	require.Len(t, vs.Spec.Http[0].Route, 2)
 
 	// test update
 	cd, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	cdClone := cd.DeepCopy()
 	hosts := cdClone.Spec.Service.Hosts
 	hosts = append(hosts, "test.example.com")
 	cdClone.Spec.Service.Hosts = hosts
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(cdClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply change
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// verify
 	vs, err = mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if len(vs.Spec.Hosts) != 2 {
-		t.Errorf("Got Istio VS hosts %v wanted %v", vs.Spec.Hosts, 2)
-	}
+	require.NoError(t, err)
+	assert.Len(t, vs.Spec.Hosts, 2)
 
 	// test drift
 	vsClone := vs.DeepCopy()
@@ -85,30 +63,20 @@ func TestIstioRouter_Sync(t *testing.T) {
 	totalGateways := len(mocks.canary.Spec.Service.Gateways)
 
 	vsGateways, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Update(vsClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	totalGateways++
-	if len(vsGateways.Spec.Gateways) != totalGateways {
-		t.Errorf("Got Istio VS gateway %v wanted %v", vsGateways.Spec.Gateways, totalGateways)
-	}
+	assert.Len(t, vsGateways.Spec.Gateways, totalGateways)
 
 	// undo change
 	totalGateways--
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// verify
 	vs, err = mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	if len(vs.Spec.Gateways) != totalGateways {
-		t.Errorf("Got Istio VS gateways %v wanted %v", vs.Spec.Gateways, totalGateways)
-	}
+	require.NoError(t, err)
+	assert.Len(t, vs.Spec.Gateways, totalGateways)
 }
 
 func TestIstioRouter_SetRoutes(t *testing.T) {
@@ -121,28 +89,20 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p = 60
 	c = 40
 	m = false
 
 	err = router.SetRoutes(mocks.canary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	pHost := fmt.Sprintf("%s-primary", mocks.canary.Spec.TargetRef.Name)
 	cHost := fmt.Sprintf("%s-canary", mocks.canary.Spec.TargetRef.Name)
@@ -162,17 +122,9 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight != p {
-		t.Errorf("Got primary weight %v wanted %v", pRoute.Weight, p)
-	}
-
-	if cRoute.Weight != c {
-		t.Errorf("Got canary weight %v wanted %v", cRoute.Weight, c)
-	}
-
-	if mirror != nil {
-		t.Errorf("Got mirror %v wanted nil", mirror)
-	}
+	assert.Equal(t, p, pRoute.Weight)
+	assert.Equal(t, c, cRoute.Weight)
+	assert.Nil(t, mirror)
 
 	mirror = nil
 	p = 100
@@ -180,14 +132,10 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 	m = true
 
 	err = router.SetRoutes(mocks.canary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err = mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	for _, http := range vs.Spec.Http {
 		for _, route := range http.Route {
@@ -201,18 +149,10 @@ func TestIstioRouter_SetRoutes(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight != p {
-		t.Errorf("Got primary weight %v wanted %v", pRoute.Weight, p)
-	}
-
-	if cRoute.Weight != c {
-		t.Errorf("Got canary weight %v wanted %v", cRoute.Weight, c)
-	}
-
-	if mirror == nil {
-		t.Errorf("Got mirror nil wanted a mirror")
-	} else if mirror.Host != cHost {
-		t.Errorf("Got mirror host \"%v\" wanted \"%v\"", mirror.Host, cHost)
+	assert.Equal(t, p, pRoute.Weight)
+	assert.Equal(t, c, cRoute.Weight)
+	if assert.NotNil(t, mirror) {
+		assert.Equal(t, cHost, mirror.Host)
 	}
 }
 
@@ -226,58 +166,31 @@ func TestIstioRouter_GetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if p != 100 {
-		t.Errorf("Got primary weight %v wanted %v", p, 100)
-	}
-
-	if c != 0 {
-		t.Errorf("Got canary weight %v wanted %v", c, 0)
-	}
-
-	if m != false {
-		t.Errorf("Got mirror %v wanted %v", m, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, p)
+	assert.Equal(t, 0, c)
+	assert.False(t, m)
 
 	mocks.canary = newTestMirror()
 
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err = router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if p != 100 {
-		t.Errorf("Got primary weight %v wanted %v", p, 100)
-	}
-
-	if c != 0 {
-		t.Errorf("Got canary weight %v wanted %v", c, 0)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, p)
+	assert.Equal(t, 0, c)
 
 	// A Canary resource with mirror on does not automatically create mirroring
 	// in the virtual server (mirroring is activated as a temporary stage).
-	if m != false {
-		t.Errorf("Got mirror %v wanted %v", m, false)
-	}
+	assert.False(t, m)
 
 	// Adjust vs to activate mirroring.
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	cHost := fmt.Sprintf("%s-canary", mocks.canary.Spec.TargetRef.Name)
 	for i, http := range vs.Spec.Http {
@@ -290,26 +203,13 @@ func TestIstioRouter_GetRoutes(t *testing.T) {
 		}
 	}
 	_, err = mocks.meshClient.NetworkingV1alpha3().VirtualServices(mocks.canary.Namespace).Update(vs)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err = router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if p != 100 {
-		t.Errorf("Got primary weight %v wanted %v", p, 100)
-	}
-
-	if c != 0 {
-		t.Errorf("Got canary weight %v wanted %v", c, 0)
-	}
-
-	if m != true {
-		t.Errorf("Got mirror %v wanted %v", m, true)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, p)
+	assert.Equal(t, 0, c)
+	assert.True(t, m)
 }
 
 func TestIstioRouter_HTTPRequestHeaders(t *testing.T) {
@@ -322,33 +222,14 @@ func TestIstioRouter_HTTPRequestHeaders(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(vs.Spec.Http) != 1 {
-		t.Fatalf("Got HTTPRoute %v wanted %v", len(vs.Spec.Http), 1)
-	}
-
-	timeout := vs.Spec.Http[0].Headers.Request.Add["x-envoy-upstream-rq-timeout-ms"]
-	if timeout != "15000" {
-		t.Errorf("Got timeout %v wanted %v", timeout, "15000")
-	}
-
-	reqRemove := vs.Spec.Http[0].Headers.Request.Remove[0]
-	if reqRemove != "test" {
-		t.Errorf("Got Headers.Request.Remove %v wanted %v", reqRemove, "test")
-	}
-
-	resRemove := vs.Spec.Http[0].Headers.Response.Remove[0]
-	if resRemove != "token" {
-		t.Errorf("Got Headers.Response.Remove %v wanted %v", reqRemove, "token")
-	}
+	require.NoError(t, err)
+	require.Len(t, vs.Spec.Http, 1)
+	assert.Equal(t, "15000", vs.Spec.Http[0].Headers.Request.Add["x-envoy-upstream-rq-timeout-ms"])
+	assert.Equal(t, "test", vs.Spec.Http[0].Headers.Request.Remove[0])
+	assert.Equal(t, "token", vs.Spec.Http[0].Headers.Response.Remove[0])
 }
 
 func TestIstioRouter_CORS(t *testing.T) {
@@ -361,27 +242,14 @@ func TestIstioRouter_CORS(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(vs.Spec.Http) != 1 {
-		t.Fatalf("Got HTTPRoute %v wanted %v", len(vs.Spec.Http), 1)
-	}
-
-	if vs.Spec.Http[0].CorsPolicy == nil {
-		t.Fatal("Got not CORS policy")
-	}
-
-	methods := vs.Spec.Http[0].CorsPolicy.AllowMethods
-	if len(methods) != 2 {
-		t.Fatalf("Got CORS allow methods %v wanted %v", len(methods), 2)
-	}
+	require.NoError(t, err)
+	require.NoError(t, err)
+	require.Len(t, vs.Spec.Http, 1)
+	assert.NotNil(t, vs.Spec.Http[0].CorsPolicy)
+	assert.Len(t, vs.Spec.Http[0].CorsPolicy.AllowMethods, 2)
 }
 
 func TestIstioRouter_ABTest(t *testing.T) {
@@ -394,33 +262,22 @@ func TestIstioRouter_ABTest(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.abtest)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test insert
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("abtest", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if len(vs.Spec.Http) != 2 {
-		t.Errorf("Got Istio VS Http %v wanted %v", len(vs.Spec.Http), 2)
-	}
+	require.NoError(t, err)
+	assert.Len(t, vs.Spec.Http, 2)
 
 	p := 0
 	c := 100
 	m := false
 
 	err = router.SetRoutes(mocks.abtest, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err = mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("abtest", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	pHost := fmt.Sprintf("%s-primary", mocks.abtest.Spec.TargetRef.Name)
 	cHost := fmt.Sprintf("%s-canary", mocks.abtest.Spec.TargetRef.Name)
@@ -440,17 +297,9 @@ func TestIstioRouter_ABTest(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight != p {
-		t.Errorf("Got primary weight %v wanted %v", pRoute.Weight, p)
-	}
-
-	if cRoute.Weight != c {
-		t.Errorf("Got canary weight %v wanted %v", cRoute.Weight, c)
-	}
-
-	if mirror != nil {
-		t.Errorf("Got mirror %v wanted nil", mirror)
-	}
+	assert.Equal(t, p, pRoute.Weight)
+	assert.Equal(t, c, cRoute.Weight)
+	assert.Nil(t, mirror)
 }
 
 func TestIstioRouter_GatewayPort(t *testing.T) {
@@ -463,17 +312,11 @@ func TestIstioRouter_GatewayPort(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	vs, err := mocks.meshClient.NetworkingV1alpha3().VirtualServices("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	port := vs.Spec.Http[0].Route[0].Destination.Port.Number
-	if port != uint32(mocks.canary.Spec.Service.Port) {
-		t.Fatalf("Got port %v wanted %v", port, mocks.canary.Spec.Service.Port)
-	}
+	assert.Equal(t, uint32(mocks.canary.Spec.Service.Port), port)
 }
diff --git a/pkg/router/kubernetes_deployment_test.go b/pkg/router/kubernetes_deployment_test.go
index 3cea7370..faf0b516 100644
--- a/pkg/router/kubernetes_deployment_test.go
+++ b/pkg/router/kubernetes_deployment_test.go
@@ -3,6 +3,9 @@ package router
 import (
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
@@ -15,40 +18,21 @@ func TestServiceRouter_Create(t *testing.T) {
 	}
 
 	err := router.Initialize(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
-	if canarySvc.Spec.Ports[0].Name != "http" {
-		t.Errorf("Got svc port name %s wanted %s", canarySvc.Spec.Ports[0].Name, "http")
-	}
-
-	if canarySvc.Spec.Ports[0].Port != 9898 {
-		t.Errorf("Got svc port %v wanted %v", canarySvc.Spec.Ports[0].Port, 9898)
-	}
+	assert.Equal(t, "http", canarySvc.Spec.Ports[0].Name)
+	assert.Equal(t, int32(9898), canarySvc.Spec.Ports[0].Port)
 
 	primarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-primary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if primarySvc.Spec.Ports[0].Name != "http" {
-		t.Errorf("Got primary svc port name %s wanted %s", primarySvc.Spec.Ports[0].Name, "http")
-	}
-
-	if primarySvc.Spec.Ports[0].Port != 9898 {
-		t.Errorf("Got primary svc port %v wanted %v", primarySvc.Spec.Ports[0].Port, 9898)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "http", primarySvc.Spec.Ports[0].Name)
+	assert.Equal(t, int32(9898), primarySvc.Spec.Ports[0].Port)
 }
 
 func TestServiceRouter_Update(t *testing.T) {
@@ -60,46 +44,29 @@ func TestServiceRouter_Update(t *testing.T) {
 	}
 
 	err := router.Initialize(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canary, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canaryClone := canary.DeepCopy()
 	canaryClone.Spec.Service.PortName = "grpc"
 
 	c, err := mocks.flaggerClient.FlaggerV1beta1().Canaries("default").Update(canaryClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// apply changes
 	err = router.Initialize(c)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	err = router.Reconcile(c)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if canarySvc.Spec.Ports[0].Name != "grpc" {
-		t.Errorf("Got svc port name %s wanted %s", canarySvc.Spec.Ports[0].Name, "grpc")
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "grpc", canarySvc.Spec.Ports[0].Name)
 }
 
 func TestServiceRouter_Undo(t *testing.T) {
@@ -111,49 +78,29 @@ func TestServiceRouter_Undo(t *testing.T) {
 	}
 
 	err := router.Initialize(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canarySvc, err := mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	svcClone := canarySvc.DeepCopy()
 	svcClone.Spec.Ports[0].Name = "http2-podinfo"
 	svcClone.Spec.Ports[0].Port = 8080
 
 	_, err = mocks.kubeClient.CoreV1().Services("default").Update(svcClone)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// undo changes
 	err = router.Initialize(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	err = router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	canarySvc, err = mocks.kubeClient.CoreV1().Services("default").Get("podinfo-canary", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if canarySvc.Spec.Ports[0].Name != "http" {
-		t.Errorf("Got svc port name %s wanted %s", canarySvc.Spec.Ports[0].Name, "http")
-	}
-
-	if canarySvc.Spec.Ports[0].Port != 9898 {
-		t.Errorf("Got svc port %v wanted %v", canarySvc.Spec.Ports[0].Port, 9898)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, "http", canarySvc.Spec.Ports[0].Name)
+	assert.Equal(t, int32(9898), canarySvc.Spec.Ports[0].Port)
 }
diff --git a/pkg/router/smi_test.go b/pkg/router/smi_test.go
index 73a1a665..f73ab8ab 100644
--- a/pkg/router/smi_test.go
+++ b/pkg/router/smi_test.go
@@ -4,6 +4,8 @@ import (
 	"strconv"
 	"testing"
 
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
 	smiv1 "github.com/weaveworks/flagger/pkg/apis/smi/v1alpha1"
@@ -20,25 +22,16 @@ func TestSmiRouter_Sync(t *testing.T) {
 	}
 
 	err := router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	// test insert
 	ts, err := router.smiClient.SplitV1alpha1().TrafficSplits("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 	dests := ts.Spec.Backends
-	if len(dests) != 2 {
-		t.Errorf("Got backends %v wanted %v", len(dests), 2)
-	}
+	assert.Len(t, dests, 2)
 
 	apexName, primaryName, canaryName := canary.GetServiceNames()
-
-	if ts.Spec.Service != apexName {
-		t.Errorf("Got service %v wanted %v", ts.Spec.Service, apexName)
-	}
+	assert.Equal(t, ts.Spec.Service, apexName)
 
 	var pRoute smiv1.TrafficSplitBackend
 	var cRoute smiv1.TrafficSplitBackend
@@ -51,30 +44,19 @@ func TestSmiRouter_Sync(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight.String() != strconv.Itoa(100) {
-		t.Errorf("%s weight is %v wanted 100", pRoute.Service, pRoute.Weight)
-	}
-	if cRoute.Weight.String() != strconv.Itoa(0) {
-		t.Errorf("%s weight is %v wanted 0", cRoute.Service, cRoute.Weight)
-	}
+	assert.Equal(t, strconv.Itoa(100), pRoute.Weight.String())
+	assert.Equal(t, strconv.Itoa(0), cRoute.Weight.String())
 
 	// test update
 	host := "test"
 	canary.Spec.Service.Name = host
 
 	err = router.Reconcile(canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	ts, err = router.smiClient.SplitV1alpha1().TrafficSplits("default").Get("test", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if ts.Spec.Service != host {
-		t.Errorf("Got service %v wanted %v", ts.Spec.Service, host)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, host, ts.Spec.Service)
 }
 
 func TestSmiRouter_SetRoutes(t *testing.T) {
@@ -88,28 +70,20 @@ func TestSmiRouter_SetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p = 50
 	c = 50
 	m = false
 
 	err = router.SetRoutes(mocks.canary, p, c, m)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	ts, err := router.smiClient.SplitV1alpha1().TrafficSplits("default").Get("podinfo", metav1.GetOptions{})
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	var pRoute smiv1.TrafficSplitBackend
 	var cRoute smiv1.TrafficSplitBackend
@@ -124,14 +98,8 @@ func TestSmiRouter_SetRoutes(t *testing.T) {
 		}
 	}
 
-	if pRoute.Weight.String() != strconv.Itoa(p) {
-		t.Errorf("Got primary weight %v wanted %v", pRoute.Weight, p)
-	}
-
-	if cRoute.Weight.String() != strconv.Itoa(c) {
-		t.Errorf("Got canary weight %v wanted %v", cRoute.Weight, c)
-	}
-
+	assert.Equal(t, strconv.Itoa(p), pRoute.Weight.String())
+	assert.Equal(t, strconv.Itoa(c), cRoute.Weight.String())
 }
 
 func TestSmiRouter_GetRoutes(t *testing.T) {
@@ -144,24 +112,11 @@ func TestSmiRouter_GetRoutes(t *testing.T) {
 	}
 
 	err := router.Reconcile(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
+	require.NoError(t, err)
 
 	p, c, m, err := router.GetRoutes(mocks.canary)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-
-	if p != 100 {
-		t.Errorf("Got primary weight %v wanted %v", p, 100)
-	}
-
-	if c != 0 {
-		t.Errorf("Got canary weight %v wanted %v", c, 0)
-	}
-
-	if m != false {
-		t.Errorf("Got mirror %v wanted %v", m, false)
-	}
+	require.NoError(t, err)
+	assert.Equal(t, 100, p)
+	assert.Equal(t, 0, c)
+	assert.False(t, m)
 }