Repository: kythe/kythe
Pull request #4195 (2019-11-07 20:49:25)

fix(kzip info): don't count compilation units by corpus
the corpus specified in the unit vname is optional and only used as a
default for required_inputs that don't specify a corpus. instead of
keeping a count of the optionally-specified unit corpus, just count the
required_inputs and sources by corpus.

if a corpus can not be determined for a file, an error is recorded in
KzipInfo.critical_validation_errors


Patch:
diff --git a/kythe/go/platform/kzip/info/BUILD b/kythe/go/platform/kzip/info/BUILD
index ab0669aa9..30f0964c7 100644
--- a/kythe/go/platform/kzip/info/BUILD
+++ b/kythe/go/platform/kzip/info/BUILD
@@ -21,6 +21,7 @@ go_test(
     library = ":info",
     deps = [
         "//kythe/proto:analysis_go_proto",
+        "//kythe/proto:storage_go_proto",
         "@com_github_golang_protobuf//proto:go_default_library",
     ],
 )
diff --git a/kythe/go/platform/kzip/info/info.go b/kythe/go/platform/kzip/info/info.go
index cd4020f37..82b1351f5 100644
--- a/kythe/go/platform/kzip/info/info.go
+++ b/kythe/go/platform/kzip/info/info.go
@@ -28,15 +28,11 @@ import (
 	apb "kythe.io/kythe/proto/analysis_go_proto"
 )
 
-// If the compilation unit doesn't set a corpus, use this corpus so we have somewhere to record the
-// stats.
-const unspecifiedCorpus = "__UNSPECIFIED_CORPUS__"
-
 // KzipInfo scans the kzip in f and counts contained files and units, giving a breakdown by corpus
 // and language. It also records the size (in bytes) of the kzip specified by fileSize in the
 // returned KzipInfo.
 func KzipInfo(f kzip.File, fileSize int64, scanOpts ...kzip.ScanOption) (*apb.KzipInfo, error) {
-	// Get file and unit counts broken down by corpus, language.
+	// Get file counts broken down by corpus, language.
 	kzipInfo := &apb.KzipInfo{
 		Corpora: make(map[string]*apb.KzipInfo_CorpusInfo),
 		Size:    fileSize,
@@ -44,22 +40,22 @@ func KzipInfo(f kzip.File, fileSize int64, scanOpts ...kzip.ScanOption) (*apb.Kz
 
 	err := kzip.Scan(f, func(rd *kzip.Reader, u *kzip.Unit) error {
 		srcs := stringset.New(u.Proto.SourceFile...)
-		// The corpus may be specified in the unit VName or in the source file
-		// VNames. Record all values of corpus seen and afterwards check that a
-		// single value is specified.
-		cuCorpus := u.Proto.GetVName().GetCorpus()
-		if cuCorpus == "" {
-			log.Printf("Warning: Corpus not set for compilation unit %v", u.Proto.GetVName())
-			cuCorpus = unspecifiedCorpus
-		}
 		cuLang := u.Proto.GetVName().GetLanguage()
-		cuInfo := cuLangInfo(cuCorpus, cuLang, kzipInfo)
-		cuInfo.Count++
+		if cuLang == "" {
+			msg := fmt.Sprintf("CU does not specify a language %v", u.Proto.GetVName())
+			kzipInfo.CriticalKzipErrors = append(kzipInfo.CriticalKzipErrors, msg)
+			return nil
+		}
 
 		var srcCorpora stringset.Set
 		srcsWithRI := stringset.New()
 		for _, ri := range u.Proto.RequiredInput {
 			riCorpus := requiredInputCorpus(u, ri)
+			if riCorpus == "" {
+				msg := fmt.Sprintf("unable to determine corpus for required_input %q in CU %v", ri.Info.Path, u.Proto.GetVName())
+				kzipInfo.CriticalKzipErrors = append(kzipInfo.CriticalKzipErrors, msg)
+				return nil
+			}
 			requiredInputInfo(riCorpus, cuLang, kzipInfo).Count++
 			if srcs.Contains(ri.Info.Path) {
 				sourceInfo(riCorpus, cuLang, kzipInfo).Count++
@@ -99,20 +95,11 @@ func requiredInputCorpus(u *kzip.Unit, ri *apb.CompilationUnit_FileInput) string
 // KzipInfoTotalCount returns the total CompilationUnits counts for infos split apart by language.
 func KzipInfoTotalCount(infos []*apb.KzipInfo) apb.KzipInfo_CorpusInfo {
 	totals := apb.KzipInfo_CorpusInfo{
-		LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
-		LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
-		LanguageSources:          make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+		LanguageRequiredInputs: make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+		LanguageSources:        make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 	}
 	for _, info := range infos {
 		for _, i := range info.GetCorpora() {
-			for lang, stats := range i.GetLanguageCompilationUnits() {
-				langTotal := totals.LanguageCompilationUnits[lang]
-				if langTotal == nil {
-					langTotal = &apb.KzipInfo_CorpusInfo_CompilationUnits{}
-					totals.LanguageCompilationUnits[lang] = langTotal
-				}
-				langTotal.Count += stats.GetCount()
-			}
 			for lang, stats := range i.GetLanguageRequiredInputs() {
 				total := totals.LanguageRequiredInputs[lang]
 				if total == nil {
@@ -140,10 +127,6 @@ func MergeKzipInfo(infos []*apb.KzipInfo) *apb.KzipInfo {
 
 	for _, i := range infos {
 		for corpus, cinfo := range i.GetCorpora() {
-			for lang, cu := range cinfo.GetLanguageCompilationUnits() {
-				cui := cuLangInfo(corpus, lang, kzipInfo)
-				cui.Count += cu.GetCount()
-			}
 			for lang, inputs := range cinfo.GetLanguageRequiredInputs() {
 				c := requiredInputInfo(corpus, lang, kzipInfo)
 				c.Count += inputs.GetCount()
@@ -159,16 +142,6 @@ func MergeKzipInfo(infos []*apb.KzipInfo) *apb.KzipInfo {
 	return kzipInfo
 }
 
-func cuLangInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo_CompilationUnits {
-	c := corpusInfo(corpus, kzipInfo)
-	cui := c.LanguageCompilationUnits[lang]
-	if cui == nil {
-		cui = &apb.KzipInfo_CorpusInfo_CompilationUnits{}
-		c.LanguageCompilationUnits[lang] = cui
-	}
-	return cui
-}
-
 func requiredInputInfo(corpus, lang string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo_RequiredInputs {
 	c := corpusInfo(corpus, kzipInfo)
 	lri := c.LanguageRequiredInputs[lang]
@@ -193,9 +166,8 @@ func corpusInfo(corpus string, kzipInfo *apb.KzipInfo) *apb.KzipInfo_CorpusInfo
 	i := kzipInfo.GetCorpora()[corpus]
 	if i == nil {
 		i = &apb.KzipInfo_CorpusInfo{
-			LanguageCompilationUnits: make(map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits),
-			LanguageRequiredInputs:   make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
-			LanguageSources:          make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+			LanguageRequiredInputs: make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
+			LanguageSources:        make(map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs),
 		}
 		kzipInfo.Corpora[corpus] = i
 	}
diff --git a/kythe/proto/analysis.proto b/kythe/proto/analysis.proto
index e9fc6bc25..b7030c97b 100644
--- a/kythe/proto/analysis.proto
+++ b/kythe/proto/analysis.proto
@@ -183,20 +183,7 @@ message KzipInfo {
   reserved 2, 3;
 
   message CorpusInfo {
-    reserved 1, 2;
-
-    // The count of data present in compilation units for a given corpus and
-    // language.
-    message CompilationUnits {
-      reserved 2, 3;
-
-      // Number of compilation units that have a specific corpus in their VName.
-      int32 count = 1;
-    }
-
-    // Map from compilation unit language to stats about compilation units with
-    // that language.
-    map<string, CompilationUnits> language_compilation_units = 3;
+    reserved 1, 2, 3;
 
     message RequiredInputs {
       // TODO(salguarnieri) Add count of unique inputs for this corpus?
diff --git a/kythe/proto/analysis_go_proto/analysis.pb.go b/kythe/proto/analysis_go_proto/analysis.pb.go
index fe4a9ee4b..a552bef0b 100644
--- a/kythe/proto/analysis_go_proto/analysis.pb.go
+++ b/kythe/proto/analysis_go_proto/analysis.pb.go
@@ -476,12 +476,11 @@ func (m *KzipInfo) GetCriticalKzipErrors() []string {
 }
 
 type KzipInfo_CorpusInfo struct {
-	LanguageCompilationUnits map[string]*KzipInfo_CorpusInfo_CompilationUnits `protobuf:"bytes,3,rep,name=language_compilation_units,json=languageCompilationUnits,proto3" json:"language_compilation_units,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
-	LanguageRequiredInputs   map[string]*KzipInfo_CorpusInfo_RequiredInputs   `protobuf:"bytes,4,rep,name=language_required_inputs,json=languageRequiredInputs,proto3" json:"language_required_inputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
-	LanguageSources          map[string]*KzipInfo_CorpusInfo_RequiredInputs   `protobuf:"bytes,5,rep,name=language_sources,json=languageSources,proto3" json:"language_sources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
-	XXX_NoUnkeyedLiteral     struct{}                                         `json:"-"`
-	XXX_unrecognized         []byte                                           `json:"-"`
-	XXX_sizecache            int32                                            `json:"-"`
+	LanguageRequiredInputs map[string]*KzipInfo_CorpusInfo_RequiredInputs `protobuf:"bytes,4,rep,name=language_required_inputs,json=languageRequiredInputs,proto3" json:"language_required_inputs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	LanguageSources        map[string]*KzipInfo_CorpusInfo_RequiredInputs `protobuf:"bytes,5,rep,name=language_sources,json=languageSources,proto3" json:"language_sources,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	XXX_NoUnkeyedLiteral   struct{}                                       `json:"-"`
+	XXX_unrecognized       []byte                                         `json:"-"`
+	XXX_sizecache          int32                                          `json:"-"`
 }
 
 func (m *KzipInfo_CorpusInfo) Reset()         { *m = KzipInfo_CorpusInfo{} }
@@ -509,13 +508,6 @@ func (m *KzipInfo_CorpusInfo) XXX_DiscardUnknown() {
 
 var xxx_messageInfo_KzipInfo_CorpusInfo proto.InternalMessageInfo
 
-func (m *KzipInfo_CorpusInfo) GetLanguageCompilationUnits() map[string]*KzipInfo_CorpusInfo_CompilationUnits {
-	if m != nil {
-		return m.LanguageCompilationUnits
-	}
-	return nil
-}
-
 func (m *KzipInfo_CorpusInfo) GetLanguageRequiredInputs() map[string]*KzipInfo_CorpusInfo_RequiredInputs {
 	if m != nil {
 		return m.LanguageRequiredInputs
@@ -530,45 +522,6 @@ func (m *KzipInfo_CorpusInfo) GetLanguageSources() map[string]*KzipInfo_CorpusIn
 	return nil
 }
 
-type KzipInfo_CorpusInfo_CompilationUnits struct {
-	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *KzipInfo_CorpusInfo_CompilationUnits) Reset()         { *m = KzipInfo_CorpusInfo_CompilationUnits{} }
-func (m *KzipInfo_CorpusInfo_CompilationUnits) String() string { return proto.CompactTextString(m) }
-func (*KzipInfo_CorpusInfo_CompilationUnits) ProtoMessage()    {}
-func (*KzipInfo_CorpusInfo_CompilationUnits) Descriptor() ([]byte, []int) {
-	return fileDescriptor_8e4ea7eca60afe48, []int{4, 0, 0}
-}
-
-func (m *KzipInfo_CorpusInfo_CompilationUnits) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits.Unmarshal(m, b)
-}
-func (m *KzipInfo_CorpusInfo_CompilationUnits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits.Marshal(b, m, deterministic)
-}
-func (m *KzipInfo_CorpusInfo_CompilationUnits) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits.Merge(m, src)
-}
-func (m *KzipInfo_CorpusInfo_CompilationUnits) XXX_Size() int {
-	return xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits.Size(m)
-}
-func (m *KzipInfo_CorpusInfo_CompilationUnits) XXX_DiscardUnknown() {
-	xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_KzipInfo_CorpusInfo_CompilationUnits proto.InternalMessageInfo
-
-func (m *KzipInfo_CorpusInfo_CompilationUnits) GetCount() int32 {
-	if m != nil {
-		return m.Count
-	}
-	return 0
-}
-
 type KzipInfo_CorpusInfo_RequiredInputs struct {
 	Count                int32    `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
 	XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -580,7 +533,7 @@ func (m *KzipInfo_CorpusInfo_RequiredInputs) Reset()         { *m = KzipInfo_Cor
 func (m *KzipInfo_CorpusInfo_RequiredInputs) String() string { return proto.CompactTextString(m) }
 func (*KzipInfo_CorpusInfo_RequiredInputs) ProtoMessage()    {}
 func (*KzipInfo_CorpusInfo_RequiredInputs) Descriptor() ([]byte, []int) {
-	return fileDescriptor_8e4ea7eca60afe48, []int{4, 0, 2}
+	return fileDescriptor_8e4ea7eca60afe48, []int{4, 0, 0}
 }
 
 func (m *KzipInfo_CorpusInfo_RequiredInputs) XXX_Unmarshal(b []byte) error {
@@ -893,10 +846,8 @@ func init() {
 	proto.RegisterType((*KzipInfo)(nil), "kythe.proto.KzipInfo")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo)(nil), "kythe.proto.KzipInfo.CorporaEntry")
 	proto.RegisterType((*KzipInfo_CorpusInfo)(nil), "kythe.proto.KzipInfo.CorpusInfo")
-	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageCompilationUnitsEntry")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageRequiredInputsEntry")
 	proto.RegisterMapType((map[string]*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.LanguageSourcesEntry")
-	proto.RegisterType((*KzipInfo_CorpusInfo_CompilationUnits)(nil), "kythe.proto.KzipInfo.CorpusInfo.CompilationUnits")
 	proto.RegisterType((*KzipInfo_CorpusInfo_RequiredInputs)(nil), "kythe.proto.KzipInfo.CorpusInfo.RequiredInputs")
 	proto.RegisterType((*FilesRequest)(nil), "kythe.proto.FilesRequest")
 	proto.RegisterType((*FileInfo)(nil), "kythe.proto.FileInfo")
@@ -909,76 +860,72 @@ func init() {
 func init() { proto.RegisterFile("kythe/proto/analysis.proto", fileDescriptor_8e4ea7eca60afe48) }
 
 var fileDescriptor_8e4ea7eca60afe48 = []byte{
-	// 1125 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5b, 0x6f, 0x1b, 0x45,
-	0x14, 0x66, 0x7d, 0x5d, 0x1f, 0xbb, 0x89, 0x33, 0x84, 0x6a, 0xbb, 0x6d, 0x55, 0xcb, 0xa8, 0x55,
-	0x4b, 0x91, 0x03, 0x06, 0x0a, 0x6a, 0xaa, 0x48, 0xb9, 0x18, 0xe4, 0x34, 0x4d, 0x61, 0xd3, 0xf6,
-	0x01, 0x21, 0x2d, 0x13, 0xef, 0xd8, 0x19, 0x65, 0x3d, 0xe3, 0xee, 0xcc, 0x9a, 0x3a, 0x42, 0xfc,
-	0x0d, 0x7e, 0x00, 0x6f, 0x88, 0x47, 0x9e, 0x78, 0xe1, 0x6f, 0xf1, 0x88, 0x66, 0x66, 0xd7, 0xde,
-	0x4d, 0x73, 0x2b, 0x12, 0x4f, 0x3b, 0xe7, 0xfa, 0x9d, 0x39, 0xb7, 0x1d, 0x70, 0x8f, 0x67, 0xf2,
-	0x88, 0xac, 0x4d, 0x22, 0x2e, 0xf9, 0x1a, 0x66, 0x38, 0x9c, 0x09, 0x2a, 0x3a, 0x9a, 0x44, 0x75,
-	0x2d, 0x33, 0x84, 0x7b, 0x63, 0xc4, 0xf9, 0x28, 0x4c, 0x34, 0x0f, 0xe3, 0xe1, 0x1a, 0x66, 0xb3,
-	0x54, 0x94, 0xf5, 0x21, 0x24, 0x8f, 0xf0, 0x28, 0xb1, 0x6a, 0xff, 0x69, 0xc1, 0xf2, 0x66, 0xe2,
-	0xd5, 0x23, 0xaf, 0x63, 0x22, 0x24, 0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 0x17, 0xd3, 0xbe, 0x03, 0x65,
+	0x2b, 0xa3, 0x5b, 0x50, 0xcf, 0xfe, 0xd5, 0xb8, 0xb1, 0xd6, 0xf1, 0x52, 0xb1, 0xf3, 0x15, 0xdc,
+	0x1e, 0x8a, 0x49, 0xf6, 0xe0, 0x46, 0x74, 0xa6, 0x85, 0x88, 0x55, 0x1e, 0xe9, 0xfb, 0x8d, 0xec,
+	0x9f, 0x5f, 0x38, 0x16, 0xa1, 0x55, 0xfd, 0xe5, 0x79, 0xc7, 0x15, 0x7b, 0xfa, 0xe2, 0xef, 0x00,
+	0x00, 0x00, 0xff, 0xff, 0x37, 0x6c, 0x7f, 0xc6, 0x24, 0x0a, 0x00, 0x00,
 }


Test patch:
diff --git a/kythe/go/platform/kzip/info/info_test.go b/kythe/go/platform/kzip/info/info_test.go
index 8690f0579..106d12dbd 100644
--- a/kythe/go/platform/kzip/info/info_test.go
+++ b/kythe/go/platform/kzip/info/info_test.go
@@ -17,11 +17,14 @@
 package info
 
 import (
+	"bytes"
 	"testing"
 
+	"kythe.io/kythe/go/platform/kzip"
 	"kythe.io/kythe/go/util/compare"
 
 	apb "kythe.io/kythe/proto/analysis_go_proto"
+	spb "kythe.io/kythe/proto/storage_go_proto"
 )
 
 func TestMergeKzipInfo(t *testing.T) {
@@ -29,11 +32,6 @@ func TestMergeKzipInfo(t *testing.T) {
 		{
 			Corpora: map[string]*apb.KzipInfo_CorpusInfo{
 				"corpus1": {
-					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-						"python": {
-							Count: 1,
-						},
-					},
 					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 						"python": {
 							Count: 2,
@@ -52,14 +50,6 @@ func TestMergeKzipInfo(t *testing.T) {
 		{
 			Corpora: map[string]*apb.KzipInfo_CorpusInfo{
 				"corpus1": {
-					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-						"python": {
-							Count: 1,
-						},
-						"go": {
-							Count: 1,
-						},
-					},
 					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 						"python": {
 							Count: 1,
@@ -67,14 +57,6 @@ func TestMergeKzipInfo(t *testing.T) {
 					},
 				},
 				"corpus2": {
-					LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-						"python": {
-							Count: 4,
-						},
-						"java": {
-							Count: 3,
-						},
-					},
 					LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 						"python": {
 							Count: 5,
@@ -106,14 +88,6 @@ func TestMergeKzipInfo(t *testing.T) {
 	want := &apb.KzipInfo{
 		Corpora: map[string]*apb.KzipInfo_CorpusInfo{
 			"corpus1": {
-				LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-					"python": {
-						Count: 2,
-					},
-					"go": {
-						Count: 1,
-					},
-				},
 				LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 					"python": {
 						Count: 3,
@@ -126,14 +100,6 @@ func TestMergeKzipInfo(t *testing.T) {
 				},
 			},
 			"corpus2": {
-				LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-					"python": {
-						Count: 4,
-					},
-					"java": {
-						Count: 3,
-					},
-				},
 				LanguageSources: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 					"python": {
 						Count: 5,
@@ -161,17 +127,6 @@ func TestMergeKzipInfo(t *testing.T) {
 		Size:               40,
 	}
 	wantTotal := apb.KzipInfo_CorpusInfo{
-		LanguageCompilationUnits: map[string]*apb.KzipInfo_CorpusInfo_CompilationUnits{
-			"python": {
-				Count: 6,
-			},
-			"go": {
-				Count: 1,
-			},
-			"java": {
-				Count: 3,
-			},
-		},
 		LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
 			"python": {
 				Count: 12,
@@ -203,3 +158,76 @@ func TestMergeKzipInfo(t *testing.T) {
 		t.Errorf("Merged kzips don't match: (-: found, +: expected)\n%s", diff)
 	}
 }
+
+func makeKzip(t *testing.T, u *apb.CompilationUnit) *bytes.Reader {
+	b := bytes.NewBuffer(nil)
+	w, err := kzip.NewWriter(b)
+	if err != nil {
+		t.Fatalf("opening writer: %v", err)
+	}
+	if _, err = w.AddUnit(u, nil); err != nil {
+		t.Fatalf("AddUnit: unexpected error: %v", err)
+	}
+	if err := w.Close(); err != nil {
+		t.Fatalf("Writer.Close: unexpected error: %v", err)
+	}
+	return bytes.NewReader(b.Bytes())
+}
+
+var infoTests = []struct {
+	in  *apb.CompilationUnit
+	out *apb.KzipInfo
+}{
+	{
+		&apb.CompilationUnit{
+			VName: &spb.VName{Language: "python"},
+			RequiredInput: []*apb.CompilationUnit_FileInput{
+				{
+					VName: &spb.VName{Corpus: "mycorpus", Language: "python", Path: "file1.py"},
+					Info:  &apb.FileInfo{Path: "file1.py"},
+				},
+			},
+		},
+		&apb.KzipInfo{
+			Corpora: map[string]*apb.KzipInfo_CorpusInfo{
+				"mycorpus": {
+					LanguageRequiredInputs: map[string]*apb.KzipInfo_CorpusInfo_RequiredInputs{
+						"python": {
+							Count: 1,
+						},
+					},
+				},
+			},
+		},
+	},
+
+	{
+		&apb.CompilationUnit{
+			VName: &spb.VName{Language: "python"},
+			RequiredInput: []*apb.CompilationUnit_FileInput{
+				{
+					VName: &spb.VName{Language: "python", Path: "file1.py"},
+					Info:  &apb.FileInfo{Path: "file1.py"},
+				},
+			},
+		},
+		&apb.KzipInfo{
+			CriticalKzipErrors: []string{"unable to determine corpus for required_input \"file1.py\" in CU language:\"python\" "},
+		},
+	},
+}
+
+func TestInfo(t *testing.T) {
+	for _, testcase := range infoTests {
+		kz := makeKzip(t, testcase.in)
+		got, err := KzipInfo(kz, 0)
+		if err != nil {
+			t.Error(err)
+			continue
+		}
+
+		if diff := compare.ProtoDiff(testcase.out, got); diff != "" {
+			t.Errorf("KzipInfo() output differs from expected (-: found, +: expected)\n%s", diff)
+		}
+	}
+}