Skip to content

Commit 26407ae

Browse files
Improve contribution documentation (#575)
1 parent 52ea16b commit 26407ae

File tree

4 files changed

+51
-116
lines changed

4 files changed

+51
-116
lines changed

CONTRIBUTING.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Overcommit adds some requirements to your commit messages. At Uber, we follow th
3232
[Chris Beams](http://chris.beams.io/posts/git-commit/) guide to writing git
3333
commit messages. Read it, follow it, learn it, love it.
3434

35-
## Test and Build
35+
## Test
3636

3737
Testing and building cadence-java-client requires running cadence docker locally, execute:
3838

@@ -49,8 +49,37 @@ Then run all the tests with:
4949
./gradlew test
5050
```
5151

52+
The test by default will run with TestEnvironment without Cadence service. If you want to run with Cadence serivce:
53+
```bash
54+
USE_DOCKER_SERVICE=true ./gradlew test
55+
```
56+
And sometimes it's important to test the non-sticky mode
57+
```bash
58+
STICKY_OFF=true USE_DOCKER_SERVICE=true ./gradlew test
59+
```
60+
61+
Also, if there is any Buildkite test failure that you cannot reproduce locally,
62+
follow [buildkite docker-compose](./docker/buildkite/README.md) instructions to run the tests.
63+
64+
## Build & Publish
5265
Build with:
5366

5467
```bash
5568
./gradlew build
5669
```
70+
71+
To test locally, change `build.gradle`:
72+
1. Comment out the whole `publications`
73+
2. Change
74+
```
75+
group = 'com.uber.cadence'
76+
````
77+
to
78+
```
79+
group = 'com.local.cadence'
80+
```
81+
Then run the command
82+
```bash
83+
./gradlew publishToMavenLocal
84+
```
85+
Now you can use the local cadence-java-client in your laptop.

docker/buildkite/Dockerfile-local

Lines changed: 0 additions & 16 deletions
This file was deleted.

docker/buildkite/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Debug Builkite integration test
2+
Sometimes the environment on IDE may be different as Buildkite.
3+
You can run the following command to trigger the same test as running on Buildkite:
4+
5+
```bash
6+
docker-compose -f docker-compose.yaml run unit-test-docker-sticky-on &> test.log
7+
```
8+
Or
9+
```bash
10+
docker-compose -f docker-compose.yaml run unit-test-docker-sticky-off &> test.log
11+
```
12+
13+
Or
14+
```bash
15+
docker-compose -f docker-compose.yaml run unit-test-test-service &> test.log
16+
```
17+
18+
And finally make sure to shutdown all docker resources:
19+
```bash
20+
docker-compose down
21+
```

docker/buildkite/docker-compose-local.yaml

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)