Skip to content

Test cached module identity#2159

Merged
unmultimedio merged 4 commits intomainfrom
jfigueroa/test-cached-module-identity
Jun 5, 2023
Merged

Test cached module identity#2159
unmultimedio merged 4 commits intomainfrom
jfigueroa/test-cached-module-identity

Conversation

@unmultimedio
Copy link
Member

Test for #2152

@unmultimedio unmultimedio requested review from bufdev and pkwarren June 5, 2023 18:24
@unmultimedio unmultimedio self-assigned this Jun 5, 2023
fileInfos, err := module.SourceFileInfos(context.Background())
require.NoError(t, err)
for _, fileInfo := range fileInfos {
require.NotNil(t, fileInfo.ModuleIdentity())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a little surprised that there was no way to do module.Identity(), but I needed to loop over the files. I assume there's no way to access a module identity from a module with no proto files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modules always have .proto files - its invalid to have an empty module. ModuleFileSets inherit from Modules, and ModuleFileSets will have files from different Modules, meaning that you need to get identity at the file level given this inheritance.

@unmultimedio unmultimedio merged commit 78537dd into main Jun 5, 2023
@unmultimedio unmultimedio deleted the jfigueroa/test-cached-module-identity branch June 5, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants