Skip to content

Fix bug in PercentTrue primitive #67

Fix bug in PercentTrue primitive

Fix bug in PercentTrue primitive #67

name: Tests
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
workflow_dispatch:
jobs:
tests:
name: ${{ matrix.python_version }} tests ${{ matrix.libraries }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
libraries: ["core", "spark/dask - misc", "spark/dask - computational", "spark/dask - entityset_1", "spark/dask - entityset_2", "spark/dask - primitives"]
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Build featuretools package
run: make package
- name: Set up pip and graphviz
run: |
pip config --site set global.progress_bar off
python -m pip install --upgrade pip
sudo apt update && sudo apt install -y graphviz
- if: ${{ !startsWith(matrix.libraries, 'spark/dask') }}
name: Install featuretools with test requirements
run: |
python -m pip install -e unpacked_sdist/
python -m pip install -e unpacked_sdist/[test]
- if: ${{ startsWith(matrix.libraries, 'spark/dask') }}
name: Install spark pkg, featuretools with test requirements and spark/dask requirements
run: |
sudo apt install -y openjdk-11-jre-headless
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
python -m pip install -e unpacked_sdist/[dask]
python -m pip install -e unpacked_sdist/[spark]
python -m pip install -e unpacked_sdist/[test]
- if: ${{ matrix.python_version == 3.8 && startsWith(matrix.libraries, 'spark/dask') }}
name: Generate coverage args
run: echo "coverage_args=--cov=featuretools --cov-config=../pyproject.toml --cov-report=xml:../coverage.xml" >> $GITHUB_ENV
- if: ${{ env.coverage_args }}
name: Erase coverage files
run: |
cd unpacked_sdist
coverage erase
- if: ${{ !startsWith(matrix.libraries, 'spark/dask') }}
name: Run unit tests (no code coverage)
run: |
cd unpacked_sdist
pytest featuretools/ -n auto
- if: ${{ matrix.libraries == 'spark/dask - misc' }}
name: Run unit tests (misc)
run: |
cd unpacked_sdist
pytest featuretools/ -n auto --ignore=featuretools/tests/computational_backend --ignore=featuretools/tests/entityset_tests --ignore=featuretools/tests/primitive_tests ${{ env.coverage_args }}
- if: ${{ matrix.libraries == 'spark/dask - computational' }}
name: Run unit tests (computational backend)
run: |
cd unpacked_sdist
pytest featuretools/tests/computational_backend/ -n auto ${{ env.coverage_args }}
- if: ${{ matrix.libraries == 'spark/dask - entityset_1' }}
name: Run unit tests (entityset batch 1)
run: |
cd unpacked_sdist
pytest featuretools/tests/entityset_tests -n auto --ignore=featuretools/tests/entityset_tests/test_es.py --ignore=featuretools/tests/entityset_tests/test_ww_es.py ${{ env.coverage_args }}
- if: ${{ matrix.libraries == 'spark/dask - entityset_2' }}
name: Run unit tests (entityset batch 2)
run: |
cd unpacked_sdist
pytest featuretools/tests/entityset_tests/test_es.py featuretools/tests/entityset_tests/test_ww_es.py ${{ env.coverage_args }}
- if: ${{ matrix.libraries == 'spark/dask - primitives' }}
name: Run unit tests (primitives)
run: |
cd unpacked_sdist
pytest featuretools/tests/primitive_tests -n auto ${{ env.coverage_args }}
- if: ${{ env.coverage_args }}
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ${{ github.workspace }}/coverage.xml
verbose: true
win_unit_tests:
name: ${{ matrix.python_version }} windows unit tests
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Download miniconda
shell: pwsh
run: |
$File = "Miniconda3-latest-Windows-x86_64.exe"
$Uri = "https://repo.anaconda.com/miniconda/$File"
$ProgressPreference = "silentlyContinue"
Invoke-WebRequest -Uri $Uri -Outfile "$env:USERPROFILE/$File"
$hashFromFile = Get-FileHash "$env:USERPROFILE/$File" -Algorithm SHA256
$hashFromUrl = "00e8370542836862d4c790aa8966f1d7344a8addd4b766004febcb23f40e2914"
if ($hashFromFile.Hash -ne "$hashFromUrl") {
Throw "$File hashes do not match"
}
- name: Install miniconda
shell: cmd
run: start /wait "" %UserProfile%\Miniconda3-latest-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Miniconda3
- name: Create python ${{ matrix.python_version }} environment
shell: pwsh
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda create -n featuretools python=${{ matrix.python_version }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install featuretools with test requirements
shell: pwsh
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda activate featuretools
conda config --add channels conda-forge
conda install -q -y -c conda-forge python-graphviz graphviz
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Run unit tests
run: |
. $env:USERPROFILE\Miniconda3\shell\condabin\conda-hook.ps1
conda activate featuretools
pytest featuretools\ -n auto