@@ -103,7 +103,8 @@ public RepositoryMappingValue withMappingForRootModule(
103
103
104
104
@ Test
105
105
public void testSimpleMapping () throws Exception {
106
- rewriteWorkspace (
106
+ scratch .overwriteFile (
107
+ "WORKSPACE" ,
107
108
"workspace(name = 'good')" ,
108
109
"local_repository(" ,
109
110
" name = 'a_remote_repo'," ,
@@ -315,7 +316,8 @@ public void testRepoNameMapping_multipleVersionOverride_lookup() throws Exceptio
315
316
316
317
@ Test
317
318
public void testMultipleRepositoriesWithMapping () throws Exception {
318
- rewriteWorkspace (
319
+ scratch .overwriteFile (
320
+ "WORKSPACE" ,
319
321
"workspace(name = 'good')" ,
320
322
"local_repository(" ,
321
323
" name = 'a_remote_repo'," ,
@@ -354,7 +356,8 @@ public void testMultipleRepositoriesWithMapping() throws Exception {
354
356
355
357
@ Test
356
358
public void testRepositoryWithMultipleMappings () throws Exception {
357
- rewriteWorkspace (
359
+ scratch .overwriteFile (
360
+ "WORKSPACE" ,
358
361
"workspace(name = 'good')" ,
359
362
"local_repository(" ,
360
363
" name = 'a_remote_repo'," ,
@@ -378,8 +381,9 @@ public void testRepositoryWithMultipleMappings() throws Exception {
378
381
}
379
382
380
383
@ Test
381
- public void testMixtureOfBothSystems_workspaceRepo () throws Exception {
382
- rewriteWorkspace (
384
+ public void testMixtureOfBothSystems () throws Exception {
385
+ scratch .overwriteFile (
386
+ "WORKSPACE" ,
383
387
"workspace(name = 'root')" ,
384
388
"local_repository(" ,
385
389
" name = 'ws_repo'," ,
@@ -429,72 +433,6 @@ public void testMixtureOfBothSystems_workspaceRepo() throws Exception {
429
433
.build ()));
430
434
}
431
435
432
- @ Test
433
- public void testMixtureOfBothSystems_mainRepo () throws Exception {
434
- rewriteWorkspace (
435
- "workspace(name = 'root')" ,
436
- "local_repository(" ,
437
- " name = 'ws_repo'," ,
438
- " path = '/ws_repo'," ,
439
- ")" );
440
- scratch .overwriteFile (
441
- "MODULE.bazel" , "module(name='A',version='0.1')" , "bazel_dep(name='B',version='1.0')" );
442
- registry
443
- .addModule (
444
- createModuleKey ("B" , "1.0" ),
445
- "module(name='B', version='1.0');bazel_dep(name='C', version='2.0')" )
446
- .addModule (createModuleKey ("C" , "2.0" ), "module(name='C', version='2.0')" );
447
-
448
- SkyKey skyKey = RepositoryMappingValue .key (RepositoryName .MAIN );
449
- assertThatEvaluationResult (eval (skyKey ))
450
- .hasEntryThat (skyKey )
451
- .isEqualTo (
452
- withMappingForRootModule (
453
- ImmutableMap .of (
454
- RepositoryName .MAIN ,
455
- RepositoryName .MAIN ,
456
- RepositoryName .create ("A" ),
457
- RepositoryName .MAIN ,
458
- RepositoryName .create ("B" ),
459
- RepositoryName .create ("B.1.0" ),
460
- RepositoryName .create ("root" ),
461
- RepositoryName .create ("root" ),
462
- RepositoryName .create ("ws_repo" ),
463
- RepositoryName .create ("ws_repo" )),
464
- RepositoryName .MAIN ));
465
- }
466
-
467
- @ Test
468
- public void testMixtureOfBothSystems_mainRepo_shouldNotSeeWorkspaceRepos () throws Exception {
469
- rewriteWorkspace (
470
- "workspace(name = 'root')" ,
471
- "local_repository(" ,
472
- " name = 'ws_repo'," ,
473
- " path = '/ws_repo'," ,
474
- ")" );
475
- scratch .overwriteFile (
476
- "MODULE.bazel" , "module(name='A',version='0.1')" , "bazel_dep(name='B',version='1.0')" );
477
- registry
478
- .addModule (
479
- createModuleKey ("B" , "1.0" ),
480
- "module(name='B', version='1.0');bazel_dep(name='C', version='2.0')" )
481
- .addModule (createModuleKey ("C" , "2.0" ), "module(name='C', version='2.0')" );
482
-
483
- SkyKey skyKey = RepositoryMappingValue .KEY_FOR_ROOT_MODULE_WITHOUT_WORKSPACE_REPOS ;
484
- assertThatEvaluationResult (eval (skyKey ))
485
- .hasEntryThat (skyKey )
486
- .isEqualTo (
487
- withMapping (
488
- ImmutableMap .of (
489
- RepositoryName .MAIN ,
490
- RepositoryName .MAIN ,
491
- RepositoryName .create ("A" ),
492
- RepositoryName .MAIN ,
493
- RepositoryName .create ("B" ),
494
- RepositoryName .create ("B.1.0" )),
495
- RepositoryName .MAIN ));
496
- }
497
-
498
436
@ Test
499
437
public void testErrorWithMapping () throws Exception {
500
438
reporter .removeHandler (failFastHandler );
0 commit comments