File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
google/cloud/storage/quickstart Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,19 @@ $test_flags = $build_flags
4040$test_flags += @ (" --test_output=errors" , " --verbose_failures=true" )
4141
4242Write-Host " `n $ ( Get-Date - Format o) Compiling and running unit tests"
43- bazelisk $common_flags test $test_flags -- test_tag_filters=- integration- test ...
43+ # See #15678
44+ $exclude_build_targets = @ (" -//google/cloud/bigtable:internal_query_plan_test" , `
45+ " -//google/cloud/storage/tests:storage_include_test-default" , `
46+ " -//google/cloud/storage/tests:storage_include_test-grpc-metadata" , `
47+ " -//google/cloud/pubsub/samples:all" )
48+ bazelisk $common_flags test $test_flags -- test_tag_filters=- integration- test ... -- $exclude_build_targets
4449if ($LastExitCode ) {
4550 Write-Host - ForegroundColor Red " bazel test failed with exit code ${LastExitCode} ."
4651 Exit ${LastExitCode}
4752}
4853
4954Write-Host " `n $ ( Get-Date - Format o) Compiling extra programs with bazel $common_flags build $build_flags ..."
50- bazelisk $common_flags build $build_flags ...
55+ bazelisk $common_flags build $build_flags ... -- $exclude_build_targets
5156if ($LastExitCode ) {
5257 Write-Host - ForegroundColor Red " bazel build failed with exit code ${LastExitCode} ."
5358 Exit ${LastExitCode}
@@ -80,6 +85,7 @@ if (Test-Integration-Enabled) {
8085 Write-Host " `n $ ( Get-Date - Format o) Running minimal quickstart prorams"
8186 Install-Roots - Pem
8287 ${env: GRPC_DEFAULT_SSL_ROOTS_FILE_PATH} = " ${env: KOKORO_GFILE_DIR} /roots.pem"
88+ ${env: CURL_CA_BUNDLE} = " ${env: KOKORO_GFILE_DIR} /roots.pem"
8389 ${env: GOOGLE_APPLICATION_CREDENTIALS} = " ${env: KOKORO_GFILE_DIR} /kokoro-run-key.json"
8490 Invoke-REST - Quickstart
8591 Invoke-gRPC - Quickstart
Original file line number Diff line number Diff line change 1414
1515// ! [all]
1616#include " google/cloud/storage/client.h"
17+ #include " google/cloud/common_options.h"
18+ #include < cstdlib>
1719#include < iostream>
1820#include < string>
1921
@@ -27,7 +29,17 @@ int main(int argc, char* argv[]) {
2729
2830 // Create a client to communicate with Google Cloud Storage. This client
2931 // uses the default configuration for authentication and project id.
30- auto client = google::cloud::storage::Client ();
32+ auto options = google::cloud::Options{};
33+
34+ // If the CURL_CA_BUNDLE environment variable is set, configure the client
35+ // to use it. This is required for the Windows CI environment where standard
36+ // system roots may not be sufficient or accessible by the hermetic build.
37+ auto const * ca_bundle = std::getenv (" CURL_CA_BUNDLE" );
38+ if (ca_bundle != nullptr ) {
39+ options.set <google::cloud::CARootsFilePathOption>(ca_bundle);
40+ }
41+
42+ auto client = google::cloud::storage::Client (options);
3143
3244 auto writer = client.WriteObject (bucket_name, " quickstart.txt" );
3345 writer << " Hello World!" ;
You can’t perform that action at this time.
0 commit comments