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
When --test_filter is set, Bazel will encode its value in the TESTBRIDGE_TEST_ONLY environment variable (see Test Encyclopedia). rules_jest should read this value if it is set and filter test specs accordingly.
The text was updated successfully, but these errors were encountered:
const jestTestFilter: Filter = async testPaths => {
if ('TESTBRIDGE_TEST_ONLY' in process.env) {
const issuesFilterRegexp = new RegExp(process.env.TESTBRIDGE_TEST_ONLY!)
const filteringFunction = (testPath: string) => issuesFilterRegexp.test(testPath)
const allowedPaths = testPaths.filter(filteringFunction).map(test => ({
test,
message: `This test suite was selected by value --test_filter=${process.env.TESTBRIDGE_TEST_ONLY}`
}))
return {
filtered: allowedPaths
}
} else {
return {
filtered: testPaths.map(test => ({ test }))
}
}
}
module.exports = jestTestFilter
// taken from @jest/core
type Filter = ( testPaths: Array<string> ) => Promise<{ filtered: Array<FilterResult> }>
type FilterResult = {
test: string
message?: string
}
However, we should not enable sharding when --test_filter= is used. Is it possible to set shard_count to zero when --test_filter contains a non-default value? Or the only way to go is always to pass --test_sharding_strategy=disabled?
@jbedard Specifying the test filter usually means that we will execute much fewer suite files. In most situations, it is used to test only a single suite, and in such cases, all other shards will return exit code 1 because spawned with an empty suites list.
What is the current behavior?
Not supported
Describe the feature
When --test_filter is set, Bazel will encode its value in the
TESTBRIDGE_TEST_ONLY
environment variable (see Test Encyclopedia). rules_jest should read this value if it is set and filter test specs accordingly.The text was updated successfully, but these errors were encountered: