-
Notifications
You must be signed in to change notification settings - Fork 43
Migrates cmd tests from ginkgo,gomega to testing,testify #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -250,8 +210,8 @@ func requireExtensionClean(t *testing.T, workDir string) { | |||
err := os.Chdir(workDir) | |||
require.NoError(t, err, `error changing to directory: %v`, workDir) | |||
|
|||
cmd := getEnvoy("extension clean") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these cmd -> c changes were mainly to help avoid clashing with the package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
||
// Package morerequire includes more require functions than "github.com/stretchr/testify/require" | ||
// Do not add dependencies on any main code as it will cause cycles. | ||
package morerequire |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stuff here is the same as it was, this is just pulled out to help reduce chance of package cycles
This completes migration of ./pkg/cmd/... from ginkgo,gomega to testing,testify per rationale noted in #130. This also fixes a bug where we accidentally added ignore files into the output directory of `getenvoy extension init` and backfills tests to ensure that doesn't happen again. Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Before, we added `.gitignore` files on `git extension init`. These assume the end-user would be checking the workspaces into git. However, the workspaces were neither initialized for git, nor the `.gitignore` files complete per-language. Moreover, certain directories are subject to variables, such as `CARGO_TARGET_DIR`. This removes the .gitignore file generation completely, and with it the duplication involved. If an end user is using our project, able to do `git init`, yet want us to manage `.gitignore` also, we can revisit upon such feedback later. Signed-off-by: Adrian Cole <[email protected]>
7aa5fa6
to
010f67b
Compare
Signed-off-by: Adrian Cole <[email protected]>
func() []TableEntry { | ||
entries := []TableEntry{} | ||
for _, category := range []string{"envoy.filters.http", "envoy.filters.network", "envoy.access_loggers"} { | ||
for _, language := range []string{"rust"} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, I didn't know that this is only tested for Rust, thanks
err = newParams().OutputDir.Validator(invalidPath) | ||
Expect(err).To(MatchError(fmt.Sprintf(`stat %s: not a directory`, invalidPath))) | ||
}) | ||
file := os.Args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super!
thanks! will address the feedback shortly |
Signed-off-by: Adrian Cole <[email protected]>
Thanks for another epic review @mathetake |
This completes migration of ./pkg/cmd/... from ginkgo,gomega to
testing,testify per rationale noted in #130.
This also fixes a bug where we accidentally added ignore files into
the output directory of
getenvoy extension init
and backfills teststo ensure that doesn't happen again.
elaboration on .gitignore and
getenvoy extension init
Before, we added
.gitignore
files ongetenvoy extension init
. Theseassume the end-user would be checking the workspaces into git. However,
the workspaces were neither initialized for git, nor the
.gitignore
files complete per-language. Moreover, certain directories are subject
to variables, such as
CARGO_TARGET_DIR
.This removes the .gitignore file generation completely, and with it the
duplication involved. If an end user is using our project, able to do
git init
, yet want us to manage.gitignore
also, we can revisit uponsuch feedback later.