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

ACL token passing integration test #272

Merged
merged 1 commit into from
Oct 17, 2017
Merged

ACL token passing integration test #272

merged 1 commit into from
Oct 17, 2017

Conversation

chemicL
Copy link
Contributor

@chemicL chemicL commented Oct 17, 2017

The ACL token passing has been carried over from the forked project, but it had no tests.
I added an integration test, which proves the functionality works as expected.

@janisz
Copy link
Contributor

janisz commented Oct 17, 2017

--- FAIL: TestACLTokenPassing (2.06s)
	Error Trace:	consul_test.go:1106
	Error:		"[%!s(*service.Service=&{serviceA.0_serviceA_8080 serviceA [marathon test marathon-task:serviceA.0] 127.0.0.1 true})]" should have 0 item(s), but has 1
	Messages:	Reading services list without ACL token should yield empty response

https://travis-ci.org/allegro/marathon-consul/builds/289041586#L2073


server, err := testutil.NewTestServerConfig(func(c *testutil.TestServerConfig) {
c.Datacenter = fmt.Sprint("dc-", time.Now().UnixNano())
c.Ports = &testutil.TestPortConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you extract this to a fucntion that returns *testutil.TestPortConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -1057,3 +1057,51 @@ func Test_substituteEnvironment(t *testing.T) {
})
}
}

func TestACLTokenPassing(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Change name of this tests to define what happens here. e.g., TestIfTokenIsUsedToConnectToConsul

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to TestTokenIsUsedToConnectToConsul

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 90.267% when pulling a755249 on acl_token_test into 033c1a2 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 90.231% when pulling 659a702 on acl_token_test into 033c1a2 on master.

@janisz
Copy link
Contributor

janisz commented Oct 17, 2017

@chemicL Thanks a lot

@janisz janisz merged commit 9443d96 into master Oct 17, 2017
@janisz janisz deleted the acl_token_test branch October 17, 2017 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants