You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Pull Request resolved: #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
0 commit comments