File tree Expand file tree Collapse file tree
spark-test-common/src/main/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,11 +50,13 @@ GRADLE_USER_HOME=/data/.gradle ./gradlew :example:spark:dependencies \
5050 bundled Hadoop native libraries and prepends ` -Djava.library.path ` / ` -Dhadoop.home.dir ` to the
5151 Surefire ` argLine ` , so the native Hadoop code is used instead of the pure-Java fallback.
5252- ** [ java-dns] ( ../java-dns ) ` 0.1.1 ` ** — the agent jar (` org.openprojectx.java.dns:core ` ) is attached
53- to the Surefire JVM via ` -javaagent:…=hosts=fake-gcs/127.0.0.1 ` . This redirects the ` fake-gcs `
54- host to the local container, so the GCS connector can use the stable URL
55- ` http://fake-gcs:4443/ ` and the test ** no longer needs to read the dynamic GCS endpoint** . The
56- fake-gcs container is bound to the fixed host port ` 4443 ` via ` [ports] fakeGcs = 4443 ` in
57- ` spark-bigdata-test-common.toml ` so the redirected host: port lines up.
53+ to the Surefire JVM via ` -javaagent:…=hostsFile=${project.basedir}/dns.hosts ` . The
54+ [ ` dns.hosts ` ] ( spark-apache/dns.hosts ) file maps the bigdata-test container network aliases
55+ (` fake-gcs ` , ` hdfs ` ) to ` 127.0.0.1 ` , so the clients reach the local mapped containers without
56+ wiring per-run endpoints into the Spark session. In particular the GCS connector can use the
57+ stable URL ` http://fake-gcs:4443/ ` and the test ** no longer needs to read the dynamic GCS
58+ endpoint** . The fake-gcs container is bound to the fixed host port ` 4443 ` via
59+ ` [ports] fakeGcs = 4443 ` in ` spark-bigdata-test-common.toml ` so the redirected host: port lines up.
5860
5961## Prerequisites
6062
Original file line number Diff line number Diff line change 2424 <maven .compiler.release>17</maven .compiler.release>
2525
2626 <!-- bigdata-test framework, published locally as 0.1.1-SNAPSHOT -->
27- <bigdata-test .version>0.1.4 </bigdata-test .version>
27+ <bigdata-test .version>0.1.6 </bigdata-test .version>
2828
2929 <!-- shared, version-line independent dependencies -->
3030 <junit .version>5.11.4</junit .version>
Original file line number Diff line number Diff line change 1+ # java-dns host overrides (hosts-file format: <ip> <hostname>).
2+ # Resolves the bigdata-test container network aliases to the local mapped containers,
3+ # so the test reaches them without wiring per-run endpoints into the Spark session.
4+ 127.0.0.1 fake-gcs
5+ 127.0.0.1 hdfs
Original file line number Diff line number Diff line change 156156 <scope >test</scope >
157157 </dependency >
158158
159- <!-- java-dns agent jar (attached to the Surefire JVM to redirect the fake-gcs host) -->
159+ <!-- java-dns agent jar (attached to the Surefire JVM; redirects the hosts in dns.hosts
160+ (fake-gcs, hdfs) to the local mapped containers) -->
160161 <dependency >
161162 <groupId >org.openprojectx.java.dns</groupId >
162163 <artifactId >core</artifactId >
199200 <groupId >org.apache.maven.plugins</groupId >
200201 <artifactId >maven-surefire-plugin</artifactId >
201202 <configuration >
202- <argLine >@{argLine} -javaagent:${org.openprojectx.java.dns:core:jar} =hosts=fake-gcs/127.0.0.1 ;fallback=true ${bigdata.test.argLine} </argLine >
203+ <argLine >@{argLine} -javaagent:${org.openprojectx.java.dns:core:jar} =hostsFile= ${project.basedir} /dns.hosts ;fallback=true ${bigdata.test.argLine} </argLine >
203204 <dependenciesToScan >
204205 <dependency >org.openprojectx.bigdata.test.example:spark-test-common</dependency >
205206 </dependenciesToScan >
Original file line number Diff line number Diff line change 1+ # java-dns host overrides (hosts-file format: <ip> <hostname>).
2+ # Resolves the bigdata-test container network aliases to the local mapped containers,
3+ # so the test reaches them without wiring per-run endpoints into the Spark session.
4+ 127.0.0.1 fake-gcs
5+ 127.0.0.1 hdfs
Original file line number Diff line number Diff line change 161161 <scope >test</scope >
162162 </dependency >
163163
164- <!-- java-dns agent jar (attached to the Surefire JVM to redirect the fake-gcs host) -->
164+ <!-- java-dns agent jar (attached to the Surefire JVM; redirects the hosts in dns.hosts
165+ (fake-gcs, hdfs) to the local mapped containers) -->
165166 <dependency >
166167 <groupId >org.openprojectx.java.dns</groupId >
167168 <artifactId >core</artifactId >
204205 <groupId >org.apache.maven.plugins</groupId >
205206 <artifactId >maven-surefire-plugin</artifactId >
206207 <configuration >
207- <argLine >@{argLine} -javaagent:${org.openprojectx.java.dns:core:jar} =hosts=fake-gcs/127.0.0.1 ;fallback=true ${bigdata.test.argLine} </argLine >
208+ <argLine >@{argLine} -javaagent:${org.openprojectx.java.dns:core:jar} =hostsFile= ${project.basedir} /dns.hosts ;fallback=true ${bigdata.test.argLine} </argLine >
208209 <dependenciesToScan >
209210 <dependency >org.openprojectx.bigdata.test.example:spark-test-common</dependency >
210211 </dependenciesToScan >
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ fakeGcs = true
2121# URL http://fake-gcs:4443/ (host "fake-gcs" -> 127.0.0.1) to the running container.
2222[ports ]
2323fakeGcs = 4443
24+ hdfsDataNode = 9866
2425
2526[containerLogs ]
2627mode = " FILE"
You can’t perform that action at this time.
0 commit comments