Skip to content

Commit

Permalink
#98: add it.properties documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Kovalenko committed Sep 29, 2017
1 parent eb757d9 commit bd501ea
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,49 @@ For more detailed information on build and release process, see [Build and Relea

1. The integration tests of the library require to have two CTP projects (a source project and a target project) were the
data will be tested to be synced on from the source to the target project.

2. Running the tests does the following:
- Clean all the data in both projects.
- Create test data in either/both projects depending on the test.
- Execute the tests.
- Clean all the data in both projects, leaving them empty.

#### Running
Before running the integration tests make sure the following environment variables are set:
````bash
export SOURCE_PROJECT_KEY = xxxxxxxxxxxxx
export SOURCE_CLIENT_ID = xxxxxxxxxxxxxxx
export SOURCE_CLIENT_SECRET = xxxxxxxxxxx
export TARGET_PROJECT_KEY = xxxxxxxxxxxxx
export TARGET_CLIENT_ID = xxxxxxxxxxxxxxx
export TARGET_CLIENT_SECRET = xxxxxxxxxxx
````

then run the integration tests:
````bash
#### Running

To run the integration tests with CTP credentials you have 2 options:

1. Use credentials Java properties file [`it.properties`](/src/integration-test/resources/it.properties):

```properties
source.projectKey=aaaaa
source.clientId=bbbbbbb
source.clientSecret=ccc

target.projectKey=ddddd
target.clientId=eeeeeee
target.clientSecret=fff
```

Use [`it.properties.skeleton`](/src/integration-test/resources/it.properties.skeleton)
as a template to setup the credentials.

**Note**: the `it.properties` file must be ignored by VCS.

2. Set the following environment variables:
```bash
export SOURCE_PROJECT_KEY = xxxxxxxxxxxxx
export SOURCE_CLIENT_ID = xxxxxxxxxxxxxxx
export SOURCE_CLIENT_SECRET = xxxxxxxxxxx
export TARGET_PROJECT_KEY = xxxxxxxxxxxxx
export TARGET_CLIENT_ID = xxxxxxxxxxxxxxx
export TARGET_CLIENT_SECRET = xxxxxxxxxxx
```

**Note**: `it.properties` file has precedence over environment variables. If the file exists -
the environment variables are ignored. If the existing `it.properties` file is empty or one of the properties
is missing - exception will be thrown on the tests execution

If one of two options above is set - run the integration tests:
```bash
./gradlew integrationTest
````
```
1 change: 0 additions & 1 deletion src/integration-test/resources/it.properties.skeleton
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# rename to it.properties and fill the values to run the integration tests locally without env variables
# see SphereClientUtils for more info
# TODO: akovalenko: add to the documentation

source.projectKey=<<create your project for local IT>>
source.clientId=YOUR client id without quotes
Expand Down

0 comments on commit bd501ea

Please sign in to comment.