Skip to content

test: run tests/core_tests in CI and cover all test_conditionals combinations - #3081

Open
havogt wants to merge 2 commits into
mainfrom
havogt/test-conditionals-core
Open

havogt wants to merge 2 commits into
mainfrom
havogt/test-conditionals-core

Conversation

@havogt

@havogt havogt commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Two test-coverage gaps:

  • tests/core_tests was not run by any nox session or CI job, so the gt4py._core unit tests (dlpack, BufferInfo, filecache, file_utils, nd_array_utils) only ran under a bare pytest. This adds a test_core nox session, parametrized by device like test_storage, and wires it into test-components.yml (cpu), the daily CI and the CSCS matrix (next to storage, on cpu/cuda13/rocm7). The cpu session also installs jax and torch for the requires_jax/requires_torch tests. The gpu sessions exclude those, since they would need the device-specific jax/torch builds.
  • test_simple_if_conditional, test_nested_if_stmt_conditional and test_if_without_else in test_conditionals.py used parametrize("condition1, condition2", [[True, False], [True, False]]), which runs (True, False) twice and never the other three combinations, although the references were already written for all four. They now parametrize the two conditions independently.

@havogt
havogt added this pull request to stack #3083 December 3, 2026 17:36
@havogt havogt changed the title havogt/test conditionals core test: run tests/core_tests in CI and cover all test_conditionals combinations Dec 3, 2026
@havogt

havogt commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Written by an agent on behalf of @havogt

@havogt
havogt marked this pull request as ready for review December 3, 2026 19:25
@havogt
havogt requested a review from egparedes December 3, 2026 19:25
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
✅ Merge recommendation: Needs review
🔎 Failure modes

What: The three conditional tests now run the full (condition1, condition2) cross-product instead of the previously duplicated (True, False) case. Combinations like (True, True) and (False, True) have never been executed, so the first CI run may fail if any backend in the matrix mishandles them.
Where: tests/next_tests/integration_tests/feature_tests/ffront_tests/test_conditionals.py:test_simple_if_conditional
Trigger: First CI run of the backend matrix with the new 4-combination parametrization.
Detected by: The existing test_next CI sessions, which execute these tests across the backend matrix.
Covered in this PR: Yes

What: The cpu variant of the new test_core session appends the jax extra unconditionally, while torch is guarded by _session_runs_torch. If jax cannot be resolved for one of the targeted Python versions or platforms (e.g. macOS runners in daily-ci), the session fails during venv setup rather than degrading gracefully.
Where: noxfile.py:test_core
Trigger: Running test_core(cpu) on a Python version or platform where the jax extra has no compatible wheels.
Detected by: Install failure of the test_core job in test-components.yml or daily-ci.yml.
Covered in this PR: No

🏅 Score: 90
🧪 PR contains tests
🔒 No security concerns identified
🔀 Multiple PR themes

Sub-PR theme: test[next]: cover all condition1/condition2 combinations in test_conditionals

Relevant files:

  • tests/next_tests/integration_tests/feature_tests/ffront_tests/test_conditionals.py

Sub-PR theme: ci: add test_core nox session and run tests/core_tests in CI

Relevant files:

  • noxfile.py
  • .github/workflows/daily-ci.yml
  • .github/workflows/test-components.yml
  • .cscs-ci/default.yml
  • nox-sessions-config.yml

⚡ No major issues detected

⚙️ Agent run details
  • Model: openai/zai-org/GLM-5.3-Flash
  • Tokens: 9,634 in / 13,281 out / 22,915 total
  • Time cost: 129.7s
  • AI calls: 1

This branch was successfully deployed

1 active deployment
pr-agent — 44e757e6 Deployed Dec 3, 2026 by havogt via pr-agent / pr-agent #303
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.

1 participant