@@ -84,13 +84,20 @@ describe('the real tree', () => {
8484 test ( 'the whole-bundle lanes skip the runner server entry point, which is not a test' , ( ) => {
8585 // The whole reason -skip-testing: exists in this repo. `testCommand` opens an
8686 // NWListener and waits 24 hours; an unfiltered run would hang the lane to its timeout.
87- const skipped = loadReport ( repoRoot ) . flagged . filter ( ( entry ) => entry . flag === 'skip-testing' ) ;
87+ const report = loadReport ( repoRoot ) ;
88+ const skipped = report . flagged . filter ( ( entry ) => entry . flag === 'skip-testing' ) ;
8889 for ( const entry of LANES . filter ( ( entry ) => entry . selection === 'whole' ) ) {
8990 expect (
9091 skipped . filter ( ( flag ) => flag . workflow === entry . workflow ) . map ( ( flag ) => flag . identifier ) ,
9192 ) . toContain ( ENTRY_POINT ) ;
9293 }
93- for ( const entry of skipped ) expect ( entry . identifier ) . toBe ( ENTRY_POINT ) ;
94+ for ( const entry of skipped ) {
95+ if ( entry . identifier === ENTRY_POINT ) continue ;
96+ // A real test may be excluded from the shared process only if another invocation
97+ // on the same lane still reaches it. Removing the isolated run must fail this.
98+ const current = LANES . find ( ( lane ) => lane . workflow === entry . workflow ) ! ;
99+ expect ( report . reach [ current . id ] . has ( entry . identifier ) ) . toBe ( true ) ;
100+ }
94101 } ) ;
95102
96103 test ( 'the simulator-only tests are exactly the ones the macOS build compiles out' , ( ) => {
@@ -296,6 +303,40 @@ describe('a planted guard', () => {
296303 } ) ;
297304} ) ;
298305
306+ describe ( 'isolated invocations' , ( ) => {
307+ const isolated = `${ TARGET } /RunnerTests/testIsolated` ;
308+ const swift = source ( `${ ENTRY_SOURCE } extension RunnerTests {\n func testIsolated() {}\n}\n` ) ;
309+ const shared = `xcodebuild test-without-building -skip-testing:${ ENTRY_POINT } -skip-testing:${ isolated } ` ;
310+
311+ test ( 'a separate selected invocation restores a test skipped by the shared process' , ( ) => {
312+ const report = buildReport ( TARGET , swift , [
313+ ...laneWorkflows ( ) . filter ( ( entry ) => entry . workflow !== NIGHTLY_WORKFLOW_FILE ) ,
314+ {
315+ workflow : NIGHTLY_WORKFLOW_FILE ,
316+ text : `xcodebuild test-without-building -only-testing:${ isolated } \n${ shared } ` ,
317+ } ,
318+ ] ) ;
319+ expect ( [ ...report . reach . nightly ] ) . toEqual ( [ isolated ] ) ;
320+ expect ( report . entryPointReachedBy ) . toEqual ( [ ] ) ;
321+ } ) ;
322+
323+ test ( 'removing the isolated invocation leaves that test unreachable on nightly' , ( ) => {
324+ const report = buildReport ( TARGET , swift , [
325+ ...laneWorkflows ( ) . filter ( ( entry ) => entry . workflow !== NIGHTLY_WORKFLOW_FILE ) ,
326+ { workflow : NIGHTLY_WORKFLOW_FILE , text : shared } ,
327+ ] ) ;
328+ expect ( report . reach . nightly . has ( isolated ) ) . toBe ( false ) ;
329+ } ) ;
330+
331+ test ( 'a skip still wins over an only flag in the same invocation' , ( ) => {
332+ const report = buildReport ( TARGET , swift , [
333+ ...laneWorkflows ( ) . filter ( ( entry ) => entry . workflow !== NIGHTLY_WORKFLOW_FILE ) ,
334+ { workflow : NIGHTLY_WORKFLOW_FILE , text : `${ shared } -only-testing:${ isolated } ` } ,
335+ ] ) ;
336+ expect ( report . reach . nightly . has ( isolated ) ) . toBe ( false ) ;
337+ } ) ;
338+ } ) ;
339+
299340describe ( 'the workflow scan' , ( ) => {
300341 test ( 'reads both flags on the multi-line xcodebuild invocation' , ( ) => {
301342 expect (
0 commit comments