|
77 | 77 | "score_toolchain_override_test", |
78 | 78 | "sphinx_module_info_fields_test", |
79 | 79 | "sphinx_module_providers_test_suite", |
| 80 | + "transitive_modules_dedup_test", |
80 | 81 | "two_phase_html_second_test", |
81 | 82 | "two_phase_needs_first_test", |
82 | 83 | ) |
@@ -148,17 +149,32 @@ toolchain( |
148 | 149 | # Test 1: Multi-Module Aggregation |
149 | 150 | # Dependency graph: module_a_lib -> module_b_lib -> module_c_lib |
150 | 151 | # module_a_lib -> module_c_lib (also direct) |
| 152 | +# module_d_lib is a diamond dependency reachable only transitively, via |
| 153 | +# module_b_lib AND module_c_lib (never directly from module_a_lib) -- a |
| 154 | +# regression fixture for the HTML-merge flattening: module_d_lib's HTML must |
| 155 | +# be merged into module_a_lib's published site exactly once, not once per |
| 156 | +# path that reaches it. |
| 157 | +sphinx_module( |
| 158 | + name = "module_d_lib", |
| 159 | + srcs = glob(["fixtures/module_d/*.rst"]), |
| 160 | + index = "fixtures/module_d/index.rst", |
| 161 | +) |
| 162 | + |
151 | 163 | sphinx_module( |
152 | 164 | name = "module_c_lib", |
153 | 165 | srcs = glob(["fixtures/module_c/*.rst"]), |
154 | 166 | index = "fixtures/module_c/index.rst", |
| 167 | + deps = [":module_d_lib"], |
155 | 168 | ) |
156 | 169 |
|
157 | 170 | sphinx_module( |
158 | 171 | name = "module_b_lib", |
159 | 172 | srcs = glob(["fixtures/module_b/*.rst"]), |
160 | 173 | index = "fixtures/module_b/index.rst", |
161 | | - deps = [":module_c_lib"], |
| 174 | + deps = [ |
| 175 | + ":module_c_lib", |
| 176 | + ":module_d_lib", |
| 177 | + ], |
162 | 178 | ) |
163 | 179 |
|
164 | 180 | sphinx_module( |
@@ -878,6 +894,17 @@ sh_test( |
878 | 894 | tags = ["manual"], |
879 | 895 | ) |
880 | 896 |
|
| 897 | +# End-to-end regression test: module_d_lib (a diamond dep of both |
| 898 | +# module_b_lib and module_c_lib, never directly of module_a_lib) must be |
| 899 | +# merged into module_a_lib's published site exactly once, flat, not once |
| 900 | +# per dependency path that reaches it. |
| 901 | +sh_test( |
| 902 | + name = "module_d_dedup_test", |
| 903 | + srcs = ["check_module_d_dedup.sh"], |
| 904 | + data = [":module_a_lib"], |
| 905 | + tags = ["manual"], |
| 906 | +) |
| 907 | + |
881 | 908 | # ============================================================================ |
882 | 909 | # SEooC-Specific Tests |
883 | 910 | # ============================================================================ |
@@ -1092,6 +1119,14 @@ sphinx_module_info_fields_test( |
1092 | 1119 | target_under_test = ":module_a_lib", |
1093 | 1120 | ) |
1094 | 1121 |
|
| 1122 | +# Regression test for the diamond-dependency HTML-merge flattening: |
| 1123 | +# module_d_lib is a dep of both module_b_lib and module_c_lib (never |
| 1124 | +# directly of module_a_lib), so it's reachable via two paths. |
| 1125 | +transitive_modules_dedup_test( |
| 1126 | + name = "transitive_modules_dedup_test", |
| 1127 | + target_under_test = ":module_a_lib", |
| 1128 | +) |
| 1129 | + |
1095 | 1130 | score_needs_info_fields_test( |
1096 | 1131 | name = "score_needs_info_fields_test", |
1097 | 1132 | target_under_test = ":module_a_lib_needs", |
@@ -1395,6 +1430,7 @@ test_suite( |
1395 | 1430 | ":test_sphinx_html_merge", |
1396 | 1431 | ":test_sphinx_module_ext", |
1397 | 1432 | ":test_trlc_rst_image_rendering", |
| 1433 | + ":transitive_modules_dedup_test", |
1398 | 1434 | ":unit_component_tests", |
1399 | 1435 | "//fixtures/image_srcs:requirements_image_tests", |
1400 | 1436 | ], |
|
0 commit comments