Skip to content

Conversation

@ProExpertProg
Copy link
Collaborator

@ProExpertProg ProExpertProg commented Dec 7, 2025

Purpose

Compilation tests were using the find command, which does not propagate errors, so the CI passes even when tests fail.

Test Plan

CI (first commit should fail)


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@ProExpertProg ProExpertProg added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 7, 2025
@mergify mergify bot added the ci/build label Dec 7, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue with test command execution in the Buildkite pipeline by replacing find -exec with a find | xargs pipe. This correctly propagates pytest exit codes, ensuring that test failures are properly reported. However, the new implementation has a potential issue: if find does not locate any test files, the step will pass silently. This could mask problems in the test suite. I've added suggestions to make these steps fail if no test files are found, which will make the CI pipeline more robust.

Comment on lines 473 to 475
- >
find compile/ -maxdepth 1 -name 'test_*.py' -print0 |
xargs -0 -n1 -I{} pytest -s -v "{}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this change correctly propagates pytest exit codes, it introduces an issue where the step will silently pass if find doesn't locate any test files. A test step that is expected to run tests should fail if no tests are found to avoid giving a false sense of security. I suggest adding a check to ensure at least one test file is found.

  - |
    set -e -o pipefail
    found_files=$(find compile/ -maxdepth 1 -name 'test_*.py' -print0)
    if [ -z "$found_files" ]; then
      echo "FAIL: No test files found for PyTorch Compile Smoke Test" >&2
      exit 1
    fi
    printf "%s" "$found_files" | xargs -0 -n1 -I{} pytest -s -v "{}"

Comment on lines 491 to 493
- >
find compile/fullgraph -maxdepth 1 -name 'test_*.py' -not -name 'test_full_graph.py' -print0 |
xargs -0 -n1 -I{} pytest -s -v "{}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the previous comment, this change will cause the test step to pass silently if no test files are found. This can mask issues, for example if test files are accidentally moved or renamed. To ensure the CI pipeline is robust, the step should fail if it's expected to run tests but doesn't find any.

  - |
    set -e -o pipefail
    found_files=$(find compile/fullgraph -maxdepth 1 -name 'test_*.py' -not -name 'test_full_graph.py' -print0)
    if [ -z "$found_files" ]; then
      echo "FAIL: No test files found for PyTorch Fullgraph Smoke Test" >&2
      exit 1
    fi
    printf "%s" "$found_files" | xargs -0 -n1 -I{} pytest -s -v "{}"

Signed-off-by: ProExpertProg <[email protected]>
Signed-off-by: ProExpertProg <[email protected]>
Signed-off-by: ProExpertProg <[email protected]>
Copy link
Collaborator

@ApostaC ApostaC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Just a quick question: what will happen if there is no file found?

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

Labels

ci/build ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants