Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pubsub): install pubsub_mocks pkg #10008

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented Oct 10, 2022

Part of the work for #5782

  • Move google-cloud-cpp::pubsub_mocks out of pubsub-targets and into pubsub_mocks-targets.
    • Is this a breaking change?
  • Add a google_cloud_cpp_pubsub_mocks pkg

I have no idea if this works. Or how to test it.

But I can (from the demo-fedora-pr docker shell)

docker:demo-fedora$ ls /h/google-cloud-cpp-installed/lib64/cmake/google_cloud_cpp_pubsub_mocks/
google_cloud_cpp_pubsub_mocks-config-version.cmake  pubsub_mocks-targets.cmake
google_cloud_cpp_pubsub_mocks-config.cmake

# the pubsub one has a `noconfig.cmake`... whatever that means.
docker:demo-fedora$ PKG_CONFIG_PATH="/h/google-cloud-cpp-installed/lib64/pkgconfig:${PKG_CONFIG_PATH:-}"
docker:demo-fedora$ pkg-config --validate google_cloud_cpp_pubsub_mocks

of course, GTest is not installed on that image, so I don't know what is being validated. /shrug


This change is Reviewable

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Oct 10, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 0ec2c0da6ade878665d2d8870a66e1ac6890459e

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Base: 93.96% // Head: 93.97% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (dcab21d) compared to base (29bf45f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10008   +/-   ##
=======================================
  Coverage   93.96%   93.97%           
=======================================
  Files        1513     1513           
  Lines      139964   139964           
=======================================
+ Hits       131524   131532    +8     
+ Misses       8440     8432    -8     
Impacted Files Coverage Δ
google/cloud/storage/parallel_upload.cc 98.62% <0.00%> (+0.34%) ⬆️
...cloud/pubsub/internal/subscription_session_test.cc 98.82% <0.00%> (+0.83%) ⬆️
...bigtable/examples/bigtable_hello_instance_admin.cc 83.00% <0.00%> (+2.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 0ec42be2be2d732b001e55ab5dce9c661f25bd0c

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@dbolduc dbolduc requested a review from coryan October 10, 2022 14:56
@dbolduc dbolduc marked this pull request as ready for review October 10, 2022 14:57
@dbolduc dbolduc requested a review from a team as a code owner October 10, 2022 14:57
Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

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

I am not sure this is breaking either:

  • How would a customer use the mocks library before? Did it work? If the answer is "it could not work" then this is not breaking, you are fixing a broken thing.

To test this, we need a thing in the cmake-install build that uses it. We typically hijack the quickstarts for that purpose, but maybe you need something more ad-hoc.

Maybe you could extend ci/verify_current_targets to also check the mocks?

@@ -0,0 +1,19 @@
# Copyright 2020 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: copyright year

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

# limitations under the License.

include(CMakeFindDependencyMacro)
find_dependency(google_cloud_cpp_pubsub)
Copy link
Contributor

Choose a reason for hiding this comment

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

if this was something like:

find_dependency(@GOOGLE_CLOUD_CPP_WE_NEED_A_NAME@)

then this file could be a generic file shared by all the libraries.

Maybe for a future PR?

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 have taken a mental note.

We would probably use a macro for just the service name (e.g. pubsub) because we include @LIBRARY@-targets.cmake below.


include(CMakeFindDependencyMacro)
find_dependency(google_cloud_cpp_pubsub)
find_dependency(gtest)
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a bit of a mess with FindGTest (the built-in module in CMake) vs. the config file installed by googletest:

https://cmake.org/cmake/help/latest/module/FindGTest.html

Maybe we should install a file like this and include it instead?

https://github.com/googleapis/google-cloud-cpp/blob/main/cmake/FindGMockWithTargets.cmake

Copy link
Member Author

Choose a reason for hiding this comment

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

As you pointed out, there is incremental progress to be made by installing in cases where FindGTest works. We can figure out how to test the other case in our CI later.

@dbolduc dbolduc marked this pull request as draft October 17, 2022 15:39
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: dcab21d8be1b6505cfed14e69c70d668204e0034

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@dbolduc dbolduc marked this pull request as ready for review October 27, 2022 06:45
@dbolduc dbolduc merged commit 69561fe into googleapis:main Oct 27, 2022
@dbolduc dbolduc deleted the pubsub-mocks-add-pkgconfig branch October 27, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants