From d5642056580f045e82178ed5cadb9e567d400f75 Mon Sep 17 00:00:00 2001 From: "zev.ac" Date: Thu, 27 Feb 2025 01:50:16 +0530 Subject: [PATCH] Add test_suite and test_config under conformance (#441) * Add test_suite and test_config under conformance * added test_config.pb.go and test_suite.pb.go to conforanmce library build target * added test suite messages to simple.proto and updated test_config to env_config * add uncommitted files * updated build files for generated conformance and test code * corrected field name in env_config * replaced Variable and Function messages with cel.expr.DEcl * resolved comments * removed redundant any from simple proto * added context_message as an input kind to test case * removed redundant anypb import in env_config * update type_name to context_variable_type to conform with linting rules * moved test suite, test section and test case to suite.proto under conformance/test * update context variable attribute name to type_name --- conformance/BUILD.bazel | 3 + conformance/env_config.pb.go | 781 +++++++++++++++++++ conformance/test/BUILD.bazel | 3 + conformance/test/suite.pb.go | 628 +++++++++++++++ proto/cel/expr/conformance/BUILD.bazel | 20 + proto/cel/expr/conformance/env_config.proto | 183 +++++ proto/cel/expr/conformance/test/BUILD.bazel | 49 ++ proto/cel/expr/conformance/test/simple.proto | 2 + proto/cel/expr/conformance/test/suite.proto | 135 ++++ 9 files changed, 1804 insertions(+) create mode 100755 conformance/env_config.pb.go create mode 100755 conformance/test/suite.pb.go create mode 100644 proto/cel/expr/conformance/env_config.proto create mode 100644 proto/cel/expr/conformance/test/suite.proto diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel index 5fc4098d..47684f21 100755 --- a/conformance/BUILD.bazel +++ b/conformance/BUILD.bazel @@ -23,6 +23,7 @@ go_library( name = "go_default_library", srcs = [ "conformance_service.pb.go", + "env_config.pb.go", ], importpath = "cel.dev/expr/conformance", deps = [ @@ -30,5 +31,7 @@ go_library( "@org_golang_google_genproto_googleapis_rpc//status:go_default_library", "@org_golang_google_protobuf//reflect/protoreflect", "@org_golang_google_protobuf//runtime/protoimpl", + "@org_golang_google_protobuf//types/descriptorpb", + "@org_golang_google_protobuf//types/known/structpb", ], ) diff --git a/conformance/env_config.pb.go b/conformance/env_config.pb.go new file mode 100755 index 00000000..e22920dc --- /dev/null +++ b/conformance/env_config.pb.go @@ -0,0 +1,781 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.26.0 +// source: cel/expr/conformance/env_config.proto + +package conformance + +import ( + expr "cel.dev/expr" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Environment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Container string `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"` + Imports []*Environment_Import `protobuf:"bytes,4,rep,name=imports,proto3" json:"imports,omitempty"` + Stdlib *LibrarySubset `protobuf:"bytes,5,opt,name=stdlib,proto3" json:"stdlib,omitempty"` + Extensions []*Extension `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"` + ContextVariable *Environment_ContextVariable `protobuf:"bytes,7,opt,name=context_variable,json=contextVariable,proto3" json:"context_variable,omitempty"` + Declarations []*expr.Decl `protobuf:"bytes,8,rep,name=declarations,proto3" json:"declarations,omitempty"` + Validators []*Validator `protobuf:"bytes,9,rep,name=validators,proto3" json:"validators,omitempty"` + Features []*Feature `protobuf:"bytes,10,rep,name=features,proto3" json:"features,omitempty"` + DisableStandardCelDeclarations bool `protobuf:"varint,11,opt,name=disable_standard_cel_declarations,json=disableStandardCelDeclarations,proto3" json:"disable_standard_cel_declarations,omitempty"` + MessageTypeExtension *descriptorpb.FileDescriptorSet `protobuf:"bytes,12,opt,name=message_type_extension,json=messageTypeExtension,proto3" json:"message_type_extension,omitempty"` + EnableMacroCallTracking bool `protobuf:"varint,13,opt,name=enable_macro_call_tracking,json=enableMacroCallTracking,proto3" json:"enable_macro_call_tracking,omitempty"` +} + +func (x *Environment) Reset() { + *x = Environment{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Environment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Environment) ProtoMessage() {} + +func (x *Environment) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Environment.ProtoReflect.Descriptor instead. +func (*Environment) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{0} +} + +func (x *Environment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Environment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Environment) GetContainer() string { + if x != nil { + return x.Container + } + return "" +} + +func (x *Environment) GetImports() []*Environment_Import { + if x != nil { + return x.Imports + } + return nil +} + +func (x *Environment) GetStdlib() *LibrarySubset { + if x != nil { + return x.Stdlib + } + return nil +} + +func (x *Environment) GetExtensions() []*Extension { + if x != nil { + return x.Extensions + } + return nil +} + +func (x *Environment) GetContextVariable() *Environment_ContextVariable { + if x != nil { + return x.ContextVariable + } + return nil +} + +func (x *Environment) GetDeclarations() []*expr.Decl { + if x != nil { + return x.Declarations + } + return nil +} + +func (x *Environment) GetValidators() []*Validator { + if x != nil { + return x.Validators + } + return nil +} + +func (x *Environment) GetFeatures() []*Feature { + if x != nil { + return x.Features + } + return nil +} + +func (x *Environment) GetDisableStandardCelDeclarations() bool { + if x != nil { + return x.DisableStandardCelDeclarations + } + return false +} + +func (x *Environment) GetMessageTypeExtension() *descriptorpb.FileDescriptorSet { + if x != nil { + return x.MessageTypeExtension + } + return nil +} + +func (x *Environment) GetEnableMacroCallTracking() bool { + if x != nil { + return x.EnableMacroCallTracking + } + return false +} + +type Validator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Config map[string]*structpb.Value `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Validator) Reset() { + *x = Validator{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Validator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Validator) ProtoMessage() {} + +func (x *Validator) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Validator.ProtoReflect.Descriptor instead. +func (*Validator) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{1} +} + +func (x *Validator) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Validator) GetConfig() map[string]*structpb.Value { + if x != nil { + return x.Config + } + return nil +} + +type Feature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *Feature) Reset() { + *x = Feature{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Feature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Feature) ProtoMessage() {} + +func (x *Feature) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Feature.ProtoReflect.Descriptor instead. +func (*Feature) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{2} +} + +func (x *Feature) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Feature) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +type Extension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *Extension) Reset() { + *x = Extension{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Extension) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Extension) ProtoMessage() {} + +func (x *Extension) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Extension.ProtoReflect.Descriptor instead. +func (*Extension) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{3} +} + +func (x *Extension) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Extension) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type LibrarySubset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"` + DisableMacros bool `protobuf:"varint,2,opt,name=disable_macros,json=disableMacros,proto3" json:"disable_macros,omitempty"` + IncludeMacros []string `protobuf:"bytes,3,rep,name=include_macros,json=includeMacros,proto3" json:"include_macros,omitempty"` + ExcludeMacros []string `protobuf:"bytes,4,rep,name=exclude_macros,json=excludeMacros,proto3" json:"exclude_macros,omitempty"` + IncludeFunctions []*expr.Decl `protobuf:"bytes,5,rep,name=include_functions,json=includeFunctions,proto3" json:"include_functions,omitempty"` + ExcludeFunctions []*expr.Decl `protobuf:"bytes,6,rep,name=exclude_functions,json=excludeFunctions,proto3" json:"exclude_functions,omitempty"` +} + +func (x *LibrarySubset) Reset() { + *x = LibrarySubset{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LibrarySubset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LibrarySubset) ProtoMessage() {} + +func (x *LibrarySubset) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LibrarySubset.ProtoReflect.Descriptor instead. +func (*LibrarySubset) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{4} +} + +func (x *LibrarySubset) GetDisabled() bool { + if x != nil { + return x.Disabled + } + return false +} + +func (x *LibrarySubset) GetDisableMacros() bool { + if x != nil { + return x.DisableMacros + } + return false +} + +func (x *LibrarySubset) GetIncludeMacros() []string { + if x != nil { + return x.IncludeMacros + } + return nil +} + +func (x *LibrarySubset) GetExcludeMacros() []string { + if x != nil { + return x.ExcludeMacros + } + return nil +} + +func (x *LibrarySubset) GetIncludeFunctions() []*expr.Decl { + if x != nil { + return x.IncludeFunctions + } + return nil +} + +func (x *LibrarySubset) GetExcludeFunctions() []*expr.Decl { + if x != nil { + return x.ExcludeFunctions + } + return nil +} + +type Environment_Import struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Environment_Import) Reset() { + *x = Environment_Import{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Environment_Import) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Environment_Import) ProtoMessage() {} + +func (x *Environment_Import) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Environment_Import.ProtoReflect.Descriptor instead. +func (*Environment_Import) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Environment_Import) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Environment_ContextVariable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` +} + +func (x *Environment_ContextVariable) Reset() { + *x = Environment_ContextVariable{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Environment_ContextVariable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Environment_ContextVariable) ProtoMessage() {} + +func (x *Environment_ContextVariable) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_env_config_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Environment_ContextVariable.ProtoReflect.Descriptor instead. +func (*Environment_ContextVariable) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_env_config_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *Environment_ContextVariable) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +var File_cel_expr_conformance_env_config_proto protoreflect.FileDescriptor + +var file_cel_expr_conformance_env_config_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, + 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x16, 0x63, + 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x06, 0x0a, 0x0b, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x07, 0x69, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x65, 0x6c, + 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, + 0x65, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x07, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x3b, 0x0a, + 0x06, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x75, 0x62, 0x73, + 0x65, 0x74, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x12, 0x3f, 0x0a, 0x0a, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5c, 0x0a, 0x10, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x0c, 0x64, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x52, + 0x0c, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3f, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x39, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, + 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x21, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x65, + 0x6c, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x1e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, + 0x6e, 0x64, 0x61, 0x72, 0x64, 0x43, 0x65, 0x6c, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x16, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, + 0x0a, 0x1a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x5f, 0x63, + 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x43, + 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x1a, 0x1c, 0x0a, 0x06, 0x49, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x2e, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xb7, 0x01, 0x0a, 0x09, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x65, + 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, + 0x63, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x1a, 0x51, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x39, 0x0a, 0x09, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9a, 0x02, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x53, 0x75, 0x62, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x25, 0x0a, 0x0e, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4d, 0x61, 0x63, + 0x72, 0x6f, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6d, + 0x61, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x4d, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x3b, 0x0a, 0x11, 0x69, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, + 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x44, 0x65, + 0x63, 0x6c, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x4b, 0x0a, 0x18, 0x63, 0x65, 0x6c, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, + 0x42, 0x10, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x18, 0x63, 0x65, 0x6c, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, + 0x70, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0xf8, 0x01, + 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cel_expr_conformance_env_config_proto_rawDescOnce sync.Once + file_cel_expr_conformance_env_config_proto_rawDescData = file_cel_expr_conformance_env_config_proto_rawDesc +) + +func file_cel_expr_conformance_env_config_proto_rawDescGZIP() []byte { + file_cel_expr_conformance_env_config_proto_rawDescOnce.Do(func() { + file_cel_expr_conformance_env_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_conformance_env_config_proto_rawDescData) + }) + return file_cel_expr_conformance_env_config_proto_rawDescData +} + +var file_cel_expr_conformance_env_config_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cel_expr_conformance_env_config_proto_goTypes = []any{ + (*Environment)(nil), // 0: cel.expr.conformance.Environment + (*Validator)(nil), // 1: cel.expr.conformance.Validator + (*Feature)(nil), // 2: cel.expr.conformance.Feature + (*Extension)(nil), // 3: cel.expr.conformance.Extension + (*LibrarySubset)(nil), // 4: cel.expr.conformance.LibrarySubset + (*Environment_Import)(nil), // 5: cel.expr.conformance.Environment.Import + (*Environment_ContextVariable)(nil), // 6: cel.expr.conformance.Environment.ContextVariable + nil, // 7: cel.expr.conformance.Validator.ConfigEntry + (*expr.Decl)(nil), // 8: cel.expr.Decl + (*descriptorpb.FileDescriptorSet)(nil), // 9: google.protobuf.FileDescriptorSet + (*structpb.Value)(nil), // 10: google.protobuf.Value +} +var file_cel_expr_conformance_env_config_proto_depIdxs = []int32{ + 5, // 0: cel.expr.conformance.Environment.imports:type_name -> cel.expr.conformance.Environment.Import + 4, // 1: cel.expr.conformance.Environment.stdlib:type_name -> cel.expr.conformance.LibrarySubset + 3, // 2: cel.expr.conformance.Environment.extensions:type_name -> cel.expr.conformance.Extension + 6, // 3: cel.expr.conformance.Environment.context_variable:type_name -> cel.expr.conformance.Environment.ContextVariable + 8, // 4: cel.expr.conformance.Environment.declarations:type_name -> cel.expr.Decl + 1, // 5: cel.expr.conformance.Environment.validators:type_name -> cel.expr.conformance.Validator + 2, // 6: cel.expr.conformance.Environment.features:type_name -> cel.expr.conformance.Feature + 9, // 7: cel.expr.conformance.Environment.message_type_extension:type_name -> google.protobuf.FileDescriptorSet + 7, // 8: cel.expr.conformance.Validator.config:type_name -> cel.expr.conformance.Validator.ConfigEntry + 8, // 9: cel.expr.conformance.LibrarySubset.include_functions:type_name -> cel.expr.Decl + 8, // 10: cel.expr.conformance.LibrarySubset.exclude_functions:type_name -> cel.expr.Decl + 10, // 11: cel.expr.conformance.Validator.ConfigEntry.value:type_name -> google.protobuf.Value + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_cel_expr_conformance_env_config_proto_init() } +func file_cel_expr_conformance_env_config_proto_init() { + if File_cel_expr_conformance_env_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cel_expr_conformance_env_config_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Environment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Validator); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*Feature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*Extension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*LibrarySubset); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*Environment_Import); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_env_config_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*Environment_ContextVariable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cel_expr_conformance_env_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cel_expr_conformance_env_config_proto_goTypes, + DependencyIndexes: file_cel_expr_conformance_env_config_proto_depIdxs, + MessageInfos: file_cel_expr_conformance_env_config_proto_msgTypes, + }.Build() + File_cel_expr_conformance_env_config_proto = out.File + file_cel_expr_conformance_env_config_proto_rawDesc = nil + file_cel_expr_conformance_env_config_proto_goTypes = nil + file_cel_expr_conformance_env_config_proto_depIdxs = nil +} diff --git a/conformance/test/BUILD.bazel b/conformance/test/BUILD.bazel index 8035db0f..d8f2f242 100755 --- a/conformance/test/BUILD.bazel +++ b/conformance/test/BUILD.bazel @@ -23,11 +23,14 @@ go_library( name = "go_default_library", srcs = [ "simple.pb.go", + "suite.pb.go" ], importpath = "cel.dev/expr/conformance/test", deps = [ "//:expr", + "//conformance:go_default_library", "@org_golang_google_protobuf//reflect/protoreflect", "@org_golang_google_protobuf//runtime/protoimpl", + "@org_golang_google_protobuf//types/known/anypb", ], ) diff --git a/conformance/test/suite.pb.go b/conformance/test/suite.pb.go new file mode 100755 index 00000000..e76d006c --- /dev/null +++ b/conformance/test/suite.pb.go @@ -0,0 +1,628 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.26.0 +// source: cel/expr/conformance/test/suite.proto + +package test + +import ( + expr "cel.dev/expr" + conformance "cel.dev/expr/conformance" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TestSuite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Sections []*TestSection `protobuf:"bytes,3,rep,name=sections,proto3" json:"sections,omitempty"` +} + +func (x *TestSuite) Reset() { + *x = TestSuite{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestSuite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestSuite) ProtoMessage() {} + +func (x *TestSuite) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestSuite.ProtoReflect.Descriptor instead. +func (*TestSuite) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_test_suite_proto_rawDescGZIP(), []int{0} +} + +func (x *TestSuite) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TestSuite) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *TestSuite) GetSections() []*TestSection { + if x != nil { + return x.Sections + } + return nil +} + +type TestSection struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Tests []*TestCase `protobuf:"bytes,3,rep,name=tests,proto3" json:"tests,omitempty"` +} + +func (x *TestSection) Reset() { + *x = TestSection{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestSection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestSection) ProtoMessage() {} + +func (x *TestSection) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestSection.ProtoReflect.Descriptor instead. +func (*TestSection) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_test_suite_proto_rawDescGZIP(), []int{1} +} + +func (x *TestSection) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TestSection) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *TestSection) GetTests() []*TestCase { + if x != nil { + return x.Tests + } + return nil +} + +type TestCase struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Expr string `protobuf:"bytes,3,opt,name=expr,proto3" json:"expr,omitempty"` + Env *conformance.Environment `protobuf:"bytes,4,opt,name=env,proto3" json:"env,omitempty"` + // Types that are assignable to InputKind: + // + // *TestCase_Bindings + // *TestCase_ContextMessage + // *TestCase_ContextExpr + InputKind isTestCase_InputKind `protobuf_oneof:"input_kind"` + // Types that are assignable to ResultKind: + // + // *TestCase_ResultValue + // *TestCase_ResultExpr + // *TestCase_EvalError + // *TestCase_Unknown + ResultKind isTestCase_ResultKind `protobuf_oneof:"result_kind"` + DeducedType *expr.Type `protobuf:"bytes,12,opt,name=deduced_type,json=deducedType,proto3" json:"deduced_type,omitempty"` + DisableCheck bool `protobuf:"varint,13,opt,name=disable_check,json=disableCheck,proto3" json:"disable_check,omitempty"` +} + +func (x *TestCase) Reset() { + *x = TestCase{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestCase) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestCase) ProtoMessage() {} + +func (x *TestCase) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestCase.ProtoReflect.Descriptor instead. +func (*TestCase) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_test_suite_proto_rawDescGZIP(), []int{2} +} + +func (x *TestCase) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TestCase) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *TestCase) GetExpr() string { + if x != nil { + return x.Expr + } + return "" +} + +func (x *TestCase) GetEnv() *conformance.Environment { + if x != nil { + return x.Env + } + return nil +} + +func (m *TestCase) GetInputKind() isTestCase_InputKind { + if m != nil { + return m.InputKind + } + return nil +} + +func (x *TestCase) GetBindings() *Bindings { + if x, ok := x.GetInputKind().(*TestCase_Bindings); ok { + return x.Bindings + } + return nil +} + +func (x *TestCase) GetContextMessage() *anypb.Any { + if x, ok := x.GetInputKind().(*TestCase_ContextMessage); ok { + return x.ContextMessage + } + return nil +} + +func (x *TestCase) GetContextExpr() string { + if x, ok := x.GetInputKind().(*TestCase_ContextExpr); ok { + return x.ContextExpr + } + return "" +} + +func (m *TestCase) GetResultKind() isTestCase_ResultKind { + if m != nil { + return m.ResultKind + } + return nil +} + +func (x *TestCase) GetResultValue() *expr.Value { + if x, ok := x.GetResultKind().(*TestCase_ResultValue); ok { + return x.ResultValue + } + return nil +} + +func (x *TestCase) GetResultExpr() string { + if x, ok := x.GetResultKind().(*TestCase_ResultExpr); ok { + return x.ResultExpr + } + return "" +} + +func (x *TestCase) GetEvalError() *expr.ErrorSet { + if x, ok := x.GetResultKind().(*TestCase_EvalError); ok { + return x.EvalError + } + return nil +} + +func (x *TestCase) GetUnknown() *expr.UnknownSet { + if x, ok := x.GetResultKind().(*TestCase_Unknown); ok { + return x.Unknown + } + return nil +} + +func (x *TestCase) GetDeducedType() *expr.Type { + if x != nil { + return x.DeducedType + } + return nil +} + +func (x *TestCase) GetDisableCheck() bool { + if x != nil { + return x.DisableCheck + } + return false +} + +type isTestCase_InputKind interface { + isTestCase_InputKind() +} + +type TestCase_Bindings struct { + Bindings *Bindings `protobuf:"bytes,5,opt,name=bindings,proto3,oneof"` +} + +type TestCase_ContextMessage struct { + ContextMessage *anypb.Any `protobuf:"bytes,6,opt,name=context_message,json=contextMessage,proto3,oneof"` +} + +type TestCase_ContextExpr struct { + ContextExpr string `protobuf:"bytes,7,opt,name=context_expr,json=contextExpr,proto3,oneof"` +} + +func (*TestCase_Bindings) isTestCase_InputKind() {} + +func (*TestCase_ContextMessage) isTestCase_InputKind() {} + +func (*TestCase_ContextExpr) isTestCase_InputKind() {} + +type isTestCase_ResultKind interface { + isTestCase_ResultKind() +} + +type TestCase_ResultValue struct { + ResultValue *expr.Value `protobuf:"bytes,8,opt,name=result_value,json=resultValue,proto3,oneof"` +} + +type TestCase_ResultExpr struct { + ResultExpr string `protobuf:"bytes,9,opt,name=result_expr,json=resultExpr,proto3,oneof"` +} + +type TestCase_EvalError struct { + EvalError *expr.ErrorSet `protobuf:"bytes,10,opt,name=eval_error,json=evalError,proto3,oneof"` +} + +type TestCase_Unknown struct { + Unknown *expr.UnknownSet `protobuf:"bytes,11,opt,name=unknown,proto3,oneof"` +} + +func (*TestCase_ResultValue) isTestCase_ResultKind() {} + +func (*TestCase_ResultExpr) isTestCase_ResultKind() {} + +func (*TestCase_EvalError) isTestCase_ResultKind() {} + +func (*TestCase_Unknown) isTestCase_ResultKind() {} + +type Bindings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values map[string]*expr.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Bindings) Reset() { + *x = Bindings{} + if protoimpl.UnsafeEnabled { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bindings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bindings) ProtoMessage() {} + +func (x *Bindings) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_conformance_test_suite_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bindings.ProtoReflect.Descriptor instead. +func (*Bindings) Descriptor() ([]byte, []int) { + return file_cel_expr_conformance_test_suite_proto_rawDescGZIP(), []int{3} +} + +func (x *Bindings) GetValues() map[string]*expr.Value { + if x != nil { + return x.Values + } + return nil +} + +var File_cel_expr_conformance_test_suite_proto protoreflect.FileDescriptor + +var file_cel_expr_conformance_test_suite_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x73, 0x75, 0x69, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, + 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x65, 0x6c, 0x2f, + 0x65, 0x78, 0x70, 0x72, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, + 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x08, 0x73, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x7e, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x05, 0x74, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x52, 0x05, 0x74, 0x65, 0x73, 0x74, 0x73, 0x22, + 0xe7, 0x04, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x12, 0x33, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x41, 0x0a, 0x08, 0x62, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x73, 0x48, 0x00, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, + 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, + 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x23, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x45, 0x78, 0x70, 0x72, 0x12, 0x34, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, + 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x45, 0x78, 0x70, 0x72, 0x12, 0x33, 0x0a, + 0x0a, 0x65, 0x76, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x53, 0x65, 0x74, 0x48, 0x01, 0x52, 0x09, 0x65, 0x76, 0x61, 0x6c, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x55, + 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x48, 0x01, 0x52, 0x07, 0x75, 0x6e, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x31, 0x0a, 0x0c, 0x64, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x65, 0x6c, + 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x64, 0x75, + 0x63, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x42, 0x0c, 0x0a, 0x0a, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x9f, 0x01, 0x0a, 0x08, 0x42, 0x69, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, + 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, + 0x4a, 0x0a, 0x0b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x4f, 0x0a, 0x1d, 0x64, + 0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x42, 0x0a, 0x53, 0x75, + 0x69, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x63, 0x65, 0x6c, 0x2e, + 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x6e, 0x63, 0x65, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cel_expr_conformance_test_suite_proto_rawDescOnce sync.Once + file_cel_expr_conformance_test_suite_proto_rawDescData = file_cel_expr_conformance_test_suite_proto_rawDesc +) + +func file_cel_expr_conformance_test_suite_proto_rawDescGZIP() []byte { + file_cel_expr_conformance_test_suite_proto_rawDescOnce.Do(func() { + file_cel_expr_conformance_test_suite_proto_rawDescData = protoimpl.X.CompressGZIP(file_cel_expr_conformance_test_suite_proto_rawDescData) + }) + return file_cel_expr_conformance_test_suite_proto_rawDescData +} + +var file_cel_expr_conformance_test_suite_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_cel_expr_conformance_test_suite_proto_goTypes = []any{ + (*TestSuite)(nil), // 0: cel.expr.conformance.test.TestSuite + (*TestSection)(nil), // 1: cel.expr.conformance.test.TestSection + (*TestCase)(nil), // 2: cel.expr.conformance.test.TestCase + (*Bindings)(nil), // 3: cel.expr.conformance.test.Bindings + nil, // 4: cel.expr.conformance.test.Bindings.ValuesEntry + (*conformance.Environment)(nil), // 5: cel.expr.conformance.Environment + (*anypb.Any)(nil), // 6: google.protobuf.Any + (*expr.Value)(nil), // 7: cel.expr.Value + (*expr.ErrorSet)(nil), // 8: cel.expr.ErrorSet + (*expr.UnknownSet)(nil), // 9: cel.expr.UnknownSet + (*expr.Type)(nil), // 10: cel.expr.Type +} +var file_cel_expr_conformance_test_suite_proto_depIdxs = []int32{ + 1, // 0: cel.expr.conformance.test.TestSuite.sections:type_name -> cel.expr.conformance.test.TestSection + 2, // 1: cel.expr.conformance.test.TestSection.tests:type_name -> cel.expr.conformance.test.TestCase + 5, // 2: cel.expr.conformance.test.TestCase.env:type_name -> cel.expr.conformance.Environment + 3, // 3: cel.expr.conformance.test.TestCase.bindings:type_name -> cel.expr.conformance.test.Bindings + 6, // 4: cel.expr.conformance.test.TestCase.context_message:type_name -> google.protobuf.Any + 7, // 5: cel.expr.conformance.test.TestCase.result_value:type_name -> cel.expr.Value + 8, // 6: cel.expr.conformance.test.TestCase.eval_error:type_name -> cel.expr.ErrorSet + 9, // 7: cel.expr.conformance.test.TestCase.unknown:type_name -> cel.expr.UnknownSet + 10, // 8: cel.expr.conformance.test.TestCase.deduced_type:type_name -> cel.expr.Type + 4, // 9: cel.expr.conformance.test.Bindings.values:type_name -> cel.expr.conformance.test.Bindings.ValuesEntry + 7, // 10: cel.expr.conformance.test.Bindings.ValuesEntry.value:type_name -> cel.expr.Value + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_cel_expr_conformance_test_suite_proto_init() } +func file_cel_expr_conformance_test_suite_proto_init() { + if File_cel_expr_conformance_test_suite_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cel_expr_conformance_test_suite_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*TestSuite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_test_suite_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*TestSection); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_test_suite_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*TestCase); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cel_expr_conformance_test_suite_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*Bindings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_cel_expr_conformance_test_suite_proto_msgTypes[2].OneofWrappers = []any{ + (*TestCase_Bindings)(nil), + (*TestCase_ContextMessage)(nil), + (*TestCase_ContextExpr)(nil), + (*TestCase_ResultValue)(nil), + (*TestCase_ResultExpr)(nil), + (*TestCase_EvalError)(nil), + (*TestCase_Unknown)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cel_expr_conformance_test_suite_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cel_expr_conformance_test_suite_proto_goTypes, + DependencyIndexes: file_cel_expr_conformance_test_suite_proto_depIdxs, + MessageInfos: file_cel_expr_conformance_test_suite_proto_msgTypes, + }.Build() + File_cel_expr_conformance_test_suite_proto = out.File + file_cel_expr_conformance_test_suite_proto_rawDesc = nil + file_cel_expr_conformance_test_suite_proto_goTypes = nil + file_cel_expr_conformance_test_suite_proto_depIdxs = nil +} diff --git a/proto/cel/expr/conformance/BUILD.bazel b/proto/cel/expr/conformance/BUILD.bazel index 63a47d7b..4112d0a1 100644 --- a/proto/cel/expr/conformance/BUILD.bazel +++ b/proto/cel/expr/conformance/BUILD.bazel @@ -16,6 +16,17 @@ proto_library( ], ) +proto_library( + name = "env_config_proto", + srcs = ["env_config.proto"], + strip_import_prefix = "/proto", + deps = [ + "//proto/cel/expr:checked_proto", + "@com_google_protobuf//:descriptor_proto", + "@com_google_protobuf//:struct_proto", + ], +) + ############################################################################## # Java ############################################################################## @@ -41,6 +52,15 @@ go_proto_library( ], ) +go_proto_library( + name = "env_config_go_proto", + importpath = "cel.dev/expr/conformance", + protos = [":env_config_proto"], + deps = [ + "//proto/cel/expr:expr_go_proto", + ] +) + ############################################################################### ## C++ ############################################################################### diff --git a/proto/cel/expr/conformance/env_config.proto b/proto/cel/expr/conformance/env_config.proto new file mode 100644 index 00000000..dce0df67 --- /dev/null +++ b/proto/cel/expr/conformance/env_config.proto @@ -0,0 +1,183 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package cel.expr.conformance; + +import "cel/expr/checked.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/descriptor.proto"; + +option cc_enable_arenas = true; +option go_package = "cel.dev/expr/conformance"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "cel.dev.expr.conformance"; + +// Representation of a CEL Environment, defining what features and extensions +// are available for conformance testing. +message Environment { + // Name of the environment + string name = 1; + + // Description for the current environment + string description = 2; + + // Sets the namespace (container) for the expression. + // This is used to simplify resolution. + // For example with container + // `google.rpc.context` + // an identifier of `google.rpc.context.AttributeContext` could be referred + // to simply as `AttributeContext` in the CEL expression. + string container = 3; + + // Import represents a type name that will be abbreviated by its simple name + // making it easier to reference simple type names from packages other than + // the expression container. + // For ex: + // Import{name: 'google.rpc.Status'} + // The above import will ensure that `google.rpc.Status` is available by the + // simple name `Status` within CEL expressions. + message Import { + // Qualified type name which will be abbreviated + string name = 1; + } + + // List of abbreviations to be added to the CEL environment + repeated Import imports = 4; + + // Set of options to subset a subsettable library + LibrarySubset stdlib = 5; + + // List of extensions to enable in the CEL environment. + repeated Extension extensions = 6; + + // ContextVariable represents a message type to be made available as a + // context variable to the CEL environment. + message ContextVariable { + // Fully qualified type name of the context proto. + string type_name = 1; + } + + // If set, adds a context declaration from a proto message. + // + // Context messages have all of their top-level fields available as variables + // in the type checker. + ContextVariable context_variable = 7; + + // List of declarations to be configured in the CEL environment. + // + // Note: The CEL environment can be configured with either the + // context_variable or a set of ident_decls provided as part of declarations. + // Providing both will result in an error. + repeated cel.expr.Decl declarations = 8; + + // List of validators for validating the parsed ast. + repeated Validator validators = 9; + + // List of feature flags to be enabled or disabled. + repeated Feature features = 10; + + // Disables including the declarations from the standard CEL environment. + // + // NOTE: Do not disable the standard CEL declarations unless you are aware of + // the implications and have discussed your use case on cel-discuss@ + // or with the members of the cel-governance-team@ + // + // Deprecated: Use LibrarySubset to disable standard cel declarations instead: + // stdlib = LibrarySubset{ disable: true } + bool disable_standard_cel_declarations = 11; + + // If provided, uses the provided FileDescriptorSet to extend types available + // the CEL expression. All "well-known" protobuf messages (google.protobuf.*) + // are known to the CEL compiler, but all others must be provided for type + // checking. + google.protobuf.FileDescriptorSet message_type_extension = 12; + + // When macro call tracking is enabled, the resulting SourceInfo in the + // CheckedExpr will contain a collection of expressions representing the + // function calls which were replaced by macros. + // + // Deprecated: Use Feature to enable macro call tracking + // Feature{ name: "cel.feature.macro_call_tracking", enabled: true } + bool enable_macro_call_tracking = 13; +} + +// Represents a named validator with an optional map-based configuration object. +// Naming convention followed by validators: +// .validator. +// For ex: +// `cel.validator.timestamp` +// +// Note: the map-keys must directly correspond to the internal representation of +// the original validator, and should only use primitive scalar types as values +// at this time. +message Validator { + string name = 1; + + // Additional configurations to be included as part of the validation + map config = 2; +} + +// Represents a named boolean feature flag supported by CEL. +// Naming convention followed by features: +// .feature. +// For ex: +// `cel.feature.cross_type_numeric_comparisons` +message Feature { + // Name of the feature flag. + string name = 1; + + // State of the feature flab. + bool enabled = 2; +} + +// Extension represents a versioned extension library reference to enable in the +// CEL environment. +message Extension { + // Name of the extension library. + string name = 1; + // Version of the extension library. + string version = 2; +} + +// LibrarySubset indicates a subset of the macros and functions supported by a +// subsettable library. +message LibrarySubset { + // Indicates whether the library has been disabled, typically only + // used for default-enabled libraries like stdlib. + bool disabled = 1; + + // Disables macros for the given library. + bool disable_macros = 2; + + // Specifies a set of macro function names to include in the subset. + repeated string include_macros = 3; + + // Specifies a set of macro function names to exclude from the subset. + // Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored. + repeated string exclude_macros = 4; + + // Specifies a set of functions to include in the subset. + // + // Note: the overloads specified in the subset need only specify their ID. + // Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored. + repeated cel.expr.Decl include_functions = 5; + + // Specifies the set of functions to exclude from the subset. + // + // Note: the overloads specified in the subset need only specify their ID. + repeated cel.expr.Decl exclude_functions = 6; +} diff --git a/proto/cel/expr/conformance/test/BUILD.bazel b/proto/cel/expr/conformance/test/BUILD.bazel index a7c89d5e..09eba1fc 100644 --- a/proto/cel/expr/conformance/test/BUILD.bazel +++ b/proto/cel/expr/conformance/test/BUILD.bazel @@ -2,6 +2,10 @@ package(default_visibility = ["//visibility:public"]) load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +############################################################################## +# Common +############################################################################## + proto_library( name = "simple_proto", srcs = ["simple.proto"], @@ -13,11 +17,37 @@ proto_library( ], ) +proto_library( + name = "suite_proto", + srcs = ["suite.proto"], + strip_import_prefix = "/proto", + deps = [ + "//proto/cel/expr:checked_proto", + "//proto/cel/expr:eval_proto", + "//proto/cel/expr:value_proto", + "//proto/cel/expr/conformance:env_config_proto", + "@com_google_protobuf//:any_proto", + ], +) + +############################################################################## +## C++ +############################################################################## + cc_proto_library( name = "simple_cc_proto", deps = [":simple_proto"], ) +cc_proto_library( + name = "suite_cc_proto", + deps = [":suite_proto"], +) + +############################################################################## +## Go +############################################################################## + go_proto_library( name = "simple_go_proto", importpath = "cel.dev/expr/conformance/test", @@ -27,7 +57,26 @@ go_proto_library( ], ) +go_proto_library( + name = "suite_go_proto", + importpath = "cel.dev/expr/conformance/test", + protos = [":suite_proto"], + deps = [ + "//proto/cel/expr:expr_go_proto", + "//proto/cel/expr/conformance:env_config_go_proto", + ], +) + +############################################################################## +## Java +############################################################################## + java_proto_library( name = "simple_java_proto", deps = [":simple_proto"], ) + +java_proto_library( + name = "suite_java_proto", + deps = [":suite_proto"], +) diff --git a/proto/cel/expr/conformance/test/simple.proto b/proto/cel/expr/conformance/test/simple.proto index b5c94e24..227fc091 100644 --- a/proto/cel/expr/conformance/test/simple.proto +++ b/proto/cel/expr/conformance/test/simple.proto @@ -31,6 +31,8 @@ option java_package = "dev.cel.expr.conformance.test"; // The format of a simple test file, expected to be stored in text format. // A file is the unit of granularity for selecting conformance tests, // so tests of optional features should be segregated into separate files. +// +// Deprecated: Use cel.expr.conformance.test.Suite message SimpleTestFile { // Required. The name of the file. Should match the filename. string name = 1; diff --git a/proto/cel/expr/conformance/test/suite.proto b/proto/cel/expr/conformance/test/suite.proto new file mode 100644 index 00000000..7295e6c7 --- /dev/null +++ b/proto/cel/expr/conformance/test/suite.proto @@ -0,0 +1,135 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Unit tests and end-to-end conformance tests. + +syntax = "proto3"; + +package cel.expr.conformance.test; + +import "cel/expr/checked.proto"; +import "cel/expr/eval.proto"; +import "cel/expr/value.proto"; +import "cel/expr/conformance/env_config.proto"; +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "cel.dev/expr/conformance/test"; +option java_multiple_files = true; +option java_outer_classname = "SuiteProto"; +option java_package = "dev.cel.expr.conformance.test"; + +// A test suite is a collection of tests designed to evaluate the correctness of +// a CEL policy, a CEL expression or the conformance of a CEL implementation to +// the standard specification. +message TestSuite { + // The name of the test suite. + string name = 1; + + // Description of the test suite. + string description = 2; + + // Test sections of the test suite. + // Each section represents a behavior to be tested. + repeated TestSection sections = 3; +} + +// A collection of related test cases. +message TestSection { + // Name of the test section. + string name = 1; + + // Description of the test section. + string description = 2; + + // Test cases of the test section. + // Each test case represents a test scenario. + repeated TestCase tests = 3; +} + +// A test to validate a CEL policy or expression. The test case encompasses +// evaluation of the compiled expression using the provided input bindings and +// asserting the result against the expected result. +// It can also validate a raw CEL expression string through parse, check and +// eval stages, making use of the augmenting CEL environment if provided. +message TestCase { + // Name of the test case. + string name = 1; + + // A description of the test. + string description = 2; + + // The text of the CEL expression. + string expr = 3; + + // Serialized environment to be used for compilation and evaluation of the + // CEL expression for the current test case. + // This option allows validating the same expression against multiple + // environments. + cel.expr.conformance.Environment env = 4; + + // Input for the test case + oneof input_kind { + // A set of variable bindings to be used for evaluating a checked + // expression. + Bindings bindings = 5; + + // A context message represents an input kind in the form of a proto + // message whose type is defined at runtime. + google.protobuf.Any context_message = 6; + + // A context expression representing a context proto variable. The + // fields of the input proto.Messages are used as top-level variables within + // an Activation. The expression is evaluated using the cel environment + // configured for the test suite. + string context_expr = 7; + } + + // Expected result of the test case. + oneof result_kind { + // A normal value, which must match the evaluation result exactly via value + // equality semantics. This coincides with proto equality, except for: + // * maps are order-agnostic + // * a floating point NaN should match any NaN + cel.expr.Value result_value = 8; + + // An expression to be evaluated using the cel environment configured for + // the test suite. The result of this expression must match the result of + // the test case. + string result_expr = 9; + + // An error evaluation result set. Success if we match all of the errors in + // the set. + cel.expr.ErrorSet eval_error = 10; + + // An unknown evaluation result. + cel.expr.UnknownSet unknown = 11; + } + + // If specified validates that the deduced type at check time matches + // If the result kind is not set and this field is set, the test is considered + // "check-only". + cel.expr.Type deduced_type = 12; + + // Bypass the type-checking and only attempt to evaluate the parsed + // expression. + bool disable_check = 13; +} + +// The bindings of input variables for the test case. +message Bindings { + // A map representing a variable binding where the key is the name of the + // input variable. + map values = 1; +}