DVX-182: Run integration tests in parallel #5
Workflow file for this run
This file contains 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: pyatlan pull request | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
pyatlan-qa-checks-and-unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: QA checks (black, flake8, mypy) | |
run: | | |
./qa-checks | |
- name: Run unit tests | |
env: # Test tenant environment variables | |
ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} | |
ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} | |
MARK_API_KEY: ${{ secrets.MARK_ATLAN_API_KEY }} | |
MARK_BASE_URL: https://mark.atlan.com | |
run: pytest tests/unit | |
pyatlan-integration-tests: | |
runs-on: ubuntu-latest | |
needs: [pyatlan-qa-checks-and-unit-tests] | |
strategy: | |
fail-fast: false | |
matrix: | |
job_id: | |
[ | |
"job1", | |
"job2", | |
"job3", | |
"job4", | |
"job5", | |
"job6", | |
"job7", | |
"job8", | |
"job9", | |
"job10", | |
"job11", | |
"job12", | |
"job13", | |
"job14", | |
"job15", | |
"job16", | |
"job17", | |
"job18", | |
"job19", | |
"job20", | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y jq | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: Run integration tests | |
env: # Test tenant environment variables | |
ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} | |
ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} | |
MARK_API_KEY: ${{ secrets.MARK_ATLAN_API_KEY }} | |
MARK_BASE_URL: https://mark.atlan.com | |
run: | | |
DISTRIBUTED_TESTS=$(python3 st.py) | |
TEST_FILES=$(echo "${DISTRIBUTED_TESTS}" | jq -r --arg targetJob "${{ matrix.job_id }}" '.[$targetJob].test_files[]' | tr '\n' ' ') | |
echo "Running ${TEST_FILES}" | |
pytest ${TEST_FILES} |