Skip to content

Additional tests for: #513

Additional tests for:

Additional tests for: #513

Workflow file for this run

name: tests
on:
push:
branches: ["**"]
pull_request:
types:
- opened
- reopened
- ready_for_review
jobs:
pytest-unit:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: System Dependencies
run: |
sudo apt-get update
sudo apt install -y build-essential \
libcairo2-dev \
pkg-config \
python3-dev \
python3-openssl
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pip/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3.9 -m pip install --upgrade pip
pip install -e .
if [ -f pip/cpu_requirements.txt ]; then pip install -r pip/cpu_requirements.txt; fi
if [ -f pip/dev_requirements.txt ]; then pip install -r pip/dev_requirements.txt; fi
- name: pytest
run: |
# python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv atomsci/ddm/test/unit
cd atomsci/modac/test/unit && python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv
cd ../../../../atomsci/ddm/test/unit && python3.9 -m pytest -m "not moe_required" -n 2 --capture=sys --capture=fd --cov=atomsci -vv
env:
ENV: test
- name: Debug - Find all coverage files
run: |
echo "=== Current directory ==="
pwd
echo ""
echo "=== Contents of current directory ==="
ls -la
echo ""
echo "=== Searching for ALL .coverage files recursively ==="
find . -name ".coverage*" -type f 2>/dev/null || echo "No .coverage files found"
echo ""
echo "=== Contents of test directory ==="
ls -la atomsci/ddm/test/integrative/ || echo "Directory not found"
echo ""
echo "=== Checking if coverage was even run ==="
which coverage
coverage --version || echo "Coverage not installed"
- name: Save coverage
uses: actions/upload-artifact@v4
with:
name: coverage-pytest-unit
path: |
atomsci/ddm/test/unit/.coverage*
atomsci/modac/test/unit/.coverage*
include-hidden-files: true
if-no-files-found: error
pytest-integrative-1:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: System Dependencies
run: |
sudo apt-get update
sudo apt install -y build-essential \
libcairo2-dev \
pkg-config \
python3-dev \
python3-openssl
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pip/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3.9 -m pip install --upgrade pip
pip install -e .
if [ -f pip/cpu_requirements.txt ]; then pip install -r pip/cpu_requirements.txt; fi
if [ -f pip/dev_requirements.txt ]; then pip install -r pip/dev_requirements.txt; fi
- name: pytest
run: |
# TODO: Run this test with pytest for paralell testing
# python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv atomsci/ddm/test/integrative
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 0
env:
ENV: test
- name: Debug - Find all coverage files
run: |
echo "=== Current directory ==="
pwd
echo ""
echo "=== Contents of current directory ==="
ls -la
echo ""
echo "=== Searching for ALL .coverage files recursively ==="
find . -name ".coverage*" -type f 2>/dev/null || echo "No .coverage files found"
echo ""
echo "=== Contents of test directory ==="
ls -la atomsci/ddm/test/integrative/ || echo "Directory not found"
echo ""
echo "=== Checking if coverage was even run ==="
which coverage
coverage --version || echo "Coverage not installed"
- name: Save coverage
uses: actions/upload-artifact@v4
with:
name: coverage-pytest-integrative-1
path: atomsci/ddm/test/integrative/**/.coverage*
include-hidden-files: true
if-no-files-found: error
pytest-integrative-2:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: System Dependencies
run: |
sudo apt-get update
sudo apt install -y build-essential \
libcairo2-dev \
pkg-config \
python3-dev \
python3-openssl
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pip/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3.9 -m pip install --upgrade pip
pip install -e .
if [ -f pip/cpu_requirements.txt ]; then pip install -r pip/cpu_requirements.txt; fi
if [ -f pip/dev_requirements.txt ]; then pip install -r pip/dev_requirements.txt; fi
- name: pytest
run: |
# TODO: Run this test with pytest for paralell testing
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 1
echo 'done'
env:
ENV: test
- name: Debug - Find all coverage files
run: |
echo "=== Current directory ==="
pwd
echo ""
echo "=== Contents of current directory ==="
ls -la
echo ""
echo "=== Searching for ALL .coverage files recursively ==="
find . -name ".coverage*" -type f 2>/dev/null || echo "No .coverage files found"
echo ""
echo "=== Contents of test directory ==="
ls -la atomsci/ddm/test/integrative/ || echo "Directory not found"
echo ""
echo "=== Checking if coverage was even run ==="
which coverage
coverage --version || echo "Coverage not installed"
- name: Save coverage
uses: actions/upload-artifact@v4
with:
name: coverage-pytest-integrative-2
path: atomsci/ddm/test/integrative/**/.coverage*
include-hidden-files: true
if-no-files-found: error
pytest-integrative-3:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: System Dependencies
run: |
sudo apt-get update
sudo apt install -y build-essential \
libcairo2-dev \
pkg-config \
python3-dev \
python3-openssl
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pip/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3.9 -m pip install --upgrade pip
pip install -e .
if [ -f pip/cpu_requirements.txt ]; then pip install -r pip/cpu_requirements.txt; fi
if [ -f pip/dev_requirements.txt ]; then pip install -r pip/dev_requirements.txt; fi
- name: pytest
run: |
# TODO: Run this test with pytest for paralell testing
# python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv atomsci/ddm/test/integrative
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 2
env:
ENV: test
- name: Debug - Find all coverage files
run: |
echo "=== Current directory ==="
pwd
echo ""
echo "=== Contents of current directory ==="
ls -la
echo ""
echo "=== Searching for ALL .coverage files recursively ==="
find . -name ".coverage*" -type f 2>/dev/null || echo "No .coverage files found"
echo ""
echo "=== Contents of test directory ==="
ls -la atomsci/ddm/test/integrative/ || echo "Directory not found"
echo ""
echo "=== Checking if coverage was even run ==="
which coverage
coverage --version || echo "Coverage not installed"
- name: Save coverage
uses: actions/upload-artifact@v4
with:
name: coverage-pytest-integrative-3
path: atomsci/ddm/test/integrative/**/.coverage*
include-hidden-files: true
if-no-files-found: error
pytest-integrative-4:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: System Dependencies
run: |
sudo apt-get update
sudo apt install -y build-essential \
libcairo2-dev \
pkg-config \
python3-dev \
python3-openssl
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pip/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3.9 -m pip install --upgrade pip
pip install -e .
if [ -f pip/cpu_requirements.txt ]; then pip install -r pip/cpu_requirements.txt; fi
if [ -f pip/dev_requirements.txt ]; then pip install -r pip/dev_requirements.txt; fi
- name: pytest
run: |
# TODO: Run this test with pytest for paralell testing
# python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv atomsci/ddm/test/integrative
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 3
env:
ENV: test
- name: Debug - Find all coverage files
run: |
echo "=== Current directory ==="
pwd
echo ""
echo "=== Contents of current directory ==="
ls -la
echo ""
echo "=== Searching for ALL .coverage files recursively ==="
find . -name ".coverage*" -type f 2>/dev/null || echo "No .coverage files found"
echo ""
echo "=== Contents of test directory ==="
ls -la atomsci/ddm/test/integrative/ || echo "Directory not found"
echo ""
echo "=== Checking if coverage was even run ==="
which coverage
coverage --version || echo "Coverage not installed"
- name: Save coverage
uses: actions/upload-artifact@v4
with:
name: coverage-pytest-integrative-4
path: atomsci/ddm/test/integrative/**/.coverage*
include-hidden-files: true
if-no-files-found: error
coverage-merge:
runs-on: ubuntu-24.04
needs: [pytest-unit, pytest-integrative-1, pytest-integrative-2, pytest-integrative-3, pytest-integrative-4]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install coverage
run: pip install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v5
with:
path: coverage-reports
- name: Merge coverage reports
run: |
# List directory structure for debugging
ls -la
ls -la coverage-reports/ || echo "coverage-reports directory not found"
# Find and combine all coverage files
find coverage-reports -name ".coverage*" -type f
# Combine all coverage files
coverage combine $(find coverage-reports -name ".coverage*" -type f -print)
# Generate XML report for codecov
coverage xml
- name: Upload merged coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}