-
Notifications
You must be signed in to change notification settings - Fork 53
feat(storage): initial client and integration test #1927
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(storage): initial client and integration test #1927
Conversation
/cc: @BenWhitehead |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1927 +/- ##
==========================================
- Coverage 96.32% 95.67% -0.66%
==========================================
Files 56 57 +1
Lines 2042 2056 +14
==========================================
Hits 1967 1967
- Misses 75 89 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f5e56fe
to
b7f0d61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly curious about update_bucket
src/integration-tests/Cargo.toml
Outdated
path = "../../src/generated/cloud/secretmanager/v1" | ||
package = "google-cloud-secretmanager-v1" | ||
path = "../../src/generated/cloud/secretmanager/v1" | ||
default-features = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this crate has no features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -78,6 +78,17 @@ mod driver { | |||
.map_err(report) | |||
} | |||
|
|||
#[test_case(storage::client::Storage::builder().with_tracing().with_retry_policy(retry_policy()); "with tracing enabled")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: Add?
#[test_case(storage::client::Storage::builder(); "default")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe once the default have retry policies enabled.
I want to minimize the chance of flakes, we know GCS can return errors due to quota / rate limits. Specially for Bucket writes (at most one of those every 2 seconds).
/// For globally unique buckets, `_` may be substituted for the project. | ||
/// | ||
/// - Objects are uniquely identified by their name along with the name of the | ||
/// bucket they belong to, as separate strings in this API. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include a sample bucket name after "For example:"
/// ``` | ||
/// # use google_cloud_storage::client::Storage; | ||
/// async fn example(client: &Storage) -> gax::Result<()> { | ||
/// let bucket = client.create_bucket("projects/my-project", "my-bucket").send().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we concerned about handwritten sample code that doesn't run?
We could maybe use #[doc(include = example.rs)
for the sample body, and run the examples in our integration tests.
Also, this is a thing: https://doc.rust-lang.org/stable/rustdoc/scraped-examples.html
(Non-blocking for this PR, but potentially something we want in the long term)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Agree.
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity | ||
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc | ||
#[derive(Clone, Debug)] | ||
pub struct Storage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dare I ask about mocking this client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should ask, I have no answer for that yet.
Part of the work for #1813