Skip to content

feat(test): add unit test suite and GitHub Actions CI#112

Open
rederik76 wants to merge 6 commits into
mainfrom
feature/unit-testing
Open

feat(test): add unit test suite and GitHub Actions CI#112
rederik76 wants to merge 6 commits into
mainfrom
feature/unit-testing

Conversation

@rederik76

@rederik76 rederik76 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Introduces the first automated unit test suite and PR CI for the Lakeflow Framework.

Unit test harness

  • Shared fixtures: tests/conftest.py, tests/helpers.py, minimal JSON/YAML under tests/fixtures/
  • Layout: tests/unit/ for fast isolated tests, tests/integration/ for script-level checks
  • Default command: pytest tests/ -m "not integration and not spark" (~158 tests, < 30s)
  • Markers: integration, spark, bdd (latter two skipped in CI)

Unit test coverage

Core src/ modules, using fixtures instead of full samples/ trees:

  • Config resolution and bundle loading
  • Logging, substitution, and secrets
  • Dataflow spec pipeline: builder, template processor, spec mapper, transformers, expectations
    Integration tests for validate_dataflows.py are behind the integration marker.

GitHub Actions CI

New .github/workflows/ci.yml on main with parallel, path-filtered jobs:

Job When
Unit tests Always
Docs spelling / HTML docs/** changed — HTML fails above 19 warnings (scripts/ci/docs_html_check.sh)
Sample validation samples/** changed — python scripts/validate_dataflows.py samples/

Contributor docs

  • tests/README.md — layout, markers, local commands, CI matrix
  • contributor_dev_steps.rst — unit testing, sample validation, docs checks; trunk-based workflow targeting main
    Closes #[issue-number]

Test plan

  • pip install --require-hashes --no-deps -r requirements-dev.lock
  • pytest tests/ -m "not integration and not spark" -q
  • pytest tests/ -m integration -q — optional locally
  • python scripts/validate_dataflows.py samples/ — requires jsonschema
  • make -C docs spelling and bash scripts/ci/docs_html_check.sh 19 — if docs changed
  • Confirm CI on PR to main: unit tests always; docs and sample jobs path-filtered
  • After merge: enable branch protection requiring CI on main

rederik76 added 2 commits July 4, 2026 16:11
Introduce shared test fixtures, minimal JSON fixtures, and a unit/
integration test layout. Cover config loading, bundle discovery, logging,
token substitution, secrets, and the dataflow spec pipeline (builder,
template expansion, mapping, transformers, and expectations).

Add broader template_processor tests for validation, YAML templates,
parameter defaults and types, caching, and failure paths.

Register pytest markers for spark, integration, and bdd scenarios.
Add pytest-cov for optional coverage reports and ignore coverage
artifacts in git.
Restore PR checks on main with path-filtered jobs for docs spelling,
HTML build, and sample dataflow validation. Document local equivalents
in tests/README.md and contributor_dev_steps.rst.
@rederik76 rederik76 requested a review from haillew as a code owner July 4, 2026 08:00
PySpark imports distutils, which requires setuptools on Python 3.12+.
Regenerate requirements-dev.lock with --allow-unsafe and fix paths-filter SHA.
@rederik76 rederik76 self-assigned this Jul 4, 2026
@rederik76 rederik76 linked an issue Jul 4, 2026 that may be closed by this pull request
1 task
rederik76 added 3 commits July 4, 2026 20:22
Add dataflow unit tests, fixtures, and integration tests that validate
every sample bundle spec and exercise DataflowSpecBuilder on feature-samples.
Fix validate_dataflows.py to load version mappings from config/default so
legacy specs pass with mapping applied.

Fail docs spelling CI on misspellings, update contributor docs for trunk-based
workflow, refresh script examples for current sample bundles, remove obsolete
develop-build workflow, and bump VERSION to v0.19.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add pytest unit test harness and GitHub Actions CI

1 participant