Skip to content

Commit

Permalink
Sync with GitHub
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689541392
  • Loading branch information
TristonianJones authored and copybara-github committed Oct 24, 2024
1 parent 167957b commit 45641a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
4 changes: 2 additions & 2 deletions conformance/src/test/java/dev/cel/conformance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ java_library(
"//parser:macro",
"//parser:parser_builder",
"//runtime",
"//third_party/cel/spec/proto/cel/expr/conformance/proto2:test_all_types_java_proto",
"//third_party/cel/spec/proto/cel/expr/conformance/proto3:test_all_types_java_proto",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@cel_spec//proto/test/v1:simple_java_proto",
"@cel_spec//proto/test/v1/proto2:test_all_types_java_proto",
"@cel_spec//proto/test/v1/proto3:test_all_types_java_proto",
"@com_google_googleapis//google/api/expr/v1alpha1:expr_java_proto",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
Expand Down
27 changes: 9 additions & 18 deletions conformance/src/test/java/dev/cel/conformance/ConformanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import dev.cel.expr.Decl;
import com.google.api.expr.test.v1.SimpleProto.SimpleTest;
import com.google.api.expr.test.v1.proto2.TestAllTypesExtensions;
import com.google.api.expr.v1alpha1.ExprValue;
import com.google.api.expr.v1alpha1.ListValue;
import com.google.api.expr.v1alpha1.MapValue;
Expand Down Expand Up @@ -69,8 +68,7 @@ public final class ConformanceTest extends Statement {

private static ExtensionRegistry newDefaultExtensionRegistry() {
ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance();
com.google.api.expr.test.v1.proto2.TestAllTypesExtensions.registerAllExtensions(
extensionRegistry);
dev.cel.expr.conformance.proto2.TestAllTypesExtensions.registerAllExtensions(extensionRegistry);

return extensionRegistry;
}
Expand All @@ -79,12 +77,9 @@ private static TypeRegistry newDefaultTypeRegistry() {
CelDescriptors allDescriptors =
CelDescriptorUtil.getAllDescriptorsFromFileDescriptor(
ImmutableList.of(
com.google.api.expr.test.v1.proto2.TestAllTypesProto.TestAllTypes.getDescriptor()
.getFile(),
com.google.api.expr.test.v1.proto3.TestAllTypesProto.TestAllTypes.getDescriptor()
.getFile(),
com.google.api.expr.test.v1.proto2.TestAllTypesExtensions.getDescriptor()
.getFile()));
dev.cel.expr.conformance.proto2.TestAllTypes.getDescriptor().getFile(),
dev.cel.expr.conformance.proto3.TestAllTypes.getDescriptor().getFile(),
dev.cel.expr.conformance.proto2.TestAllTypesExtensions.getDescriptor().getFile()));

return TypeRegistry.newBuilder().add(allDescriptors.messageTypeDescriptors()).build();
}
Expand Down Expand Up @@ -140,18 +135,16 @@ private static CelChecker getChecker(SimpleTest test) throws Exception {
.setOptions(OPTIONS)
.setContainer(test.getContainer())
.addDeclarations(decls.build())
.addFileTypes(TestAllTypesExtensions.getDescriptor())
.addFileTypes(dev.cel.expr.conformance.proto2.TestAllTypesExtensions.getDescriptor())
.addLibraries(
CelExtensions.bindings(),
CelExtensions.encoders(),
CelExtensions.math(OPTIONS),
CelExtensions.sets(),
CelExtensions.strings(),
CelOptionalLibrary.INSTANCE)
.addMessageTypes(
com.google.api.expr.test.v1.proto2.TestAllTypesProto.TestAllTypes.getDescriptor())
.addMessageTypes(
com.google.api.expr.test.v1.proto3.TestAllTypesProto.TestAllTypes.getDescriptor())
.addMessageTypes(dev.cel.expr.conformance.proto2.TestAllTypes.getDescriptor())
.addMessageTypes(dev.cel.expr.conformance.proto3.TestAllTypes.getDescriptor())
.build();
}

Expand All @@ -164,10 +157,8 @@ private static CelChecker getChecker(SimpleTest test) throws Exception {
CelExtensions.sets(),
CelExtensions.strings(),
CelOptionalLibrary.INSTANCE)
.addMessageTypes(
com.google.api.expr.test.v1.proto2.TestAllTypesProto.TestAllTypes.getDescriptor())
.addMessageTypes(
com.google.api.expr.test.v1.proto3.TestAllTypesProto.TestAllTypes.getDescriptor())
.addMessageTypes(dev.cel.expr.conformance.proto2.TestAllTypes.getDescriptor())
.addMessageTypes(dev.cel.expr.conformance.proto3.TestAllTypes.getDescriptor())
.build();

private static ImmutableMap<String, Object> getBindings(SimpleTest test) throws Exception {
Expand Down

0 comments on commit 45641a8

Please sign in to comment.