You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "elkhand (via GitHub)" <gi...@apache.org> on 2023/09/14 17:26:59 UTC
[GitHub] [flink] elkhand commented on a diff in pull request #23406: [FLINK-32884] [flink-clients] PyFlink remote execution should support URLs with paths and https scheme
elkhand commented on code in PR #23406:
URL: https://github.com/apache/flink/pull/23406#discussion_r1326304575
##########
flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java:
##########
@@ -46,6 +46,28 @@ void testCommandLineMaterialization() throws Exception {
assertThat(configuration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
assertThat(configuration.get(RestOptions.PORT)).isEqualTo(port);
+
+ final String httpProtocol = "http";
+ final String hostnameWithHttpScheme = httpProtocol + "://" + hostname;
+ final String[] httpArgs = {"-m", hostnameWithHttpScheme + ':' + port};
+ final CommandLine httpCommandLine = defaultCLI.parseCommandLineOptions(httpArgs, false);
+
+ Configuration newConfiguration = defaultCLI.toConfiguration(httpCommandLine);
+
+ assertThat(newConfiguration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
+ assertThat(newConfiguration.get(RestOptions.PORT)).isEqualTo(port);
+ assertThat(newConfiguration.get(RestOptions.PROTOCOL)).isEqualTo(httpProtocol);
+
+ final String httpsProtocol = "https";
+ final String hostnameWithHttpsScheme = httpsProtocol + "://" + hostname;
+ final String[] httpsArgs = {"-m", hostnameWithHttpsScheme + ':' + port};
+ final CommandLine httpsCommandLine = defaultCLI.parseCommandLineOptions(httpsArgs, false);
+
+ Configuration httpsConfiguration = defaultCLI.toConfiguration(httpsCommandLine);
+
+ assertThat(httpsConfiguration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
+ assertThat(httpsConfiguration.get(RestOptions.PORT)).isEqualTo(port);
+ assertThat(httpsConfiguration.get(RestOptions.PROTOCOL)).isEqualTo(httpsProtocol);
Review Comment:
Added, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org