Skip to content
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

Extend unit tests #165

Merged
merged 7 commits into from
Jul 7, 2022
Merged

Extend unit tests #165

merged 7 commits into from
Jul 7, 2022

Conversation

colmsnowplow
Copy link
Collaborator

This PR replaces #139, as it required a rebase and it was simple to just create a new PR.

Copy link
Contributor

@adatzer adatzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!
The comments are mostly nitty, other than that looks great to me!

Side note given we are on testing: would we rename transform_test_variables.go to transform_variables_test.go to follow the test suffix convention?

.github/workflows/cd.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@@ -13,6 +13,12 @@ import (
"github.com/stretchr/testify/assert"
)

func TestMain(m *testing.M) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I didn't know of TestMain!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credit goes to Robert for this one

go.sum Show resolved Hide resolved
pkg/target/pubsub_test.go Outdated Show resolved Hide resolved
pkg/testutil/source_helpers.go Show resolved Hide resolved
pkg/testutil/pubsub_helpers.go Outdated Show resolved Hide resolved
pkg/target/pubsub_test.go Outdated Show resolved Hide resolved
pkg/source/pubsub/pubsub_source_test.go Show resolved Hide resolved
@colmsnowplow
Copy link
Collaborator Author

Thanks @adatzer you've pointed out some useful things here. Going to take another pass at them tomorrow and see if I can improve this PR a bit.

Side note given we are on testing: would we rename transform_test_variables.go to transform_variables_test.go to follow the test suffix convention?

I think I initially did it that way as it's not testing a file named variables, it's a set of variables for tests. But I dunno if that actually makes any sense - I'll think about it after I address the comments.

@colmsnowplow
Copy link
Collaborator Author

Thanks for very useful comments @adatzer - I'm a lot happier with the state of affairs now.

I think I've addressed everything now, should be ready for another pass.

Copy link
Contributor

@adatzer adatzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR! Incredible work!

if err == nil {
t.Fatalf("expected error, got nil")
}
assert.NotNil(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - can we use the new if err != nil pattern here as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks like I missed a few like this. Fixing

@colmsnowplow colmsnowplow merged commit d3c35c2 into release/1.0.0 Jul 7, 2022
@colmsnowplow colmsnowplow deleted the extend-unit-tests branch July 7, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants