Skip to content

Commit 1bd36cd

Browse files
committed
Fix tests
1 parent 1d79ef3 commit 1bd36cd

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

rust/operator-binary/src/config/jvm.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub enum Error {
2323
/// JVM arguments that go into
2424
/// 1.`spark.driver.extraJavaOptions`
2525
/// 2. `spark.executor.extraJavaOptions`
26-
2726
pub fn construct_extra_java_options(
2827
spark_application: &SparkApplication,
2928
s3_conn: &Option<S3ConnectionSpec>,
@@ -40,7 +39,7 @@ pub fn construct_extra_java_options(
4039
jvm_args.extend([
4140
format!("-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}/truststore.p12"),
4241
format!("-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}"),
43-
format!("-Djavax.net.ssl.trustStoreType=pkcs12"),
42+
"-Djavax.net.ssl.trustStoreType=pkcs12".to_string(),
4443
]);
4544
}
4645

@@ -71,15 +70,13 @@ pub fn construct_extra_java_options(
7170
.context(MergeJvmArgumentOverridesSnafu)?;
7271

7372
Ok((
74-
from_driver.effective_jvm_config_after_merging().join("\n"),
73+
from_driver.effective_jvm_config_after_merging().join(" "),
7574
from_executor.effective_jvm_config_after_merging().join(" "),
7675
))
7776
}
7877

7978
#[cfg(test)]
8079
mod tests {
81-
use indoc::indoc;
82-
8380
use super::*;
8481

8582
#[test]
@@ -144,9 +141,7 @@ mod tests {
144141

145142
assert_eq!(
146143
driver_extra_java_options,
147-
indoc! {"
148-
-Djava.security.properties=/stackable/log_config/security.properties
149-
-Dhttps.proxyHost=from-driver"}
144+
"-Djava.security.properties=/stackable/log_config/security.properties -Dhttps.proxyHost=from-driver"
150145
);
151146
assert_eq!(
152147
executor_extra_java_options,

rust/operator-binary/src/crd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl v1alpha1::SparkApplication {
518518
&'a self,
519519
app_version: &'a str,
520520
role: &'a str,
521-
) -> ObjectLabels<v1alpha1::SparkApplication> {
521+
) -> ObjectLabels<'a, v1alpha1::SparkApplication> {
522522
ObjectLabels {
523523
owner: self,
524524
app_name: APP_NAME,
@@ -590,7 +590,7 @@ impl v1alpha1::SparkApplication {
590590
}
591591

592592
let (driver_extra_java_options, executor_extra_java_options) =
593-
construct_extra_java_options(&self, s3conn, log_dir)
593+
construct_extra_java_options(self, s3conn, log_dir)
594594
.context(ConstructJvmArgumentsSnafu)?;
595595
submit_cmd.extend(vec![
596596
format!("--conf spark.driver.extraJavaOptions=\"{driver_extra_java_options}\""),

rust/operator-binary/src/history/config/jvm.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ pub fn construct_history_jvm_args(
5353

5454
#[cfg(test)]
5555
mod tests {
56-
use indoc::indoc;
57-
5856
use super::*;
5957
use crate::crd::history::v1alpha1::SparkHistoryServer;
6058

@@ -85,10 +83,9 @@ mod tests {
8583

8684
assert_eq!(
8785
jvm_config,
88-
indoc! {"
89-
-Dlog4j.configurationFile=/stackable/log_config/log4j2.properties
90-
-Djava.security.properties=/stackable/spark/conf/security.properties
91-
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=18081:/stackable/jmx/config.yaml"}
86+
"-Dlog4j.configurationFile=/stackable/log_config/log4j2.properties \
87+
-Djava.security.properties=/stackable/spark/conf/security.properties \
88+
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=18081:/stackable/jmx/config.yaml"
9289
);
9390
}
9491

@@ -129,13 +126,12 @@ mod tests {
129126

130127
assert_eq!(
131128
jvm_config,
132-
indoc! {"
133-
-Dlog4j.configurationFile=/stackable/log_config/log4j2.properties
134-
-Djava.security.properties=/stackable/spark/conf/security.properties
135-
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=18081:/stackable/jmx/config.yaml
136-
-Dhttps.proxyHost=proxy.my.corp
137-
-Djava.net.preferIPv4Stack=true
138-
-Dhttps.proxyPort=1234"}
129+
"-Dlog4j.configurationFile=/stackable/log_config/log4j2.properties \
130+
-Djava.security.properties=/stackable/spark/conf/security.properties \
131+
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=18081:/stackable/jmx/config.yaml \
132+
-Dhttps.proxyHost=proxy.my.corp \
133+
-Djava.net.preferIPv4Stack=true \
134+
-Dhttps.proxyPort=1234"
139135
);
140136
}
141137

0 commit comments

Comments
 (0)