Core: Introduce enable/disable_iam_authentication context managers #57
Workflow file for this run
This file contains hidden or 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
| name: "CloudWatch Wire Protocol Tests" | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/test_cloudwatch.yml" | |
| - "moto/core/**" | |
| - "moto/cloudwatch/**" | |
| - "tests/test_cloudwatch/**" | |
| schedule: | |
| - cron: '00 12 * * 0' | |
| workflow_dispatch: | |
| env: | |
| python-version: "3.12" | |
| jobs: | |
| test-cloudwatch-protocols: | |
| name: "${{ matrix.protocol }} protocol, server mode: ${{ matrix.test-server-mode }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| protocol: [ "json", "query" ] | |
| test-server-mode: [ "true", "false" ] | |
| # TODO: Remove this exclusion when JSON protocol support is released. | |
| exclude: | |
| - protocol: "json" | |
| test-server-mode: "true" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ env.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.python-version }} | |
| - name: Start MotoServer | |
| if: ${{ matrix.test-server-mode == 'true' }} | |
| run: | | |
| pip install build | |
| python -m build | |
| docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e MOTO_EC2_LOAD_DEFAULT_AMIS=false -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock python:${{ env.python-version }}-slim /moto/scripts/ci_moto_server.sh & | |
| python scripts/ci_wait_for_server.py | |
| - name: Update pip | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Install project dependencies | |
| run: | | |
| pip install -r requirements-dev.txt | |
| - name: Install AWS Client SDK for JSON Protocol | |
| if: ${{ matrix.protocol == 'json' }} | |
| run: | | |
| curl -L -o Boto3CliV1Artifacts.zip "https://d1l1rpjfz23h36.cloudfront.net/pr2qwos6sy8mfx2/Python_Boto_v3/Boto3CliV1Artifacts.zip" | |
| unzip Boto3CliV1Artifacts.zip | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt | |
| pip install botocore-1.39.7-py3-none-any.whl | |
| - name: Install AWS Client SDK for Query Protocol | |
| if: ${{ matrix.protocol == 'query' }} | |
| run: | | |
| pip install botocore==1.40.16 | |
| - name: Run tests | |
| run: | | |
| pytest -sv tests/test_cloudwatch | |
| env: | |
| TEST_SERVER_MODE: ${{ matrix.test-server-mode }} | |
| - name: "Stop MotoServer" | |
| if: ${{ matrix.test-server-mode == 'true' }} | |
| run: | | |
| ls -la | |
| docker stop motoserver | |
| mkdir serverlogs | |
| cp server_output.log serverlogs/server_output.log | |
| - name: Archive Server logs | |
| if: ${{ matrix.test-server-mode == 'true' }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: motoserver-with-client-using-${{ matrix.protocol }}-protocol | |
| path: | | |
| serverlogs/* |