From 5e4caa04f9f38346e92a69df7586811debb49e56 Mon Sep 17 00:00:00 2001 From: Thom Carlin Date: Thu, 7 Sep 2023 08:20:14 -0400 Subject: [PATCH] Removed references to testify package (#837) --- .github/workflows/pull_request.yml | 8 ++++++-- go.mod | 2 -- pkg/controlsvc/reload_test.go | 27 +++++++++++++++++++-------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3123c2607..b60ef1697 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,8 +1,8 @@ --- name: CI -on: - pull_request: +on: # yamllint disable-line rule:truthy + pull_request: # yamllint disable-line rule:empty-values jobs: lint-receptor: @@ -29,6 +29,8 @@ jobs: - name: Setup up python uses: actions/setup-python@v4 + with: + python-version: 3.9 - name: Install tox run: pip install tox @@ -149,6 +151,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 + with: + python-version: 3.9 - name: Install python dependencies run: pip install build diff --git a/go.mod b/go.mod index 17341186e..2d49890ba 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/quic-go/quic-go v0.34.0 github.com/rogpeppe/go-internal v1.10.0 github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 - github.com/stretchr/testify v1.8.1 github.com/vishvananda/netlink v1.1.0 golang.org/x/net v0.9.0 gopkg.in/yaml.v2 v2.4.0 @@ -51,7 +50,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/onsi/ginkgo/v2 v2.9.4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/quic-go/qtls-go1-19 v0.3.2 // indirect github.com/quic-go/qtls-go1-20 v0.2.2 // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/pkg/controlsvc/reload_test.go b/pkg/controlsvc/reload_test.go index 007b8adf6..606d48be7 100644 --- a/pkg/controlsvc/reload_test.go +++ b/pkg/controlsvc/reload_test.go @@ -2,8 +2,6 @@ package controlsvc import ( "testing" - - "github.com/stretchr/testify/assert" ) func TestReload(t *testing.T) { @@ -22,22 +20,35 @@ func TestReload(t *testing.T) { {filename: "reload_test_yml/successful_reload.yml", modifyError: false, absentError: false}, } err := parseConfigForReload("reload_test_yml/init.yml", false) - assert.NoError(t, err) - assert.Len(t, cfgNotReloadable, 5) + if err != nil { + t.Errorf("parseConfigForReload %s: Unexpected err: %v", "init.yml", err) + } + + if len(cfgNotReloadable) != 5 { + t.Errorf("cfNotReloadable length expected %d, got %d", 5, len(cfgNotReloadable)) + } for _, s := range scenarios { t.Logf("%s", s.filename) err = parseConfigForReload(s.filename, true) if s.modifyError { - assert.Error(t, err) + if err == nil { + t.Errorf("parseConfigForReload %s %s: Expected err, got %v", s.filename, "modifyError", err) + } } else { - assert.NoError(t, err) + if err != nil { + t.Errorf("parseConfigForReload %s %s: Unexpected err: %v", s.filename, "modifyError", err) + } } err = cfgAbsent() if s.absentError { - assert.Error(t, err) + if err == nil { + t.Errorf("parseConfigForReload %s %s: Expected err, got %v", s.filename, "absentError", err) + } } else { - assert.NoError(t, err) + if err != nil { + t.Errorf("parseConfigForReload %s %s: Unexpected err: %v", s.filename, "absentError", err) + } } } }