Skip to content

Migrate broken tests to ET_SKIP_IF macro (#19659)#19659

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D105645070
May 19, 2026
Merged

Migrate broken tests to ET_SKIP_IF macro (#19659)#19659
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D105645070

Conversation

@metascroy
Copy link
Copy Markdown
Contributor

@metascroy metascroy commented May 19, 2026

Summary:

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 #includes 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

@metascroy metascroy requested a review from manuelcandales as a code owner May 19, 2026 00:33
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 19, 2026

🔗 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 SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

⏳ No Failures, 1 Pending

As of commit e7e74d5 with merge base f3387d0 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 19, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 19, 2026

@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105645070.

@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

metascroy added a commit to metascroy/executorch that referenced this pull request May 19, 2026
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
@metascroy metascroy force-pushed the export-D105645070 branch from 293c212 to 19e45e2 Compare May 19, 2026 00:37
@meta-codesync meta-codesync Bot changed the title Migrate broken tests to ET_SKIP_IF macro Migrate broken tests to ET_SKIP_IF macro (#19659) May 19, 2026
metascroy added a commit to metascroy/executorch that referenced this pull request May 19, 2026
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
@metascroy metascroy force-pushed the export-D105645070 branch from 19e45e2 to e5d1c33 Compare May 19, 2026 00:51
metascroy added a commit to metascroy/executorch that referenced this pull request May 19, 2026
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
@metascroy metascroy force-pushed the export-D105645070 branch from e5d1c33 to 4c90d7b Compare May 19, 2026 00:59
metascroy added a commit to metascroy/executorch that referenced this pull request May 19, 2026
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
@metascroy metascroy force-pushed the export-D105645070 branch from 4c90d7b to 4581519 Compare May 19, 2026 16:55
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
@metascroy metascroy force-pushed the export-D105645070 branch from 4581519 to e7e74d5 Compare May 19, 2026 17:02
@meta-codesync meta-codesync Bot merged commit 6bc1762 into pytorch:main May 19, 2026
177 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants