feat: implement fixmeinci modifier to conditionally skip tests in CI environments #35106
+306
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a new test modifier
.fixmeinci()
which allows tests to be conditionally skipped in CI environments while still running normally in local development environments. This feature helps address flaky or environment-specific tests that may not be reliable in CI pipelines but are still valuable for local testing.Features
.fixmeinci()
modifier for test cases and test suitesImplementation Details
1. Added Type Definitions and Interfaces
RunnableType
definition intimeoutManager.ts
to include the newfixmeinci
typeModifier
type intest.ts
to includefixmeinci
as a valid modifier type2. Test and Suite-Level Implementations
test.fixmeinci()
method with support for chaining (e.g.,test.fixmeinci.skip()
)test.describe.fixmeinci()
for suite-level skipping3. Runtime Logic
processAnnotation
function inworkerMain.ts
to:fixmeinci
annotations tofixme
annotations in CI environments4. CI Environment Detection
process.env.CI
using!!process.env.CI
to handle various truthy values5. Test Coverage
test-fixmeinci.spec.ts
) with scenarios for:fixmeinci
fixmeinci
fixmeinci
with other modifiersCode Examples
Test Case Usage
Suite Usage
Testing Strategy
Tests cover both positive and negative scenarios:
Benefits
test.skip()
andtest.fixme()
Future Considerations
Documentation Update
Update to the internal documentation to reflect the new modifier:
Related Issues
This feature helps address common issues with flaky tests in CI pipelines without removing test coverage for local development.