Skip to content

Commit 431928e

Browse files
authored
test(fix): update the test proxy's pom file to build a shaded jar, also correct the README about building an old version (#1546)
* test(fix): update the test proxy's pom file to build a shaded jar, also correct the README about building an old version * test(fix): revert the previous commit b6b9eb6 * test(fix): address the review comment about README
1 parent 815ac52 commit 431928e

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

test-proxy/README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The CBT test proxy is intended for running confromance tests for Cloug Bigtable Java Client.
44

5-
## Set up
5+
## Set up
66

77
If you have not already done so, [install golang](https://go.dev/doc/install), then clone the go test library:
88

@@ -12,7 +12,7 @@ git clone https://github.com/googleapis/cloud-bigtable-clients-test.git
1212

1313
## Start test proxy
1414

15-
Build the proxy with the latest version of the client
15+
Build the proxy with the latest/head version of the client
1616

1717
```
1818
cd java-bigtable
@@ -24,20 +24,13 @@ mvn clean install
2424
Start the proxy on default port 9999
2525

2626
```
27-
mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyMain
27+
java -jar target/google-cloud-bigtable-test-proxy-<proxy_version>.jar
2828
```
2929

3030
Start the proxy on a different port
3131

3232
```
33-
mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyMain -Dport=1
34-
```
35-
36-
Build and start the proxy with an older version of the client
37-
38-
```
39-
mvn clean install -Dbigtable.client.version=<client_version> -Denforcer.skip
40-
mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyMain
33+
java -Dport=1 -jar target/google-cloud-bigtable-test-proxy-<proxy_version>.jar
4134
```
4235

4336
## Run the test cases
@@ -46,3 +39,12 @@ mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyM
4639
cd cloud-bigtable-clients-test/tests
4740
go test -v -proxy_addr=:9999
4841
```
42+
43+
## Test a released client
44+
45+
To do so, you need to build the proxy with the released version of the client.
46+
Please download the source code
47+
[here](https://github.com/googleapis/java-bigtable/releases), and repeat the
48+
above steps.
49+
50+
Note that Kokoro presubmit test doesn't use this route.

test-proxy/pom.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,38 @@
134134
<skip>true</skip>
135135
</configuration>
136136
</plugin>
137+
<plugin>
138+
<groupId>org.apache.maven.plugins</groupId>
139+
<artifactId>maven-shade-plugin</artifactId>
140+
<executions>
141+
<execution>
142+
<phase>package</phase>
143+
<goals>
144+
<goal>shade</goal>
145+
</goals>
146+
<configuration>
147+
<filters>
148+
<filter>
149+
<artifact>*:*</artifact>
150+
<excludes>
151+
<exclude>META-INF/*.SF</exclude>
152+
<exclude>META-INF/*.DSA</exclude>
153+
<exclude>META-INF/*.RSA</exclude>
154+
</excludes>
155+
</filter>
156+
</filters>
157+
<transformers>
158+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
159+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
160+
<manifestEntries>
161+
<Main-Class>com.google.cloud.bigtable.testproxy.CbtTestProxyMain</Main-Class>
162+
</manifestEntries>
163+
</transformer>
164+
</transformers>
165+
</configuration>
166+
</execution>
167+
</executions>
168+
</plugin>
137169
<!-- end skip publishing to maven central -->
138170
</plugins>
139171
</build>

0 commit comments

Comments
 (0)