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

proto: Make test run in bazel #3073

Merged
merged 2 commits into from
Aug 30, 2019
Merged

Conversation

oncilla
Copy link
Contributor

@oncilla oncilla commented Aug 30, 2019

This change is Reviewable

@oncilla oncilla added this to the Q3S3 milestone Aug 30, 2019
@oncilla oncilla requested a review from karampok August 30, 2019 14:31
Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r1.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @karampok and @oncilla)


go/proto/cereal_test.go, line 51 at r1 (raw file):

			wrapped := func() {
				err := ParseFromRaw(&asEntry{}, asEntry{}.Pack(t))
				test.Assertion(t, err)

Is the test.Assertion suppose to be checked after the panic?


go/proto/cereal_test.go, line 92 at r1 (raw file):

type asEntry struct{}

func (a asEntry) Pack(t *testing.T) []byte {

There is no reason to be a method right? Can be a function and maybe included within the test

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @oncilla)


go/proto/cereal_test.go, line 31 at r1 (raw file):

	tests := map[string]struct {
		Extractor func(val interface{}, typeID uint64, s capnp.Struct) error
		Assertion assert.ErrorAssertionFunc

why switch to assert?

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @karampok)


go/proto/cereal_test.go, line 31 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

why switch to assert?

Does not really matter.
Undone.


go/proto/cereal_test.go, line 51 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

Is the test.Assertion suppose to be checked after the panic?

Ordering does not matter.
If there is a panic, catching a wrong error does not matter.
If we do not panic. a wrong error is caught.


go/proto/cereal_test.go, line 92 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

There is no reason to be a method right? Can be a function and maybe included within the test

Done.

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @karampok and @oncilla)


go/proto/cereal_test.go, line 51 at r1 (raw file):

Previously, Oncilla wrote…

Ordering does not matter.
If there is a panic, catching a wrong error does not matter.
If we do not panic. a wrong error is caught.

agree but for readability I think it is better to have something like

  1. does not panic
  2. there is an error so I should check

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @karampok)


go/proto/cereal_test.go, line 51 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

agree but for readability I think it is better to have something like

  1. does not panic
  2. there is an error so I should check

I think it is a trade-off.
e.g. then where the error is set becomes less obvious.

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @karampok)

Copy link
Contributor

@karampok karampok left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@oncilla oncilla merged commit 3d73917 into scionproto:master Aug 30, 2019
@oncilla oncilla deleted the pub-fix-proto-test branch August 30, 2019 15:09
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