Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/java-pgjdbc-integ-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
java-version: '17'
distribution: 'corretto'
architecture: x64
cache: maven
cache: gradle

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -54,8 +54,4 @@ jobs:
CLUSTER_ENDPOINT: ${{ secrets.JAVA_PGJDBC_CLUSTER_ENDPOINT }}
CLUSTER_USER: admin
REGION: ${{ secrets.JAVA_PGJDBC_CLUSTER_REGION }}
run: |
mvn validate
mvn initialize
mvn compile
mvn test
run: ./gradlew test
70 changes: 70 additions & 0 deletions .github/workflows/python-asyncpg-integ-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Python asyncpg integration tests

permissions: {}

on:
push:
branches: [ main ]
paths:
- 'python/asyncpg/**'
- '.github/workflows/python-asyncpg-integ-tests.yml'
pull_request:
branches: [ main ]
paths:
- 'python/asyncpg/**'
- '.github/workflows/python-asyncpg-integ-tests.yml'
# Give us a button to allow running the workflow on demand for testing.
workflow_dispatch:
inputs:
tags:
description: 'Manual Workflow Run'
required: false
type: string

jobs:
python-asyncpg-integ-test:
runs-on: ubuntu-latest
permissions:
id-token: write # required by aws-actions/configure-aws-credentials
concurrency:
# Ensure only 1 job uses the workflow cluster at a time.
group: ${{ github.workflow }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }}
aws-region: us-east-1

- name: Configure and run integration for asyncpg - admin
working-directory: ./python/asyncpg
env:
CLUSTER_USER: "admin"
CLUSTER_ENDPOINT: ${{ secrets.PYTHON_PSYCOPG3_CLUSTER_ENDPOINT }}
run: |
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install --force-reinstall -r requirements.txt
python3 -c "import boto3; print(boto3.__version__)"
pip list
echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O root.pem
pytest
23 changes: 9 additions & 14 deletions java/pgjdbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ connections should be used where possible to ensure data security during transmi
```bash
java -version

* Build Tool (Maven or Gradle)
- _Maven_: Ensure Maven is installed if that is your preferred option. You can download it from the [official website](https://maven.apache.org/download.cgi).
- _Gradle_: Ensure Gradle is installed if that is your preferred option. You can download it from the [official website](https://gradle.org/install/).
* Gradle: This example uses the Gradle wrapper included in the repository, so no separate installation is required.
* AWS SDK: Ensure that you setup the latest version of the AWS Java SDK [official website](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup.html)
* You must have an Aurora DSQL cluster. For information about creating an Aurora DSQL cluster, see the
[Getting started with Aurora DSQL](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/getting-started.html)
Expand Down Expand Up @@ -95,18 +93,15 @@ export CLUSTER_ENDPOINT="<your endpoint>"

Run the example:

- _Maven_:

```bash
mvn compile
mvn test
```
```bash
./gradlew run
```

- _Gradle_:
Run the tests:

```bash
gradle run
```
```bash
./gradlew test
```


The example contains comments explaining the code and the operations being performed.
Expand All @@ -122,4 +117,4 @@ The example contains comments explaining the code and the operations being perfo

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: MIT-0
SPDX-License-Identifier: Apache-2.0
13 changes: 10 additions & 3 deletions java/pgjdbc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import org.gradle.api.tasks.testing.logging.TestExceptionFormat

plugins {
Expand All @@ -6,18 +9,22 @@ plugins {
}

application {
mainClass = "org.example.Example"
mainClass = "software.amazon.dsql.examples.ExamplePreferred"
}

group = "org.example"
group = "software.amazon.dsql.examples"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
}

dependencies {
implementation("com.zaxxer:HikariCP:5.1.0")
implementation("software.amazon.dsql:aurora-dsql-jdbc-connector:1.2.0")
// AWS SDK dependencies for SDK-only example (ExampleWithNoConnector)
implementation("software.amazon.awssdk:dsql:2.31.32")
implementation("org.postgresql:postgresql:42.7.7")

testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
Expand All @@ -41,4 +48,4 @@ tasks.withType<Test> {

tasks.withType<JavaExec> {
this.enableAssertions = true
}
}
Binary file added java/pgjdbc/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions java/pgjdbc/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading