Skip to content

Fix service names in BackendDict initialisations (#68) #206

Fix service names in BackendDict initialisations (#68)

Fix service names in BackendDict initialisations (#68) #206

on:
push:
paths-ignore:
- 'README.md'
branches:
- localstack
pull_request:
name: TestTerraform
jobs:
prepare_list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(python tests/terraformtests/get_tf_services.py --names)" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
test_service:
needs: prepare_list
if: "!contains(github.event.pull_request.labels.*.name, 'java')"
strategy:
fail-fast: false
matrix:
service: ${{ fromJson(needs.prepare_list.outputs.matrix) }}
go-version: [1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: tests/terraformtests/terraform-provider-aws/go.sum
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Start MotoServer
run: |
pip install PyYAML build
python -m build
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e MOTO_PORT=4566 -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 4566:4566 -v /var/run/docker.sock:/var/run/docker.sock python:3.7-buster /moto/scripts/ci_moto_server.sh &
MOTO_PORT=4566 python scripts/ci_wait_for_server.py
- name: Get list of tests for this service
id: get-list
run: echo "testlist=$(python tests/terraformtests/get_tf_tests.py '${{ matrix.service }}')" >> $GITHUB_OUTPUT
- name: Get original AWS service name
id: get-service-name
run: echo "servicename=$(python -c "print('${{ matrix.service }}'[:'${{ matrix.service }}'.index('|') if '|' in '${{ matrix.service }}' else len('${{ matrix.service }}')])")" >> $GITHUB_OUTPUT
- name: Execute tests
run: |
make terraformtests SERVICE_NAME=${{ steps.get-service-name.outputs.servicename }} TEST_NAMES=${{ steps.get-list.outputs.testlist }}