Skip to content

Commit 58f3501

Browse files
docs: Update integration test documentation and default wrapperPlugins value (#396)
Update integration test documentation and default wrapperPlugins value
1 parent 7b00497 commit 58f3501

File tree

8 files changed

+72
-153
lines changed

8 files changed

+72
-153
lines changed

docs/Documentation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Documentation
22

33
- [Getting Started](./GettingStarted.md)
4-
- [Using the AWS Advanced JDBC Wrapper](/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md)
4+
- [Using the AWS JDBC Driver](/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md)
55
- [Data Sources](/docs/using-the-jdbc-driver/DataSource.md)
66
- [Logging](/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md#logging)
77
- [JDBC Wrapper Parameters](/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md#aws-advanced-jdbc-driver-parameters)
@@ -13,9 +13,10 @@
1313
- [AWS Secrets Manager Plugin](/docs/using-the-jdbc-driver/using-plugins/UsingTheAwsSecretsManagerPlugin.md)
1414
- [Aurora Connection Tracker Plugin](/docs/using-the-jdbc-driver/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md)
1515
- [Driver Metadata Connection Plugin](/docs/using-the-jdbc-driver/using-plugins/UsingTheDriverMetadataConnectionPlugin.md)
16+
- [Read Write Splitting Plugin](/docs/using-the-jdbc-driver/using-plugins/UsingTheReadWriteSplittingPlugin.md)
1617
- [Development Guide](./development-guide/DevelopmentGuide.md)
1718
- [Setup](./development-guide/DevelopmentGuide.md#setup)
18-
- [Building the AWS Advanced JDBC Driver](./development-guide/DevelopmentGuide.md#building-the-aws-advanced-jdbc-driver)
19+
- [Building the AWS JDBC Driver](./development-guide/DevelopmentGuide.md#building-the-aws-advanced-jdbc-driver)
1920
- [Running the Tests](./development-guide/DevelopmentGuide.md#running-the-tests)
2021
- [Architecture](./development-guide/Architecture.md)
2122
- [Plugin Manager](./development-guide/PluginManager.md)

docs/development-guide/DevelopmentGuide.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,10 @@ Windows:
150150
./gradlew test
151151
```
152152

153-
For more information about running driver-specific integration tests, visit: <br />
153+
#### Integration Tests
154+
For more information on how to run the integration tests, please visit [Integration Tests](/docs/development-guide/IntegrationTests.md).
154155

155-
[PostgreSQL](/docs/driver-specific/postgresql/postgresql.md)
156-
157-
[MySQL](/docs/driver-specific/mysql/mysql.md)
158-
159-
###### Sample Code
156+
#### Sample Code
160157
[Connection Test Sample Code](/docs/driver-specific/postgresql/ConnectionSample.java)
161158

162159
## Architecture

docs/development-guide/IntegrationTests.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Docker Desktop:
66
- [Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
77
- [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
8+
- [Environment variables](#Environment-Variables)
89

910
##### Aurora Test Requirements
1011
- An AWS account with:
@@ -25,8 +26,46 @@ PostgreSQL and MySQL tests are currently supported.
2526
These integration tests are focused on testing connection strings against a local database inside a Docker container.
2627
PostgreSQL and MySQL tests are currently supported.
2728

29+
### Environment Variables
30+
31+
If the environment variable `REUSE_AURORA_CLUSTER` is set to true, the integration tests will use the existing cluster defined by your environment variables. Otherwise, the integration tests will create a new Aurora cluster and then delete it automatically when the tests are done. Note that you will need a valid Docker environment to run any of the integration tests because they are run using a Docker environment as a host. The appropriate Docker containers will be created automatically when you run the tests, so you will not need to execute any Docker commands manually.
32+
33+
>**Note:** if you are running tests against an existing cluster, the tests will only run against the Aurora database engine of that cluster. For example, if you specify a MySQL cluster using the environment variables, only the MySQL tests will be run even if you pick test-all-aurora as the task. To run against Postgres instead, you will need to change your environment variables
34+
35+
| Environment Variable Name | Required | Description | Example Value |
36+
|---------------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
37+
| `DB_USERNAME` | Yes | The username to access the database. | `admin` |
38+
| `DB_PASSWORD` | Yes | The database cluster password. | `password` |
39+
| `DB_DATABASE_NAME` | No | Name of the database that will be used by the tests. The default database name is test. | `test_db_name` |
40+
| `AURORA_CLUSTER_NAME` | Yes | The database identifier for your Aurora cluster. Must be a unique value to avoid conflicting with existing clusters. | `db-identifier` |
41+
| `AURORA_CLUSTER_DOMAIN` | No | The existing database connection suffix. Use this variable to run against an existing database. | `XYZ.us-east-2.rds.amazonaws.com` |
42+
| `IAM_USER` | No | User within the database that is identified with AWSAuthenticationPlugin. This is used for AWS IAM Authentication and is optional | `example_user_name` |
43+
| `AWS_ACCESS_KEY_ID` | Yes | An AWS access key associated with an IAM user or role with RDS permissions. | `ASIAIOSFODNN7EXAMPLE` |
44+
| `AWS_SECRET_ACCESS_KEY` | Yes | The secret key associated with the provided AWS_ACCESS_KEY_ID. | `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` |
45+
| `AWS_SESSION_TOKEN` | No | AWS Session Token for CLI, SDK, & API access. This value is for MFA credentials only. See: [temporary AWS credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html). | `AQoDYXdzEJr...<remainder of session token>` | |
46+
| `REUSE_AURORA_CLUSTER` | Yes | Set to true if you would like to use an existing cluster for your tests. | `false` |
47+
| `AURORA_DB_REGION` | Yes | The database region. | `us-east-2` |
48+
2849
### Running the Integration Tests
29-
Please view [this](../driver-specific/postgresql/postgresql.md) page for further instructions on how to run the PostgreSQL integration tests.
3050

31-
Please view [this](../driver-specific/mysql/mysql.md) page for further instructions on how to run the MySQL integration tests.
51+
To run the integration tests, you can select from a number of tasks:
52+
- `test-all-environments`: run all Aurora and standard database tests
53+
- `test-all-docker`: run all standard database tests
54+
- `test-all-aurora`: run all Aurora tests
55+
- `debug-all-environments`: debug all Aurora and standard database tests
56+
- `debug-all-docker`: debug all standard database tests
57+
- `debug-all-aurora`: debug all Aurora tests
58+
59+
For example, to run all integration tests, you can use the following commands:
60+
61+
macOS:
62+
```bash
63+
./gradlew --no-parallel --no-daemon test-all-environments
64+
```
65+
66+
Windows:
67+
```bash
68+
cmd /c ./gradlew --no-parallel --no-daemon test-all-environments
69+
```
3270

71+
Test results can be found at `wrapper/build/report/index.html`.

docs/driver-specific/mysql/mysql.md

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

docs/driver-specific/postgresql/postgresql.md

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

0 commit comments

Comments
 (0)