Pere Menal-Ferrer ca812852d6
ci/nox-setup-testing (#21377)
* Make pytest to user code from src rather than from install package

* Fix test_amundsen: missing None

* Update pytest configuration to use importlib mode

* Fix custom_basemodel_validation to check model_fields on type(values) to prevent noisy warnings

* Refactor referencedByQueries validation to use field_validator as per deprecation warning

* Update ColumnJson to use model_rebuild rather as replacement for forward reference updates as per deprecation warning

* Move superset test to integration test as they are using testcontainers

* Update coverage source path

* Fix wrong import.

* Add install_dev_env target to Makefile for development dependencies

* Add test-unit as extra in setup.py

* Modify dependencies in dev environment.

* Ignore all airflow tests

* Remove coverage in unit_ingestion_dev_env. Revert coverage source to prevent broken CI.

* Add nox for running unit test

* FIx PowerBI integration test to use pathlib for resource paths and not os.getcwd to prevent failures when not executed from the right path

* Move test_helpers.py to unit test, as it is not an integration test.

* Remove utils empty folder in integration tests

* Refactor testcontainers configuration to avoid pitfalls with max_tries setting

* Add nox unit testing basic setup

* Add format check session

* Refactor nox-unit and add plugins tests

* Add GHA for py-nox-ci

* Add comment to GHA

* Restore conftest.py file

* Clarify comment

* Simplify function

* Fix matrix startegy and nox mismatch

* Improve python version strategy with nox and GHA

---------

Co-authored-by: Pere Menal <pere.menal@getcollate.io>
2025-05-27 10:56:52 +02:00

43 lines
1.3 KiB
YAML

name: Python Nox CI
# This is a temporary workflow to run format and unit tests using Nox.
# It is intended to be manually triggered and will not run on pull requests or pushes.
# Once this is fully tested and stable, we might replace the existing Python CI workflow with this one
# to speed it up and simplify the process.
on:
workflow_dispatch: # Manual trigger only
jobs:
format-and-unit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv and nox
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
pip install nox
- name: Run Code Quality Checks
# We only want to check the format for a single Python version,
# no need to run it for all versions
if: ${{ matrix.python-version == '3.10' }}
run: |
nox -s lint
- name: Run Unit Tests
run: |
PYTHON_VERSIONS="${{ matrix.python-version }}" nox -s unit
- name: Run Unit Tests (specific plugins)
run: |
PYTHON_VERSIONS="${{ matrix.python-version }}" nox -s unit-plugins