From 6b360f92f9cd6c1440b20128c3d86a04aadcbe78 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Thu, 9 Sep 2021 17:17:54 +0200 Subject: [PATCH] Contribution guide --- CONTRIBUTING.md | 16 ++++++++++++++++ README.md | 4 ++++ spec/spec_helper.rb | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9365c3a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contribution guide + +## Running tests + +To run the test suite, you need a Google Cloud Storage bucket and a Service Account with a key. You must also set the following environment variables: + + * `TEST_GCLOUD_BUCKET` — the name of the bucket. + * `TEST_GCLOUD_CREDENTIALS_PATH` — path to the Service Account's keyfile. + +It's best to put these in a `.env` file so that you don't have to supply these variables over and over. The test suite automatically loads environment variables from `.env`. + +Then run the test suite with: + +~~~bash +bundle exec rspec +~~~ diff --git a/README.md b/README.md index e2bb90c..e02a401 100644 --- a/README.md +++ b/README.md @@ -154,3 +154,7 @@ DistributedLock::GoogleCloudStorage::Lock( logger: logger, ) ~~~ + +## Contributing + +Please read the [Contribution guide](CONTRIBUTING.md). diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ce01981..2083ca7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'dotenv' require 'google/cloud/errors' require 'rspec/retry'