Skip to content

Add vcenter as inventory source #2195

Add vcenter as inventory source

Add vcenter as inventory source #2195

name: integration-tests
on:
push:
# run on push only in master, develop, version specific and hotfix branches
branches:
- master
- develop
- '[0-9].[0-9]+.[0-9]+.?[0-9]?'
pull_request:
# run on branches having an open PR
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
group: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Set up suzieq config
run: cp build/suzieq-cfg-travis.yml suzieq-cfg.yml
- name: Install pytest split
run: poetry run pip install pytest-split
- name: Prepare dir for caching durations
run: mkdir test_durations
- name: Get durations from cache
uses: actions/cache@v2
with:
path: test_durations
# artificial cache miss to always save at the end of the job and avoid out of sync test runs
key: test-durations-split-${{ github.run_id }}-${{ github.run_number}}-${{ matrix.group }}-${{ matrix.python-version }}
restore-keys: |
test-durations
- name: pytest
run: poetry run pytest --splits 4 --group ${{ matrix.group }} --store-durations --durations-path test_durations/.test_durations_${{ matrix.python-version }}
- name: Upload partial durations
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: duration-chunk-${{ matrix.group }}-python-${{ matrix.python-version }}
path: test_durations
update_durations:
name: Merge and update test durations
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get durations from cache
uses: actions/cache@v2
with:
path: test_durations
# artificial cache miss to always save at the end of the job and avoid out of sync test runs
key: test-durations-${{ github.sha }}
restore-keys: |
test-durations
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Merge test durations
run: python3 tests/utilities/merge_test_durations_ci.py