Skip to content

Commit

Permalink
Merge pull request googleapis#516 from ryanseys/system-tests
Browse files Browse the repository at this point in the history
Change regression tests to system tests
  • Loading branch information
stephenplusplus committed Apr 30, 2015
2 parents 281dbff + e143f8a commit 686fe62
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ To run the unit tests, simply run:
$ npm test
```

### Regression Tests
### System Tests

To run the regression tests, first create and configure a project in the Google Developers Console following the [instructions on how to run gcloud-node][elsewhere]. After that, set the following environment variables:
To run the system tests, first create and configure a project in the Google Developers Console following the [instructions on how to run gcloud-node][elsewhere]. After that, set the following environment variables:

- **GCLOUD_TESTS_PROJECT_ID**: Developers Console project's ID (e.g. bamboo-shift-455)
- **GCLOUD_TESTS_KEY**: The path to the JSON key file.

Install the [gcloud command-line tool][gcloudcli] to your machine and use it to create the indexes used in the datastore regression tests with indexes found in `regression/data/index/yaml`:
Install the [gcloud command-line tool][gcloudcli] to your machine and use it to create the indexes used in the datastore system tests with indexes found in `system-test/data/index/yaml`:

From the project's root directory:

Expand All @@ -37,13 +37,13 @@ $ gcloud config set project $GCLOUD_TESTS_PROJECT_ID
$ gcloud auth login

# Create the indexes
$ gcloud preview datastore create-indexes regression/data/
$ gcloud preview datastore create-indexes system-test/data/
```

You may now run the regression tests:
You may now run the system tests:

``` sh
$ npm run regression-test
$ npm run system-test
```

### Test Coverage
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
},
"scripts": {
"docs": "./scripts/docs.sh",
"lint": "jshint lib/ regression/ test/",
"lint": "jshint lib/ system-test/ test/",
"test": "mocha test/*",
"regression-test": "mocha regression/* --timeout 30000",
"cover": "istanbul cover -x 'regression/*' _mocha -- --timeout 30000 test/* regression/*",
"coveralls": "istanbul cover -x 'regression/*' _mocha --report lcovonly -- --timeout 30000 test/* regression/* -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
"system-test": "mocha system-test/* --timeout 30000",
"cover": "istanbul cover -x 'system-test/*' _mocha -- --timeout 30000 test/* system-test/*",
"coveralls": "istanbul cover -x 'system-test/*' _mocha --report lcovonly -- --timeout 30000 test/* system-test/* -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"license": "Apache 2"
}
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ set -ev
npm run lint
npm run test

# if merging to master and not a pull request, execute regression tests, create coverage report and update docs
# if merging to master and not a pull request, execute system tests, create coverage report and update docs
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
openssl aes-256-cbc -K $encrypted_b8aa0887832a_key -iv $encrypted_b8aa0887832a_iv -in key.json.enc -out key.json -d
# create new coverage report (executes regression tests)
# create new coverage report (executes system tests)
npm run coveralls

# generate new set of json files in docs/json/master
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion regression/env.js → system-test/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

if (!process.env.GCLOUD_TESTS_PROJECT_ID && !process.env.GCLOUD_TESTS_KEY) {
var error = [
'To run the regression tests, you need to set some environment variables.',
'To run the system tests, you need to set some environment variables.',
'Please check the Contributing guide for instructions.'
].join('\n');
throw error;
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions regression/storage.js → system-test/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ var BUCKET_NAME = generateBucketName();

var files = {
logo: {
path: 'regression/data/CloudPlatform_128px_Retina.png'
path: 'system-test/data/CloudPlatform_128px_Retina.png'
},
big: {
path: 'regression/data/three-mb-file.tif'
path: 'system-test/data/three-mb-file.tif'
}
};

Expand Down

0 comments on commit 686fe62

Please sign in to comment.