You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development-guide/IntegrationTests.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
- Docker Desktop:
6
6
-[Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
7
7
-[Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
8
+
-[Environment variables](#Environment-Variables)
8
9
9
10
##### Aurora Test Requirements
10
11
- An AWS account with:
@@ -25,8 +26,46 @@ PostgreSQL and MySQL tests are currently supported.
25
26
These integration tests are focused on testing connection strings against a local database inside a Docker container.
26
27
PostgreSQL and MySQL tests are currently supported.
27
28
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 |
|`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
+
28
49
### 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.
30
50
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:
0 commit comments