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

godispatcher: remove convey #3358

Merged
merged 1 commit into from
Nov 14, 2019

Conversation

karampok
Copy link
Contributor

@karampok karampok commented Nov 12, 2019

Contributes #3016


This change is Reviewable

@karampok karampok requested a review from scrye November 12, 2019 08:54
@karampok karampok self-assigned this Nov 12, 2019
Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

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


go/godispatcher/internal/registration/iatable_test.go, line 35 at r1 (raw file):

func TestIATable(t *testing.T) {
	table := NewIATable(minPort, maxPort)

Move under each "parent" t.Run below, otherwise the tests interfere with one another.

In Goconvey this is not the case, because the top-level function runs again for each child Convey block, thus making "if the entry is only public" operate on a fresh table, and "if the entry is public and svc" on a different fresh table.


go/godispatcher/internal/registration/iatable_test.go, line 129 at r1 (raw file):

func TestIATableSCMPExistingRegistration(t *testing.T) {
	table := NewIATable(minPort, maxPort)

Same as above.


go/godispatcher/internal/registration/table_test.go, line 29 at r1 (raw file):

var dummyValue = "test value"

func TestRegister(t *testing.T) {

All the tests here share the same table, which would make investigation awkward if one of them breaks (because they are no longer independent).

I think a table driven test fits here instead, with each loop iteration creating a new table.


go/godispatcher/internal/registration/table_test.go, line 124 at r1 (raw file):

func TestRegisterOnlyPublic(t *testing.T) {
	table := NewTable(minPort, maxPort)

Same as in some previous comments, this should be local to the subtests to make them independent.


go/godispatcher/internal/registration/table_test.go, line 199 at r1 (raw file):

}

func TestRegisterWithBind(t *testing.T) {

You can delete this. Binds are never used and going away soon. It should probably be refactored into a table driven test, but it's not worth the effort at this point.

@karampok karampok force-pushed the pub-godispatcher-convey branch from 2f1efd2 to ae38b77 Compare November 14, 2019 09:29
Copy link
Contributor Author

@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, 5 unresolved discussions (waiting on @scrye)


go/godispatcher/internal/registration/iatable_test.go, line 35 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Move under each "parent" t.Run below, otherwise the tests interfere with one another.

In Goconvey this is not the case, because the top-level function runs again for each child Convey block, thus making "if the entry is only public" operate on a fresh table, and "if the entry is public and svc" on a different fresh table.

Done.


go/godispatcher/internal/registration/iatable_test.go, line 129 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Same as above.

Done.k


go/godispatcher/internal/registration/table_test.go, line 29 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

All the tests here share the same table, which would make investigation awkward if one of them breaks (because they are no longer independent).

I think a table driven test fits here instead, with each loop iteration creating a new table.

Done.


go/godispatcher/internal/registration/table_test.go, line 124 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Same as in some previous comments, this should be local to the subtests to make them independent.

Done.


go/godispatcher/internal/registration/table_test.go, line 199 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

You can delete this. Binds are never used and going away soon. It should probably be refactored into a table driven test, but it's not worth the effort at this point.

Is there an issue to remove everything around Binds?
I would suggest we let it until that story is implemented.

@scrye
Copy link
Contributor

scrye commented Nov 14, 2019


go/godispatcher/internal/registration/table_test.go, line 199 at r1 (raw file):

Previously, karampok (Konstantinos) wrote…

Is there an issue to remove everything around Binds?
I would suggest we let it until that story is implemented.

Fair enough, this can wait.

Copy link
Contributor

@scrye scrye 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: :shipit: complete! all files reviewed, all discussions resolved

@karampok karampok force-pushed the pub-godispatcher-convey branch from ae38b77 to 898ce85 Compare November 14, 2019 12:28
@karampok karampok force-pushed the pub-godispatcher-convey branch from 898ce85 to 389fb9a Compare November 14, 2019 13:15
@karampok karampok merged commit afda425 into scionproto:master Nov 14, 2019
@karampok karampok deleted the pub-godispatcher-convey branch November 14, 2019 14:11
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