Skip to content

Commit

Permalink
Make tests more flexible
Browse files Browse the repository at this point in the history
Refactor tests so that:

- it is possible to specify rego and libraries per-test
- all tests use their own Client
- the Probe type is no longer necessary

Signed-off-by: Will Beason <willbeason@google.com>
  • Loading branch information
Will Beason committed Nov 11, 2021
1 parent 8b4a99a commit 003d780
Show file tree
Hide file tree
Showing 4 changed files with 692 additions and 711 deletions.
15 changes: 0 additions & 15 deletions constraint/pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ import (

const badRego = `asd{`

func TestClientE2E(t *testing.T) {
d := local.New()
p, err := NewProbe(d)
if err != nil {
t.Fatal(err)
}
for name, f := range p.TestFuncs() {
t.Run(name, func(t *testing.T) {
if err := f(); err != nil {
t.Fatal(err)
}
})
}
}

var _ TargetHandler = &badHandler{}

type badHandler struct {
Expand Down
Loading

0 comments on commit 003d780

Please sign in to comment.