Skip to content

Commit 2a7e8a7

Browse files
tswastbshaffer
authored andcommitted
Contributing: Add instructions for running tests (GoogleCloudPlatform#592)
1 parent 9ce6446 commit 2a7e8a7

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ accept your pull requests.
2626
1. If your proposed change is accepted, and you haven't already done so, sign a
2727
Contributor License Agreement (see details above).
2828
1. Fork the desired repo, develop and test your code changes.
29+
30+
To run the tests, first set up [application default
31+
credentials](https://cloud.google.com/docs/authentication/getting-started)
32+
by setting the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the
33+
path to a service account key JSON file.
34+
35+
Then set any environment variables needed by the test. Check the
36+
`$SAMPLES_DIRECTORY/test` directory to see what specific variables are needed.
37+
```
38+
export GOOGLE_PROJECT_ID=YOUR_PROJECT_ID
39+
export GOOGLE_BUCKET_NAME=YOUR_BUCKET
40+
```
41+
42+
To run the tests in a samples directory,
43+
```
44+
cd $SAMPLES_DIRECTORY
45+
composer install
46+
vendor/bin/phpunit
47+
```
48+
2949
1. Ensure that your code adheres to the existing style in the sample to which
3050
you are contributing.
3151
1. Ensure that your code has an appropriate set of unit tests which all pass.

0 commit comments

Comments
 (0)