Skip to content

Commit

Permalink
test(fix): update the test proxy's pom file to build a shaded jar, al…
Browse files Browse the repository at this point in the history
…so 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
  • Loading branch information
liujiongxin authored Dec 12, 2022
1 parent 815ac52 commit 431928e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
24 changes: 13 additions & 11 deletions test-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

## Set up
## Set up

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

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

## Start test proxy

Build the proxy with the latest version of the client
Build the proxy with the latest/head version of the client

```
cd java-bigtable
Expand All @@ -24,20 +24,13 @@ mvn clean install
Start the proxy on default port 9999

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

Start the proxy on a different port

```
mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyMain -Dport=1
```

Build and start the proxy with an older version of the client

```
mvn clean install -Dbigtable.client.version=<client_version> -Denforcer.skip
mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyMain
java -Dport=1 -jar target/google-cloud-bigtable-test-proxy-<proxy_version>.jar
```

## Run the test cases
Expand All @@ -46,3 +39,12 @@ mvn exec:java -Dexec.mainClass=com.google.cloud.bigtable.testproxy.CbtTestProxyM
cd cloud-bigtable-clients-test/tests
go test -v -proxy_addr=:9999
```

## Test a released client

To do so, you need to build the proxy with the released version of the client.
Please download the source code
[here](/~https://github.com/googleapis/java-bigtable/releases), and repeat the
above steps.

Note that Kokoro presubmit test doesn't use this route.
32 changes: 32 additions & 0 deletions test-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,38 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.google.cloud.bigtable.testproxy.CbtTestProxyMain</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<!-- end skip publishing to maven central -->
</plugins>
</build>
Expand Down

0 comments on commit 431928e

Please sign in to comment.