Skip to content

Use TestContainer fixtures #9444

Use TestContainer fixtures

Use TestContainer fixtures #9444

Workflow file for this run

---
# yamllint disable rule:truthy rule:truthy rule:line-length
name: "CI"
on:
pull_request:
push:
branches:
- develop
- stable
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
INFRAHUB_DB_USERNAME: neo4j
INFRAHUB_DB_PASSWORD: admin
INFRAHUB_DB_ADDRESS: localhost
INFRAHUB_DB_PORT: 7687
INFRAHUB_DB_PROTOCOL: bolt
INFRAHUB_BROKER_ADDRESS: message-queue
INFRAHUB_LOG_LEVEL: CRITICAL
INFRAHUB_IMAGE_NAME: "opsmill/infrahub"
INFRAHUB_IMAGE_VER: "local"
PYTEST_XDIST_WORKER_COUNT: 4
INFRAHUB_TEST_IN_DOCKER: 1
VALE_VERSION: "3.7.1"
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
METRICS_ENDPOINT: ${{ secrets.METRICS_ENDPOINT }}
jobs:
backend-tests-unit:
runs-on:
group: huge-runners
timeout-minutes: 45
env:
INFRAHUB_DB_TYPE: memgraph
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup git credentials"
run: "git config --global user.name 'Infrahub' && \
git config --global user.email 'infrahub@opsmill.com' && \
git config --global --add safe.directory '*' && \
git config --global credential.usehttppath true && \
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
- name: "Setup Python environment"
run: "pip install toml invoke"
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi"
- name: "Unit Tests"
run: "invoke backend.test-unit"
- name: "Coveralls : Unit Tests"
uses: coverallsapp/github-action@v2
continue-on-error: true
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
with:
flag-name: backend-unit
parallel: true
- name: Generate tracing spans
if: always() && github.event.pull_request.head.repo.fork == false
uses: inception-health/otel-upload-test-artifact-action@v1
with:
jobName: "backend-tests-unit"
stepName: "Unit Tests"
path: "pytest-junit.xml"
type: "junit"
githubToken: ${{ secrets.GH_TRACING_REPO_TOKEN }}
backend-tests-integration:
runs-on:
group: "huge-runners"
timeout-minutes: 30
env:
INFRAHUB_DB_TYPE: neo4j
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
- name: "Setup git credentials"
run: "git config --global user.name 'Infrahub' && \
git config --global user.email 'infrahub@opsmill.com' && \
git config --global --add safe.directory '*' && \
git config --global credential.usehttppath true && \
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
- name: "Setup Python environment"
run: "pip install toml invoke"
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi"
- name: "Integration Tests"
run: "invoke backend.test-integration"
- name: "Coveralls : Integration Tests"
uses: coverallsapp/github-action@v2
continue-on-error: true
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
with:
flag-name: backend-integration
parallel: true