8000 runfiles: Add proper test coverage for an edge case (#1012) · cflewis/rules_python@da106c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit da106c5

Browse files
authored
runfiles: Add proper test coverage for an edge case (bazel-contrib#1012)
The repo mapping wasn't set up correctly to actually test that root symlinks aren't subject to repo mapping.
1 parent 86b01a3 commit da106c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/runfiles/runfiles_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,11 @@ def testManifestBasedRlocation(self):
208208
def testManifestBasedRlocationWithRepoMappingFromMain(self):
209209
with _MockFile(
210210
contents=[
211+
",config.json,config.json~1.2.3",
211212
",my_module,_main",
212213
",my_protobuf,protobuf~3.19.2",
213214
",my_workspace,_main",
215+
"protobuf~3.19.2,config.json,config.json~1.2.3",
214216
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
215217
]
216218
) as rm, _MockFile(
@@ -281,9 +283,11 @@ def testManifestBasedRlocationWithRepoMappingFromMain(self):
281283
def testManifestBasedRlocationWithRepoMappingFromOtherRepo(self):
282284
with _MockFile(
283285
contents=[
286+
",config.json,config.json~1.2.3",
284287
",my_module,_main",
285288
",my_protobuf,protobuf~3.19.2",
286289
",my_workspace,_main",
290+
"protobuf~3.19.2,config.json,config.json~1.2.3",
287291
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
288292
]
289293
) as rm, _MockFile(
@@ -374,9 +378,11 @@ def testDirectoryBasedRlocationWithRepoMappingFromMain(self):
374378
with _MockFile(
375379
name="_repo_mapping",
376380
contents=[
381+
"_,config.json,config.json~1.2.3",
377382
",my_module,_main",
378383
",my_protobuf,protobuf~3.19.2",
379384
",my_workspace,_main",
385+
"protobuf~3.19.2,config.json,config.json~1.2.3",
380386
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
381387
],
382388
) as rm:
@@ -439,9 +445,11 @@ def testDirectoryBasedRlocationWithRepoMappingFromOtherRepo(self):
439445
with _MockFile(
440446
name="_repo_mapping",
441447
contents=[
448+
"_,config.json,config.json~1.2.3",
442449
",my_module,_main",
443450
",my_protobuf,protobuf~3.19.2",
444451
",my_workspace,_main",
452+
"protobuf~3.19.2,config.json,config.json~1.2.3",
445453
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
446454
],
447455
) as rm:

0 commit comments

Comments
 (0)
0