Skip to content

Commit 21fa2c7

Browse files
maskri17copybara-github
authored andcommitted
Enabling conformance testing for namespace shadowing
PiperOrigin-RevId: 959143084
1 parent a2265a8 commit 21fa2c7

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

conformance/BUILD

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ _TESTS_TO_SKIP = [
170170

171171
# Broken test cases which should be supported.
172172
# TODO(issues/97): Parse-only qualified variable lookup "x.y" with binding "x.y" or "y" within container "x" fails
173-
"fields/qualified_identifier_resolution/qualified_ident,map_field_select,ident_with_longest_prefix_check,qualified_identifier_resolution_unchecked",
174-
"namespace/qualified/self_eval_qualified_lookup",
175-
"namespace/namespace/self_eval_container_lookup,self_eval_container_lookup_unchecked",
173+
# NOTE: These tests have `disable_check: true` in their definition, making them force parse-only behavior even in checked mode test runs.
174+
"fields/qualified_identifier_resolution/qualified_identifier_resolution_unchecked",
175+
"namespace/namespace/self_eval_container_lookup_unchecked",
176176

177177
# Skip until fixed.
178178
"fields/qualified_identifier_resolution/map_value_repeat_key_heterogeneous",
@@ -190,10 +190,17 @@ _TESTS_TO_SKIP = [
190190
# precision to preserve value. Not available on older compilers where we just use absl::Format.
191191
# We should probably update the spec to allow different formats that parse to the same value.
192192
"conversions/string/double_hard",
193+
]
193194

194-
# Recent changes
195+
_TESTS_TO_SKIP_PARSE_ONLY = [
196+
# TODO(issues/97): Parse-only qualified variable lookup "x.y" with binding "x.y" or "y" within container "x" fails.
195197
"namespace/namespace_shadowing/basic",
196198
"namespace/namespace_shadowing/comprehension_shadowing_namespaced_selector_disambiguation",
199+
"fields/qualified_identifier_resolution/qualified_ident",
200+
"fields/qualified_identifier_resolution/map_field_select",
201+
"fields/qualified_identifier_resolution/ident_with_longest_prefix_check",
202+
"namespace/qualified/self_eval_qualified_lookup",
203+
"namespace/namespace/self_eval_container_lookup",
197204
]
198205

199206
_TESTS_TO_SKIP_MODERN = _TESTS_TO_SKIP
@@ -238,14 +245,14 @@ gen_conformance_tests(
238245
name = "conformance_parse_only",
239246
data = _ALL_TESTS,
240247
modern = True,
241-
skip_tests = _TESTS_TO_SKIP_MODERN + ["type_deductions"],
248+
skip_tests = _TESTS_TO_SKIP_MODERN + _TESTS_TO_SKIP_PARSE_ONLY + ["type_deductions"],
242249
)
243250

244251
gen_conformance_tests(
245252
name = "conformance_legacy_parse_only",
246253
data = _ALL_TESTS,
247254
modern = False,
248-
skip_tests = _TESTS_TO_SKIP_LEGACY + ["type_deductions"],
255+
skip_tests = _TESTS_TO_SKIP_LEGACY + _TESTS_TO_SKIP_PARSE_ONLY + ["type_deductions"],
249256
)
250257

251258
gen_conformance_tests(

policy/yaml_policy_parser.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ absl::Status YamlPolicyParser::ParsePolicy(CelPolicyParseContext& ctx) const {
102102
return absl::OkStatus();
103103
}
104104

105-
// TODO(b/542282964): Fold this mapping into cel::Source decoding happens
106-
// once.
105+
// TODO(b/542282964): Fold this mapping into cel::Source decoding.
107106
std::string text = source->content().ToString();
108107
std::vector<SourcePosition> mapping;
109108
mapping.resize(text.size() + 1, 0);

0 commit comments

Comments
 (0)