diff options
| author | Peter Kjellerstedt <pkj@axis.com> | 2025-11-07 23:09:57 +0100 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-11-26 02:05:48 -0800 |
| commit | 47c24b5c4092ce397c94c05d8686c8bcac64fbb2 (patch) | |
| tree | 766255098811530bd0e53518f940f29a5efdc176 /tests/test_manifest_xml.py | |
| parent | be33106ffc516c9631a78e1c1d2ebea3a955d71a (diff) | |
| download | git-repo-47c24b5c4092ce397c94c05d8686c8bcac64fbb2.tar.gz | |
manifest: Make include groups propagate to extend-project elements
Any groups specified to an include element should propagate to any
extend-project elements and then on to the projects.
Change-Id: I62b95689cc13660858564ae569cbfd095961ecc7
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525321
Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'tests/test_manifest_xml.py')
| -rw-r--r-- | tests/test_manifest_xml.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index c1fed2bf..d4bf76a9 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
| @@ -488,6 +488,41 @@ class IncludeElementTests(ManifestParseTestCase): | |||
| 488 | # Check level2 proj group not removed. | 488 | # Check level2 proj group not removed. |
| 489 | self.assertIn("l2g1", proj.groups) | 489 | self.assertIn("l2g1", proj.groups) |
| 490 | 490 | ||
| 491 | def test_group_levels_with_extend_project(self): | ||
| 492 | root_m = self.manifest_dir / "root.xml" | ||
| 493 | root_m.write_text( | ||
| 494 | """ | ||
| 495 | <manifest> | ||
| 496 | <remote name="test-remote" fetch="http://localhost" /> | ||
| 497 | <default remote="test-remote" revision="refs/heads/main" /> | ||
| 498 | <include name="man1.xml" groups="top-group1" /> | ||
| 499 | <include name="man2.xml" groups="top-group2" /> | ||
| 500 | </manifest> | ||
| 501 | """ | ||
| 502 | ) | ||
| 503 | (self.manifest_dir / "man1.xml").write_text( | ||
| 504 | """ | ||
| 505 | <manifest> | ||
| 506 | <project name="project1" path="project1" /> | ||
| 507 | </manifest> | ||
| 508 | """ | ||
| 509 | ) | ||
| 510 | (self.manifest_dir / "man2.xml").write_text( | ||
| 511 | """ | ||
| 512 | <manifest> | ||
| 513 | <extend-project name="project1" groups="eg1" /> | ||
| 514 | </manifest> | ||
| 515 | """ | ||
| 516 | ) | ||
| 517 | include_m = manifest_xml.XmlManifest(str(self.repodir), str(root_m)) | ||
| 518 | proj = include_m.projects[0] | ||
| 519 | # Check project has inherited group via project element. | ||
| 520 | self.assertIn("top-group1", proj.groups) | ||
| 521 | # Check project has inherited group via extend-project element. | ||
| 522 | self.assertIn("top-group2", proj.groups) | ||
| 523 | # Check project has set group via extend-project element. | ||
| 524 | self.assertIn("eg1", proj.groups) | ||
| 525 | |||
| 491 | def test_allow_bad_name_from_user(self): | 526 | def test_allow_bad_name_from_user(self): |
| 492 | """Check handling of bad name attribute from the user's input.""" | 527 | """Check handling of bad name attribute from the user's input.""" |
| 493 | 528 | ||
