-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (87 loc) · 3 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: moto-integration-tests
on:
schedule:
- cron: '0 6 * * 0'
pull_request:
branches:
- main
workflow_dispatch:
inputs:
selected-services:
type: string
required: false
default: 'all'
description: 'enter a list of services (comma separated), that will be used to filter for tests'
push:
branches:
- main
permissions:
contents: write
checks: write
pull-requests: write
jobs:
run-moto-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout Moto
uses: actions/checkout@v3
with:
repository: getmoto/moto
path: moto
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install pytest requests pytest-timeout
cd moto && make init
- name: Copy conftest.py
run: |
cp conftest.py moto/tests
- name: Prepare Extension
run: |
cd collect-raw-metric-data-extension && make install
- name: Setup LocalStack
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.TEST_LOCALSTACK_AUTH_TOKEN }}
run: |
source .venv/bin/activate
pip install localstack
docker pull localstack/localstack-pro # Make sure to pull the latest version of the image
localstack extensions init
localstack extensions dev enable ./collect-raw-metric-data-extension
DEBUG=1 DISABLE_EVENTS=1 DNS_ADDRESS=127.0.0.1 EXTENSION_DEV_MODE=1 localstack start -d
echo "Waiting for LocalStack startup..."
localstack wait -t 30
echo "Startup complete"
- name: Run Moto Integration Tests against LocalStack
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.TEST_LOCALSTACK_AUTH_TOKEN }}
run: |
source .venv/bin/activate
python -m pytest --durations=10 --services=${{ inputs.selected-services || 'all' }} --timeout=300 --capture=no --junitxml=target/reports/pytest.xml moto/tests --tb=line
- name: Archive Test Result
if: always()
uses: actions/upload-artifact@v4
with:
name: test-metrics
path: target/reports
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: target/reports/*.xml
check_name: Moto Integration Tests against LocalStack Results
- name: LocalStack Logs
if: always()
run:
source .venv/bin/activate
localstack logs
- name: Prevent Workflows from getting Stale
if: always()
uses: gautamkrishnar/keepalive-workflow@v1
with:
#this message should prevent automatic triggering of workflows
#see https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
commit_message: "[skip ci] Automated commit by Keepalive Workflow to keep the repository active"