Skip to content

Fix AWS proxy extension not starting because of stale imports #216

Fix AWS proxy extension not starting because of stale imports

Fix AWS proxy extension not starting because of stale imports #216

Workflow file for this run

name: LocalStack AWS Replicator Extension Tests
on:
push:
paths:
- aws-replicator/**
branches:
- main
pull_request:
paths:
- .github/workflows/aws-replicator.yml
- aws-replicator/**
workflow_dispatch:
jobs:
tests-aws-proxy:
name: Run extension tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Terraform CLI
uses: hashicorp/setup-terraform@v2
- name: Install LocalStack and extension
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
run: |
set -e
docker pull localstack/localstack-pro &
docker pull public.ecr.aws/lambda/python:3.8 &
# install latest CLI packages (dev releases)
pip install --upgrade --pre localstack localstack-ext
# TODO remove
mkdir ~/.localstack; echo '{"token":"test"}' > ~/.localstack/auth.json
# install dependencies
sudo apt-get update
sudo apt-get install -y libsasl2-dev
# build and install extension
localstack extensions init
(
cd aws-replicator
make install
. .venv/bin/activate
pip install --upgrade --pre localstack localstack-ext
make build
make enable
)
# install awslocal/tflocal command lines
pip install awscli-local[ver1]
pip install terraform-local
find /home/runner/.cache/localstack/volume/lib/extensions/python_venv/lib/python3.11/site-packages/aws*
ls -la /home/runner/.cache/localstack/volume/lib/extensions/python_venv/lib/python3.11/site-packages/aws*
DEBUG=1 GATEWAY_SERVER=hypercorn localstack start -d
localstack wait
- name: Run linter
run: |
cd aws-replicator
(. .venv/bin/activate; pip install --upgrade --pre localstack localstack-ext)
make lint
- name: Run integration tests
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
run: |
cd aws-replicator
make test
- name: Deploy and test sample app
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
run: |
cd aws-replicator/example
make test
- name: Print LocalStack logs
if: always()
run: localstack logs