about summary refs log tree commit diff
path: root/fun/clbot/clbot_test.go
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2024-05-13T15·54+0200
committerProfpatsch <mail@profpatsch.de>2024-06-03T19·35+0000
commit9559ef56e3935618d63bc7b96136ec06db7e9bec (patch)
tree2fd9184b8e49f5f07c83fc89b0fb7388af524b39 /fun/clbot/clbot_test.go
parent1b39d5868adb93175202353b910789f323e63ce1 (diff)
feat(fun/clbot,ops/machines/whitby): filter tvix-dev clbot r/8212
In #tvix-dev, we want to display only CLs that relate to tvix and
related projects.

So use a pretty dumb allow-list for which CLs to display in that
channel.

Change-Id: I3ef50b64e3d7fbc27a6690be6a10f1b55c04cd6e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11658
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'fun/clbot/clbot_test.go')
-rw-r--r--fun/clbot/clbot_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/fun/clbot/clbot_test.go b/fun/clbot/clbot_test.go
new file mode 100644
index 000000000000..567540c364f7
--- /dev/null
+++ b/fun/clbot/clbot_test.go
@@ -0,0 +1,24 @@
+package main
+
+import (
+	"testing"
+)
+
+func TestChangeShouldBeSkipped(t *testing.T) {
+	dontSkipAny := ""
+	if changeShouldBeSkipped(dontSkipAny, "mysubject") {
+		t.Fatal("dontSkipAny should not not be skip any")
+	}
+
+	showThese := "A,B"
+	if changeShouldBeSkipped(showThese, "A") {
+		t.Fatal("A should be shown")
+	}
+	if changeShouldBeSkipped(showThese, "B") {
+		t.Fatal("B should be shown")
+	}
+	if !changeShouldBeSkipped(showThese, "C") {
+		t.Fatal("C should not be shown")
+	}
+
+}