From f7abdf0b6bdcc3fb33b2e5128cfe1e9259d6b21c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 May 2021 05:09:53 +0000 Subject: [PATCH] chore(deps): bump github.com/ViBiOh/mailer from 1.16.8 to 1.16.9 Bumps [github.com/ViBiOh/mailer](https://github.com/ViBiOh/mailer) from 1.16.8 to 1.16.9. - [Release notes](https://github.com/ViBiOh/mailer/releases) - [Commits](https://github.com/ViBiOh/mailer/compare/v1.16.8...v1.16.9) Signed-off-by: dependabot[bot] Signed-off-by: Vincent Boutour --- go.mod | 2 +- go.sum | 4 ++-- pkg/notifier/releases_test.go | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 7eb06e6e..0fef4af9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/ViBiOh/auth/v2 v2.7.0 github.com/ViBiOh/httputils/v4 v4.8.0 - github.com/ViBiOh/mailer v1.16.8 + github.com/ViBiOh/mailer v1.16.9 github.com/lib/pq v1.10.1 github.com/prometheus/client_golang v1.10.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b diff --git a/go.sum b/go.sum index 45a6b7db..28259a99 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/ViBiOh/auth/v2 v2.7.0 h1:hR7D7hGt9UEiIuqZBaWRoIv+9uCjcAgxj97il9WWxGE= github.com/ViBiOh/auth/v2 v2.7.0/go.mod h1:ai96/8BXLiV7t748W7AVDANbmrM0QTNDsPOVZKPLYvk= github.com/ViBiOh/httputils/v4 v4.8.0 h1:fs2fjkBnmElYyPbM5vqDz00SyJsomUmKQIwTxSLw+kM= github.com/ViBiOh/httputils/v4 v4.8.0/go.mod h1:1hyt/nMC1kLiB9sm+qfHaQY9TIxS7gcUQZTV0DZ/nwc= -github.com/ViBiOh/mailer v1.16.8 h1:rh8aCCwO5mx6ktLeEwsrsPwF2eJeq8FATCqQst4FNIk= -github.com/ViBiOh/mailer v1.16.8/go.mod h1:cSP0mW1oTyvYIHH+FS1C7ip419BGEnkN7xOmoQ7HHvs= +github.com/ViBiOh/mailer v1.16.9 h1:7Bjl7Zp0FOsT3W8PeR6zQTsSqFf+101jr/Dv3lLUzRA= +github.com/ViBiOh/mailer v1.16.9/go.mod h1:cSP0mW1oTyvYIHH+FS1C7ip419BGEnkN7xOmoQ7HHvs= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/notifier/releases_test.go b/pkg/notifier/releases_test.go index 4dbe6a34..e141635d 100644 --- a/pkg/notifier/releases_test.go +++ b/pkg/notifier/releases_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "reflect" + "sort" "strings" "testing" @@ -113,6 +114,11 @@ func TestGetNewGithubReleases(t *testing.T) { } func TestGetNewHelmReleases(t *testing.T) { + appRepo := model.NewHelmRepository(1, "https://charts.vibioh.fr", "app").AddVersion(model.DefaultPattern, "1.0.0").AddVersion("1.0", "1.0.0").AddVersion("~1.0", "a.b.c") + cronRepo := model.NewHelmRepository(2, "https://charts.vibioh.fr", "cron").AddVersion(model.DefaultPattern, "1.0.0") + fluxRepo := model.NewHelmRepository(3, "https://charts.vibioh.fr", "flux").AddVersion(model.DefaultPattern, "1.0.0") + postgresRepo := model.NewHelmRepository(4, "https://charts.helm.sh/stable", "postgreql").AddVersion(model.DefaultPattern, "3.0.0") + type args struct { content string } @@ -173,10 +179,10 @@ func TestGetNewHelmReleases(t *testing.T) { "helm", app{ repositoryService: repositorytest.New().SetListByKind([]model.Repository{ - model.NewHelmRepository(1, "https://charts.vibioh.fr", "app").AddVersion(model.DefaultPattern, "1.0.0").AddVersion("1.0", "1.0.0").AddVersion("~1.0", "a.b.c"), - model.NewHelmRepository(1, "https://charts.vibioh.fr", "cron").AddVersion(model.DefaultPattern, "1.0.0"), - model.NewHelmRepository(1, "https://charts.vibioh.fr", "flux").AddVersion(model.DefaultPattern, "1.0.0"), - model.NewHelmRepository(1, "https://charts.helm.sh/stable", "postgreql").AddVersion(model.DefaultPattern, "3.0.0"), + appRepo, + cronRepo, + fluxRepo, + postgresRepo, }, 0, nil), helmApp: helmtest.New().SetFetchIndex(map[string]map[string]semver.Version{ "app": { @@ -197,9 +203,9 @@ func TestGetNewHelmReleases(t *testing.T) { content: "test", }, []model.Release{ - model.NewRelease(model.NewHelmRepository(1, "https://charts.vibioh.fr", "app").AddVersion(model.DefaultPattern, "1.0.0").AddVersion("1.0", "1.0.0").AddVersion("~1.0", "a.b.c"), model.DefaultPattern, safeParse("1.1.0")), - model.NewRelease(model.NewHelmRepository(1, "https://charts.vibioh.fr", "cron").AddVersion(model.DefaultPattern, "1.0.0"), model.DefaultPattern, safeParse("2.0.0")), - model.NewRelease(model.NewHelmRepository(1, "https://charts.helm.sh/stable", "postgreql").AddVersion(model.DefaultPattern, "3.0.0"), model.DefaultPattern, safeParse("3.1.0")), + model.NewRelease(appRepo, model.DefaultPattern, safeParse("1.1.0")), + model.NewRelease(cronRepo, model.DefaultPattern, safeParse("2.0.0")), + model.NewRelease(postgresRepo, model.DefaultPattern, safeParse("3.1.0")), }, 4, nil, @@ -212,6 +218,8 @@ func TestGetNewHelmReleases(t *testing.T) { failed := false + sort.Sort(model.ReleaseByRepositoryID(got)) + if tc.wantErr == nil && gotErr != nil { failed = true } else if tc.wantErr != nil && gotErr == nil {