-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use localstack for AWS testing (#1067)
* Use localstack for AWS testing * Fix AwsSecretsManagerProviderTest * Modify multipleValueTransfers to wait for each transaction hash in a loop
- Loading branch information
1 parent
c4fddf9
commit 70ad630
Showing
9 changed files
with
110 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,15 +33,25 @@ jobs: | |
id: project-version | ||
uses: ./.github/actions/project-version | ||
|
||
- name: Start LocalStack (AWS) | ||
id: localstack | ||
uses: LocalStack/[email protected] | ||
with: | ||
image-tag: 'latest' | ||
configuration: LOCALSTACK_DEBUG=1 | ||
|
||
- name: Build and Test | ||
id: build-test | ||
uses: ./.github/actions/build-test | ||
env: | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.RO_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.RO_AWS_SECRET_ACCESS_KEY }} | ||
RW_AWS_ACCESS_KEY_ID: ${{ secrets.RW_AWS_ACCESS_KEY_ID }} | ||
RW_AWS_SECRET_ACCESS_KEY: ${{ secrets.RW_AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-east-2' | ||
AWS_ACCESS_KEY_ID: 'test' | ||
AWS_SECRET_ACCESS_KEY: 'test' | ||
RW_AWS_ACCESS_KEY_ID: 'test' | ||
RW_AWS_SECRET_ACCESS_KEY: 'test' | ||
AWS_ACCESS_KEY_ID_TEST2: 'test2' | ||
AWS_SECRET_ACCESS_KEY_TEST2: 'test2' | ||
AWS_ENDPOINT_OVERRIDE: 'http://127.0.0.1:4566' | ||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
AZURE_INVALID_KEY_VAULT_NAME: ${{ secrets.AZURE_INVALID_KEY_VAULT_NAME }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Localstack for AWS services testing | ||
|
||
The AWS related unit, integration and acceptance tests can be tested against localstack. | ||
Use following command to start localstack services. | ||
|
||
```bash | ||
docker compose up | ||
``` | ||
|
||
Use `CTRL-C` or run `docker compose down` from the same directory but from another shell instance. | ||
|
||
Export following environment variables before running Web3Signer tests. | ||
|
||
```bash | ||
export RW_AWS_ACCESS_KEY_ID=test | ||
export RW_AWS_SECRET_ACCESS_KEY=test | ||
export AWS_ACCESS_KEY_ID=test | ||
export AWS_SECRET_ACCESS_KEY=test | ||
export AWS_ACCESS_KEY_ID_TEST2=test2 | ||
export AWS_SECRET_ACCESS_KEY_TEST2=test2 | ||
export AWS_REGION=us-east-2 | ||
export AWS_ENDPOINT_OVERRIDE=http://127.0.0.1:4566 | ||
``` | ||
|
||
To import above in IntelliJ IDEA Run configurations: | ||
``` | ||
RW_AWS_ACCESS_KEY_ID=test | ||
RW_AWS_SECRET_ACCESS_KEY=test | ||
AWS_ACCESS_KEY_ID=test | ||
AWS_SECRET_ACCESS_KEY=test | ||
AWS_REGION=us-east-2 | ||
AWS_ACCESS_KEY_ID_TEST2=test2 | ||
AWS_SECRET_ACCESS_KEY_TEST2=test2 | ||
AWS_ENDPOINT_OVERRIDE=http://127.0.0.1:4566 | ||
``` | ||
|
||
Run gradle tests. | ||
```bash | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
# see https://docs.localstack.cloud/getting-started/installation/#docker-compose | ||
# see https://docs.localstack.cloud/references/configuration/ | ||
localstack: | ||
container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}" | ||
image: localstack/localstack | ||
ports: | ||
- "127.0.0.1:4566:4566" # LocalStack Gateway | ||
- "127.0.0.1:4510-4559:4510-4559" # external services port range | ||
environment: | ||
# LocalStack configuration | ||
- DEBUG=${DEBUG-} | ||
- DOCKER_HOST=unix:///var/run/docker.sock | ||
# ready hook script configuration | ||
volumes: | ||
#- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack" | ||
#- "./init/ready.d:/etc/localstack/init/ready.d" # ready hooks | ||
- "${DOCKER_HOST_PATH:-/var/run/docker.sock}:/var/run/docker.sock" |