Skip to content

Commit a3a78ee

Browse files
committed
compliance/tests: don't hardcode the test name
When migrating to bazel, the test will be named `tests_test`, which causes it to fail while it expects `tests.test` No functional change, this is plain preparatory work
1 parent f928a47 commit a3a78ee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/compliance/tests/process_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ has_key(o, k) {
4747
}
4848
4949
valid(p) {
50-
p.name = "tests.test"
50+
p.name = "%s"
5151
has_key(p, "cmdLine")
5252
has_key(p, "envs")
5353
has_key(p, "exe")
@@ -64,7 +64,7 @@ findings[f] {
6464
{}
6565
)
6666
}
67-
`).
67+
`, self).
6868
AssertPassedEvent(func(t *testing.T, evt *compliance.CheckEvent) {
6969
assert.Equal(t, "Self", evt.RuleID)
7070
assert.Equal(t, 0, evt.RuleVersion)
@@ -92,7 +92,7 @@ has_key(o, k) {
9292
}
9393
9494
valid(p) {
95-
p.name == "tests.test"
95+
p.name == "%s"
9696
has_key(p, "cmdLine")
9797
has_key(p, "envs")
9898
has_key(p, "exe")
@@ -120,7 +120,7 @@ findings[f] {
120120
{"name": proc.name},
121121
)
122122
}
123-
`).
123+
`, self).
124124
AssertPassedEvent(func(t *testing.T, evt *compliance.CheckEvent) {
125125
assert.Equal(t, "SelfDuplicated", evt.RuleID)
126126
assert.Equal(t, 0, evt.RuleVersion)

0 commit comments

Comments
 (0)