Skip to content

Add single-stream GritQL test fixture and test harness - #6

Open
covingtron wants to merge 1 commit into
mainfrom
add-test-case-for-single-stream-rule
Open

Add single-stream GritQL test fixture and test harness#6
covingtron wants to merge 1 commit into
mainfrom
add-test-case-for-single-stream-rule

Conversation

@covingtron

Copy link
Copy Markdown
Contributor

Motivation

  • Capture the supplied SQLite as_sqlite example as the input fixture for the forthcoming single-stream GritQL rule so the rule can be exercised against a real-world example.
  • Record an explicit (empty) after fixture to represent the requested expected output for the rule.
  • Provide a reproducible way to run all GritQL pattern examples from pytest so patterns can be validated in CI.

Description

  • Added the single-stream fixtures tests/fixtures/single-stream/before.py (the provided as_sqlite example) and tests/fixtures/single-stream/after.py (empty expected output).
  • Added a Grit pattern and configuration under .grit/ with .grit/grit.yaml and .grit/patterns/inline_single_use_assignment.md to capture the inline single-use assignment rule.
  • Introduced a pytest wrapper tests/test_patterns.py that invokes the native grit patterns test --verbose runner against a copy of .grit.
  • Added project metadata, packaging helper, CI workflows, and development files (pyproject.toml, build_backend.py, requirements.txt, .github/workflows/act.yaml, .github/workflows/package.yaml, .gitignore, and .grit/.gitignore) to support running the GritQL tests and building wheels for the bundled Grit CLI.

Testing

  • Ran python -m py_compile tests/fixtures/single-stream/before.py tests/fixtures/single-stream/after.py and it succeeded.
  • Ran repository checks git diff --cached --check and git show --check --stat --oneline HEAD to validate there are no staged whitespace/errors and both checks completed without errors.
  • The pytest-driven GritQL test runner (tests/test_patterns.py) is provided but was not executed in this environment; it expects an installed grit binary and will be invoked by CI or in a developer environment via pytest.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant