Migrate broken tests to ET_SKIP_IF macro (#19659)#19659
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19659
Note: Links to docs will display an error until the docs builds have been completed. ❗ 2 Active SEVsThere are 2 currently active SEVs. If your PR is affected, please view them below: ⏳ No Failures, 1 PendingAs of commit e7e74d5 with merge base f3387d0 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105645070. |
This PR needs a
|
Summary: Pull Request resolved: pytorch#19659 Follow-up to D105634345 -- migrate the remaining `if (cond) { GTEST_SKIP() << reason; }` sites in `executorch/kernels/test/op_*_test.cpp` (and `UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp`) to the new `ET_SKIP_IF(cond, reason)` macro introduced in that diff. # Why In fbcode, TestX flags any test that consistently calls `GTEST_SKIP()` at runtime as "broken" / `ConsistentlySkipping`. The `SupportedFeatures::get()->X` guards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks. `ET_SKIP_IF` keeps the OSS `GTEST_SKIP` behavior and rewrites the fbcode build to an early `return;` so the test reports PASS. See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/. # What is in this diff Mechanical migration of ~219 sites across 84 test files. The transform: ``` if (cond) { GTEST_SKIP() << "reason"; } ``` becomes: ``` ET_SKIP_IF(cond, "reason"); ``` Each migrated file now `#include`s `executorch/kernels/test/supported_features_skip.h` (where the macro lives). xplat mirrors are updated alongside their fbcode counterparts. A handful of edge cases needed manual handling: * `op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized` -- the `GTEST_SKIP` site has a sibling `expect_failure();` inside the `if`. Kept the `if` block and used `ET_SKIP_IF(true, ...)` after the failure check so the early-return semantics still match the original skip. * `op_scalar_tensor_test.cpp::GENERATE_TEST` -- `GTEST_SKIP` lived inside a `#define` macro with `\` line continuations; rewritten to a multi-line `ET_SKIP_IF` with line continuations. * `op_split_copy_test.cpp::DtypeMismatchDies` -- unconditional `GTEST_SKIP()` (no `if`); converted to `ET_SKIP_IF(true, ...)` so the test returns PASS in fbcode and continues to SKIP in OSS. OSS behavior is unchanged in every case: the macro expands to the prior `if (cond) GTEST_SKIP() << reason;` form. Differential Revision: D105645070
293c212 to
19e45e2
Compare
Summary: Pull Request resolved: pytorch#19659 Follow-up to D105634345 -- migrate the remaining `if (cond) { GTEST_SKIP() << reason; }` sites in `executorch/kernels/test/op_*_test.cpp` (and `UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp`) to the new `ET_SKIP_IF(cond, reason)` macro introduced in that diff. # Why In fbcode, TestX flags any test that consistently calls `GTEST_SKIP()` at runtime as "broken" / `ConsistentlySkipping`. The `SupportedFeatures::get()->X` guards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks. `ET_SKIP_IF` keeps the OSS `GTEST_SKIP` behavior and rewrites the fbcode build to an early `return;` so the test reports PASS. See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/. # What is in this diff Mechanical migration of ~219 sites across 84 test files. The transform: ``` if (cond) { GTEST_SKIP() << "reason"; } ``` becomes: ``` ET_SKIP_IF(cond, "reason"); ``` Each migrated file now `#include`s `executorch/kernels/test/supported_features_skip.h` (where the macro lives). xplat mirrors are updated alongside their fbcode counterparts. A handful of edge cases needed manual handling: * `op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized` -- the `GTEST_SKIP` site has a sibling `expect_failure();` inside the `if`. Kept the `if` block and used `ET_SKIP_IF(true, ...)` after the failure check so the early-return semantics still match the original skip. * `op_scalar_tensor_test.cpp::GENERATE_TEST` -- `GTEST_SKIP` lived inside a `#define` macro with `\` line continuations; rewritten to a multi-line `ET_SKIP_IF` with line continuations. * `op_split_copy_test.cpp::DtypeMismatchDies` -- unconditional `GTEST_SKIP()` (no `if`); converted to `ET_SKIP_IF(true, ...)` so the test returns PASS in fbcode and continues to SKIP in OSS. OSS behavior is unchanged in every case: the macro expands to the prior `if (cond) GTEST_SKIP() << reason;` form. Differential Revision: D105645070
19e45e2 to
e5d1c33
Compare
Summary: Pull Request resolved: pytorch#19659 Follow-up to D105634345 -- migrate the remaining `if (cond) { GTEST_SKIP() << reason; }` sites in `executorch/kernels/test/op_*_test.cpp` (and `UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp`) to the new `ET_SKIP_IF(cond, reason)` macro introduced in that diff. # Why In fbcode, TestX flags any test that consistently calls `GTEST_SKIP()` at runtime as "broken" / `ConsistentlySkipping`. The `SupportedFeatures::get()->X` guards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks. `ET_SKIP_IF` keeps the OSS `GTEST_SKIP` behavior and rewrites the fbcode build to an early `return;` so the test reports PASS. See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/. # What is in this diff Mechanical migration of ~219 sites across 84 test files. The transform: ``` if (cond) { GTEST_SKIP() << "reason"; } ``` becomes: ``` ET_SKIP_IF(cond, "reason"); ``` Each migrated file now `#include`s `executorch/kernels/test/supported_features_skip.h` (where the macro lives). xplat mirrors are updated alongside their fbcode counterparts. A handful of edge cases needed manual handling: * `op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized` -- the `GTEST_SKIP` site has a sibling `expect_failure();` inside the `if`. Kept the `if` block and used `ET_SKIP_IF(true, ...)` after the failure check so the early-return semantics still match the original skip. * `op_scalar_tensor_test.cpp::GENERATE_TEST` -- `GTEST_SKIP` lived inside a `#define` macro with `\` line continuations; rewritten to a multi-line `ET_SKIP_IF` with line continuations. * `op_split_copy_test.cpp::DtypeMismatchDies` -- unconditional `GTEST_SKIP()` (no `if`); converted to `ET_SKIP_IF(true, ...)` so the test returns PASS in fbcode and continues to SKIP in OSS. OSS behavior is unchanged in every case: the macro expands to the prior `if (cond) GTEST_SKIP() << reason;` form. Differential Revision: D105645070
e5d1c33 to
4c90d7b
Compare
Summary: Pull Request resolved: pytorch#19659 Follow-up to D105634345 -- migrate the remaining `if (cond) { GTEST_SKIP() << reason; }` sites in `executorch/kernels/test/op_*_test.cpp` (and `UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp`) to the new `ET_SKIP_IF(cond, reason)` macro introduced in that diff. # Why In fbcode, TestX flags any test that consistently calls `GTEST_SKIP()` at runtime as "broken" / `ConsistentlySkipping`. The `SupportedFeatures::get()->X` guards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks. `ET_SKIP_IF` keeps the OSS `GTEST_SKIP` behavior and rewrites the fbcode build to an early `return;` so the test reports PASS. See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/. # What is in this diff Mechanical migration of ~219 sites across 84 test files. The transform: ``` if (cond) { GTEST_SKIP() << "reason"; } ``` becomes: ``` ET_SKIP_IF(cond, "reason"); ``` Each migrated file now `#include`s `executorch/kernels/test/supported_features_skip.h` (where the macro lives). xplat mirrors are updated alongside their fbcode counterparts. A handful of edge cases needed manual handling: * `op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized` -- the `GTEST_SKIP` site has a sibling `expect_failure();` inside the `if`. Kept the `if` block and used `ET_SKIP_IF(true, ...)` after the failure check so the early-return semantics still match the original skip. * `op_scalar_tensor_test.cpp::GENERATE_TEST` -- `GTEST_SKIP` lived inside a `#define` macro with `\` line continuations; rewritten to a multi-line `ET_SKIP_IF` with line continuations. * `op_split_copy_test.cpp::DtypeMismatchDies` -- unconditional `GTEST_SKIP()` (no `if`); converted to `ET_SKIP_IF(true, ...)` so the test returns PASS in fbcode and continues to SKIP in OSS. OSS behavior is unchanged in every case: the macro expands to the prior `if (cond) GTEST_SKIP() << reason;` form. Differential Revision: D105645070
4c90d7b to
4581519
Compare
Summary: Pull Request resolved: pytorch#19659 Follow-up to D105634345 -- migrate the remaining `if (cond) { GTEST_SKIP() << reason; }` sites in `executorch/kernels/test/op_*_test.cpp` (and `UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp`) to the new `ET_SKIP_IF(cond, reason)` macro introduced in that diff. # Why In fbcode, TestX flags any test that consistently calls `GTEST_SKIP()` at runtime as "broken" / `ConsistentlySkipping`. The `SupportedFeatures::get()->X` guards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks. `ET_SKIP_IF` keeps the OSS `GTEST_SKIP` behavior and rewrites the fbcode build to an early `return;` so the test reports PASS. See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/. # What is in this diff Mechanical migration of ~219 sites across 84 test files. The transform: ``` if (cond) { GTEST_SKIP() << "reason"; } ``` becomes: ``` ET_SKIP_IF(cond, "reason"); ``` Each migrated file now `#include`s `executorch/kernels/test/supported_features_skip.h` (where the macro lives). xplat mirrors are updated alongside their fbcode counterparts. A handful of edge cases needed manual handling: * `op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized` -- the `GTEST_SKIP` site has a sibling `expect_failure();` inside the `if`. Kept the `if` block and used `ET_SKIP_IF(true, ...)` after the failure check so the early-return semantics still match the original skip. * `op_scalar_tensor_test.cpp::GENERATE_TEST` -- `GTEST_SKIP` lived inside a `#define` macro with `\` line continuations; rewritten to a multi-line `ET_SKIP_IF` with line continuations. * `op_split_copy_test.cpp::DtypeMismatchDies` -- unconditional `GTEST_SKIP()` (no `if`); converted to `ET_SKIP_IF(true, ...)` so the test returns PASS in fbcode and continues to SKIP in OSS. OSS behavior is unchanged in every case: the macro expands to the prior `if (cond) GTEST_SKIP() << reason;` form. Differential Revision: D105645070
4581519 to
e7e74d5
Compare
Summary:
Follow-up to D105634345 -- migrate the remaining
if (cond) { GTEST_SKIP() << reason; }sites inexecutorch/kernels/test/op_*_test.cpp(andUnaryUfuncRealHBBF16ToFloatHBF16Test.cpp) to the newET_SKIP_IF(cond, reason)macro introduced in that diff.Why
In fbcode, TestX flags any test that consistently calls
GTEST_SKIP()at runtime as "broken" /ConsistentlySkipping. TheSupportedFeatures::get()->Xguards are statically known per kernel variant -- they aren't infra failures, the test just doesn't apply -- but they still trip the broken-test signal and file oncall tasks.ET_SKIP_IFkeeps the OSSGTEST_SKIPbehavior and rewrites the fbcode build to an earlyreturn;so the test reports PASS.See D105634345, T208053850, https://fb.workplace.com/groups/testinfra.discuss/permalink/2044665472719153/.
What is in this diff
Mechanical migration of ~219 sites across 84 test files. The transform:
becomes:
Each migrated file now
#includesexecutorch/kernels/test/supported_features_skip.h(where the macro lives). xplat mirrors are updated alongside their fbcode counterparts.A handful of edge cases needed manual handling:
op_log_softmax_test.cpp::TestForwardWithLargeNumbersOptimized-- theGTEST_SKIPsite has a siblingexpect_failure();inside theif. Kept theifblock and usedET_SKIP_IF(true, ...)after the failure check so the early-return semantics still match the original skip.op_scalar_tensor_test.cpp::GENERATE_TEST--GTEST_SKIPlived inside a#definemacro with\line continuations; rewritten to a multi-lineET_SKIP_IFwith line continuations.op_split_copy_test.cpp::DtypeMismatchDies-- unconditionalGTEST_SKIP()(noif); converted toET_SKIP_IF(true, ...)so the test returns PASS in fbcode and continues to SKIP in OSS.OSS behavior is unchanged in every case: the macro expands to the prior
if (cond) GTEST_SKIP() << reason;form.Differential Revision: D105645070