Skip to content

[WIP][INFRA] Add smart class-level test selection for post-merge CI#57461

Draft
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:ai-test-selection-post-merge-ci
Draft

[WIP][INFRA] Add smart class-level test selection for post-merge CI#57461
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:ai-test-selection-post-merge-ci

Conversation

@zhengruifeng

@zhengruifeng zhengruifeng commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This draft adds a dedicated smart class-level post-merge test-selection workflow without changing the existing build_and_test.yml workflow.

For trusted Apache Spark pushes, with this draft branch temporarily allowed in the personal fork for verification, the workflow uses Copilot CLI according to the Copilot CLI Actions guidance. The CLI receives a separate, read-only prompt for the pushed tip commit. It analyzes the actual diff, class hierarchies, and test call sites, and considers runnable PySpark doctests for changed docstrings.

The helper validates every proposed target against the checkout before execution, accepts only Scala or Java JVM suites and importable PySpark test modules, excludes R tests, and retains at most 20 targets of each type. A precompile job builds Spark once when targets were selected. The dependent JVM and Python jobs run in parallel and execute each selected class or module individually. The JVM runner resolves each suite to its SBT test project and invokes testOnly; the Python runner uses python/run-tests --testnames.

Why are the changes needed?

Post-merge changes benefit from quick, focused feedback in addition to the existing deterministic CI. Selecting validated class-level tests by dependency, hierarchy, and call-site relevance reduces unrelated test execution while retaining the existing build and test workflows as independent coverage.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • Ran conda run -n spark-dev-313 ./dev/lint-python.
  • Ran git diff --check.
  • Validated representative JVM, Java, PySpark, and doctest targets with dev/smart_test_selection.py.
  • Verified the JVM runner command construction with a mocked subprocess.
  • No full Spark test suite was run; the dedicated GitHub Actions workflow is being verified on this draft branch.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Codex (GPT-5)

@zhengruifeng zhengruifeng changed the title [WIP][INFRA] Add precise AI test selection to post-merge CI [WIP][INFRA] Add class-level AI test selection to post-merge CI Jul 23, 2026
@zhengruifeng zhengruifeng changed the title [WIP][INFRA] Add class-level AI test selection to post-merge CI [WIP][INFRA] Add AI-based class-level test selection for post-merge CI Jul 23, 2026
@zhengruifeng
zhengruifeng force-pushed the ai-test-selection-post-merge-ci branch 3 times, most recently from ccd9d1b to 8b70554 Compare July 24, 2026 03:51
@zhengruifeng zhengruifeng changed the title [WIP][INFRA] Add AI-based class-level test selection for post-merge CI [WIP][INFRA] Add smart class-level test selection for post-merge CI Jul 24, 2026
@zhengruifeng
zhengruifeng force-pushed the ai-test-selection-post-merge-ci branch 14 times, most recently from 0050761 to bb3dfb3 Compare July 24, 2026 10:46
@zhengruifeng
zhengruifeng force-pushed the ai-test-selection-post-merge-ci branch from bb3dfb3 to f00dc64 Compare July 24, 2026 10:52
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