google-cloud-rust icon indicating copy to clipboard operation
google-cloud-rust copied to clipboard

Run handwritten examples in veneer clients

Open dbolduc opened this issue 8 months ago • 1 comments

The storage client has handwritten samples using placeholder values like "my-project", "my-bucket". Ideally we would run these things to make sure the formats are correct, and stay correct.


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

Originally posted by @dbolduc in https://github.com/googleapis/google-cloud-rust/pull/1927#discussion_r2063708321

dbolduc avatar Apr 28 '25 18:04 dbolduc

It took me several iterations to get a create_bucket request to work.

https://github.com/googleapis/google-cloud-rust/blob/57a698a58b133d43c2746c25d4c343c5d95909f2/src/integration-tests/src/storage.rs#L47-L55

The result does not look much like our sample.

dbolduc avatar Apr 28 '25 23:04 dbolduc

Can we close this? The examples are gone.

coryan avatar Jul 23 '25 18:07 coryan