Skip to content

feat(tests): setup docker-compose for integration tests 7 #2

feat(tests): setup docker-compose for integration tests 7

feat(tests): setup docker-compose for integration tests 7 #2

---

Check failure on line 1 in .github/workflows/python-integration.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/python-integration.yaml

Invalid workflow file

(Line: 69, Col: 37): Unrecognized named-value: 'GITHUB_SHA'. Located at position 1 within expression: GITHUB_SHA
name: 'Integration Test'
on:
workflow_call:
inputs:
PYTHON_VERSION:
default: '3.11'
description: Python Version to use
required: false
type: string
secrets:
WORKFLOW_TOKEN:
description: "token to clone with"
required: true
jobs:
integration-test:
name: Integration Test
runs-on: ubuntu-latest
strategy:
max-parallel: 8
matrix:
postgres-version: [ '13', '14', '15', '16', '17' ]
rabbitmq-version: [ '3.12', '3.13', '4.0', '4.1' ]
# outputs:
# unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }}
# unit-test-branch_coverage: ${{ steps.run-unit-test.outputs.branch_coverage }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Set up Python ${{ inputs.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_test.txt
- run: |
echo "::remove-matcher owner=python::"
- name: Run Tests
id: run-integration-test
continue-on-error: true
shell: bash
env:
CENTURION_RABBITMQ_IMAGE_TAG: ${{ matrix.rabbitmq-version }}
POSTGRES_IMAGE_TAG: ${{ matrix.postgres-version }}
CENTURION_IMAGE_TAG: ${{ env.GITHUB_SHA }}
CENTURION_IMAGE_TAG_test: ${{ GITHUB_SHA }}
run: |
echo "CENTURION_IMAGE_TAG: ${CENTURION_IMAGE_TAG}";
echo "CENTURION_IMAGE_TAG_test: ${CENTURION_IMAGE_TAG_test}";
echo "GITHUB_SHA: ${GITHUB_SHA}";
make test-integration
- name: Test Report
if: success() || failure()
uses: dorny/test-reporter@v1
id: test-report
with:
# artifact: unit-test-results-${{ matrix.python-version }}
name: Integration Test Report [python_${{ matrix.python-version }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}]
path: 'integration.JUnit.xml'
reporter: java-junit
- name: Upload Junit Test Report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: integration-test-report-junit-python_${{ matrix.python-version }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}
path: integration.JUnit.xml
- name: Upload Artifacts - Logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: integration-tests-python_${{ matrix.python-version }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}
path: test/volumes/logs*
- name: Upload Artifacts - Tests
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: integration-tests-python_${{ matrix.python-version }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}
path: test/volumes/artifacts/*