-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daemon(deployment): integrate slack config (#661)
* chore: fix counterfeiter runner * daemon(notify): add equality checker
- Loading branch information
Showing
12 changed files
with
199 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package notify | ||
|
||
import "testing" | ||
|
||
func TestNotifiers_Exists(t *testing.T) { | ||
type args struct { | ||
nt Notifier | ||
} | ||
tests := []struct { | ||
name string | ||
n Notifiers | ||
args args | ||
want bool | ||
}{ | ||
{"ok: exists", Notifiers{&SlackNotifier{"abcde"}}, args{&SlackNotifier{"abcde"}}, true}, | ||
{"not ok: no notifiers", Notifiers{}, args{&SlackNotifier{"abcde"}}, false}, | ||
{"not ok: doesnt exist", Notifiers{&SlackNotifier{"robert"}}, args{&SlackNotifier{"abcde"}}, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := tt.n.Exists(tt.args.nt); got != tt.want { | ||
t.Errorf("Notifiers.Exists() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package notify | ||
|
||
import "testing" | ||
|
||
func TestSlackNotifier_IsEqual(t *testing.T) { | ||
type fields struct { | ||
hookURL string | ||
} | ||
type args struct { | ||
nt Notifier | ||
} | ||
tests := []struct { | ||
name string | ||
fields fields | ||
args args | ||
want bool | ||
}{ | ||
{"ok: same hook url", fields{"abcde"}, args{&SlackNotifier{"abcde"}}, true}, | ||
{"not ok: diff hook url", fields{"robert"}, args{&SlackNotifier{"abcde"}}, false}, | ||
{"not ok: not slack notifier", fields{"robert"}, args{nil}, false}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
n := &SlackNotifier{ | ||
hookURL: tt.fields.hookURL, | ||
} | ||
if got := n.IsEqual(tt.args.nt); got != tt.want { | ||
t.Errorf("SlackNotifier.IsEqual() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters