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

KNOX-1996: Adding changes to remove extra / while generating backedn … #142

Merged
merged 5 commits into from Oct 1, 2019

Conversation

goelrajat
Copy link
Contributor

KNOX-1996: Adding changes to remove extra / while generating backend url. Additionally, proxy messages to websocket even if service uri has http/https protocol

*
* @since 0.10
*/
public class WebsocketEcho1Test {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a whole other test class here? Can't the new test case just be added to the existing WebsocketEchoTest?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please try add the test to existing class, testing WS is expensive.

Copy link
Contributor Author

@goelrajat goelrajat Sep 9, 2019

Choose a reason for hiding this comment

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

@moresandeep Need some help here on how this can be done. In the new test case class, all I have changed the backendServerUri to 'http' instead of 'ws' (line 198). This will generate service role with protocol as 'http'. How can I merge this with existing WebsocketEchoTest ? Service role definition are different here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@goelrajat I think at minimum should be a base test class and then specify the prefix to use for the tests in the actual test class? That would avoid copying all the tests. I didn't look too closely but might also be possible to do something similar with randomizing http vs ws. Or use JUnit parameterized test.

*
* @since 0.10
*/
public class WebsocketEcho1Test {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please try add the test to existing class, testing WS is expensive.

@goelrajat
Copy link
Contributor Author

Any update on whether this PR can be merged or something additional needs to be done.

Copy link
Contributor

@risdenk risdenk left a comment

Choose a reason for hiding this comment

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

Changes look a lot better - only thing that I think needs a second look is the duplicated test. Left a specific comment on that.

*
* @since 0.10
*/
public class WebsocketEcho1Test {
Copy link
Contributor

Choose a reason for hiding this comment

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

@goelrajat I think at minimum should be a base test class and then specify the prefix to use for the tests in the actual test class? That would avoid copying all the tests. I didn't look too closely but might also be possible to do something similar with randomizing http vs ws. Or use JUnit parameterized test.

@goelrajat
Copy link
Contributor Author

goelrajat commented Sep 20, 2019

Thanks @risdenk for the comments. I have refactored the code with a Base test class. I had a quick look at how to implement Junit Parameterized test. In my case, I need to parameterize setting up of Gateway config role and starting of Gateway Server which would be done repeatedly for both the test cases so not much performance gain in terms of test case execution. Please check.

Copy link
Contributor

@risdenk risdenk left a comment

Choose a reason for hiding this comment

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

Looks good to me. @moresandeep any other thoughts?

Copy link
Contributor

@moresandeep moresandeep left a comment

Choose a reason for hiding this comment

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

@goelrajat thank you for your patience and apologies for the delay. The changes look good, I am requesting couple of changes on the UnitTest, one of them is basically a test for the case where addition / is getting added when the service does not end with /ws Thanks again !

@risdenk risdenk assigned moresandeep and unassigned risdenk Sep 25, 2019
rajat.goel added 4 commits September 27, 2019 18:20
…url. Additionally, proxy messages to websocket even if service uri has http/https protocol
@goelrajat
Copy link
Contributor Author

Test case changes have been done. Please check and merge.

Copy link
Contributor

@moresandeep moresandeep left a comment

Choose a reason for hiding this comment

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

Thanks for the quick turnaround. Looks like you are missing teardown() in one of the tests.

@moresandeep moresandeep merged commit 431dcd2 into apache:master Oct 1, 2019
@goelrajat goelrajat deleted the KNOX-1996 branch November 22, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants