Skip to content

Commit

Permalink
refactor: Rename 'gktest' to 'gator'
Browse files Browse the repository at this point in the history
Fixes #1722

Signed-off-by: Will Beason <willbeason@google.com>
  • Loading branch information
Will Beason committed Dec 13, 2021
1 parent 4deb1d4 commit 201c2fe
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions cmd/gator/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"runtime"
"strings"

"github.com/open-policy-agent/gatekeeper/pkg/gktest"
"github.com/open-policy-agent/gatekeeper/pkg/gator"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -89,27 +89,27 @@ func runE(cmd *cobra.Command, args []string) error {
}
targetPath = strings.Trim(targetPath, "/")

suites, err := gktest.ReadSuites(fileSystem, targetPath, recursive)
suites, err := gator.ReadSuites(fileSystem, targetPath, recursive)
if err != nil {
return fmt.Errorf("listing test files: %w", err)
}
filter, err := gktest.NewFilter(run)
filter, err := gator.NewFilter(run)
if err != nil {
return fmt.Errorf("compiling filter: %w", err)
}

return runSuites(cmd.Context(), fileSystem, suites, filter)
}

func runSuites(ctx context.Context, fileSystem fs.FS, suites []*gktest.Suite, filter gktest.Filter) error {
func runSuites(ctx context.Context, fileSystem fs.FS, suites []*gator.Suite, filter gator.Filter) error {
isFailure := false

runner, err := gktest.NewRunner(fileSystem, gktest.NewOPAClient)
runner, err := gator.NewRunner(fileSystem, gator.NewOPAClient)
if err != nil {
return err
}

results := make([]gktest.SuiteResult, len(suites))
results := make([]gator.SuiteResult, len(suites))
i := 0

for _, suite := range suites {
Expand All @@ -129,7 +129,7 @@ func runSuites(ctx context.Context, fileSystem fs.FS, suites []*gktest.Suite, fi
i++
}
w := &strings.Builder{}
printer := gktest.PrinterGo{}
printer := gator.PrinterGo{}
err = printer.Print(w, results, verbose)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/assertion.go β†’ pkg/gator/assertion.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/client.go β†’ pkg/gator/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/errors.go β†’ pkg/gator/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import "errors"

Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/filter.go β†’ pkg/gator/filter.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/filter_test.go β†’ pkg/gator/filter_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/intstr.go β†’ pkg/gator/intstr.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import "k8s.io/apimachinery/pkg/util/intstr"

Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/opa.go β†’ pkg/gator/opa.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
opaclient "github.com/open-policy-agent/frameworks/constraint/pkg/client"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/printer.go β†’ pkg/gator/printer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

// Printer knows how to print the results of running a Suite.
type Printer interface {
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/printer_go.go β†’ pkg/gator/printer_go.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"encoding/json"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/read_suites.go β†’ pkg/gator/read_suites.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"encoding/json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/result.go β†’ pkg/gator/result.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/runner.go β†’ pkg/gator/runner.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/runner_test.go β†’ pkg/gator/runner_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gktest/suite.go β†’ pkg/gator/suite.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gktest
package gator

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down

0 comments on commit 201c2fe

Please sign in to comment.