diff --git a/.travis.yml b/.travis.yml index 4593292a67..3561dafc31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ language: node_js node_js: - "stable" - "0.12" -- "0.10" cache: directories: diff --git a/README.md b/README.md index 2019545dee..0e11aa9f5d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This repository holds Node.js samples used throughout [cloud.google.com](). [![Build Status](https://travis-ci.org/GoogleCloudPlatform/nodejs-docs-samples.svg)](https://travis-ci.org/GoogleCloudPlatform/nodejs-docs-samples) -[![Coverage Status](https://coveralls.io/repos/github/GoogleCloudPlatform/nodejs-docs-samples/badge.svg?branch=master)](https://coveralls.io/github/GoogleCloudPlatform/nodejs-docs-samples?branch=master) +[![Coverage Status](https://codecov.io/github/GoogleCloudPlatform/nodejs-getting-started/coverage.svg?branch=master)](https://codecov.io/github/GoogleCloudPlatform/nodejs-getting-started?branch=master) ## Table of Contents diff --git a/appengine/datastore/app.js b/appengine/datastore/app.js index cb1350138f..5e733250eb 100644 --- a/appengine/datastore/app.js +++ b/appengine/datastore/app.js @@ -23,7 +23,7 @@ var crypto = require('crypto'); var app = express(); app.enable('trust proxy'); -var dataset = gcloud.datastore.dataset({ +var dataset = gcloud.datastore({ // This environment variable is set by app.yaml when running on GAE, but will // need to be manually set when running locally. projectId: process.env.GCLOUD_PROJECT diff --git a/appengine/datastore/package.json b/appengine/datastore/package.json index 380679aafa..3f2b98e770 100644 --- a/appengine/datastore/package.json +++ b/appengine/datastore/package.json @@ -15,6 +15,6 @@ }, "dependencies": { "express": "^4.13.4", - "gcloud": "^0.27.0" + "gcloud": "^0.30.3" } } diff --git a/appengine/pubsub/package.json b/appengine/pubsub/package.json index 828974b53c..d6d6273efb 100644 --- a/appengine/pubsub/package.json +++ b/appengine/pubsub/package.json @@ -16,7 +16,7 @@ "dependencies": { "body-parser": "^1.14.2", "express": "^4.13.4", - "gcloud": "^0.27.0", + "gcloud": "^0.30.3", "jade": "^1.11.0" } } diff --git a/appengine/storage/package.json b/appengine/storage/package.json index d9c420a3b1..8594822b95 100644 --- a/appengine/storage/package.json +++ b/appengine/storage/package.json @@ -9,7 +9,7 @@ "dependencies": { "body-parser": "^1.14.2", "express": "^4.13.4", - "gcloud": "^0.27.0", + "gcloud": "^0.30.3", "jade": "^1.11.0", "multer": "^1.1.0" } diff --git a/bigquery/package.json b/bigquery/package.json index f5f490fc35..de7c37f9f2 100644 --- a/bigquery/package.json +++ b/bigquery/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "async": "^1.5.2", - "gcloud": "^0.29.0", + "gcloud": "^0.30.3", "request": "^2.69.0" } } diff --git a/computeengine/package.json b/computeengine/package.json index b080b4b275..ae703c56c8 100644 --- a/computeengine/package.json +++ b/computeengine/package.json @@ -14,7 +14,7 @@ "vms_api": "node vms_api.js" }, "dependencies": { - "gcloud": "^0.30.2", + "gcloud": "^0.30.3", "googleapis": "^4.0.0", "sendgrid": "^2.0.0" } diff --git a/datastore/concepts.js b/datastore/concepts.js index 74508bc5a1..6ca55280cc 100644 --- a/datastore/concepts.js +++ b/datastore/concepts.js @@ -47,7 +47,7 @@ function Entity(projectId) { if (keyFile) { options.keyFilename = keyFile; } - this.datastore = gcloud.datastore.dataset(options); + this.datastore = gcloud.datastore(options); // To create the keys, we have to use this instance of Datastore. datastore.key = this.datastore.key; @@ -247,7 +247,7 @@ Entity.prototype.testInsert = function(callback) { // [END insert] this.datastore.save({ - method: 'insert_auto_id', + method: 'insert', key: taskKey, data: task }, callback); @@ -274,7 +274,7 @@ Entity.prototype.testLookup = function(callback) { // [END lookup] this.datastore.save({ - method: 'insert_auto_id', + method: 'insert', key: taskKey, data: {} }, function(err) { @@ -304,7 +304,7 @@ Entity.prototype.testUpdate = function(callback) { // [END update] this.datastore.save({ - method: 'insert_auto_id', + method: 'insert', key: taskKey, data: {} }, function(err) { @@ -333,7 +333,7 @@ Entity.prototype.testDelete = function(callback) { // [END delete] this.datastore.save({ - method: 'insert_auto_id', + method: 'insert', key: taskKey, data: {} }, function(err) { @@ -444,7 +444,7 @@ function Index(projectId) { if (keyFile) { options.keyFilename = keyFile; } - this.datastore = gcloud.datastore.dataset(options); + this.datastore = gcloud.datastore(options); } Index.prototype.testUnindexedPropertyQuery = function(callback) { @@ -459,11 +459,12 @@ Index.prototype.testUnindexedPropertyQuery = function(callback) { }; Index.prototype.testExplodingProperties = function(callback) { + var original = datastore.key; datastore.key = this.datastore.key; // [START exploding_properties] var task = { - method: 'insert_auto_id', + method: 'insert', key: datastore.key('Task'), data: { tags: [ @@ -481,7 +482,7 @@ Index.prototype.testExplodingProperties = function(callback) { }; // [END exploding_properties] - delete datastore.key; + datastore.key = original; this.datastore.save(task, callback); }; @@ -494,7 +495,7 @@ function Metadata(projectId) { if (keyFile) { options.keyFilename = keyFile; } - this.datastore = gcloud.datastore.dataset(options); + this.datastore = gcloud.datastore(options); } Metadata.prototype.testNamespaceRunQuery = function(callback) { @@ -632,7 +633,7 @@ function Query(projectId) { if (keyFile) { options.keyFilename = keyFile; } - this.datastore = gcloud.datastore.dataset(options); + this.datastore = gcloud.datastore(options); this.basicQuery = this.getBasicQuery(); this.projectionQuery = this.getProjectionQuery(); @@ -771,7 +772,8 @@ Query.prototype.testKindlessQuery = function(callback) { // [START kindless_query] var query = datastore.createQuery() - .filter('__key__', '>', lastSeenKey); + .filter('__key__', '>', lastSeenKey) + .limit(1); // [END kindless_query] this.datastore.runQuery(query, callback); @@ -825,7 +827,8 @@ Query.prototype.testKeysOnlyQuery = function(callback) { // [START keys_only_query] var query = datastore.createQuery() - .select('__key__'); + .select('__key__') + .limit(1); // [END keys_only_query] this.datastore.runQuery(query, callback); @@ -1066,7 +1069,7 @@ function Transaction(projectId) { if (keyFile) { options.keyFilename = keyFile; } - this.datastore = gcloud.datastore.dataset(options); + this.datastore = gcloud.datastore(options); this.fromKey = this.datastore.key(['Bank', 1, 'Account', 1]); this.toKey = this.datastore.key(['Bank', 1, 'Account', 2]); diff --git a/datastore/error.js b/datastore/error.js index 5a215c069b..844cb24ec1 100644 --- a/datastore/error.js +++ b/datastore/error.js @@ -15,7 +15,7 @@ var gcloud = require('gcloud'); -var dataset = gcloud.datastore.dataset({ +var dataset = gcloud.datastore({ projectId: process.env.GCLOUD_PROJECT }); diff --git a/datastore/tasks.js b/datastore/tasks.js index b460c13c25..faf3ea9e4d 100755 --- a/datastore/tasks.js +++ b/datastore/tasks.js @@ -33,7 +33,7 @@ if (keyFile) { options.keyFilename = keyFile; } -var datastore = gcloud.datastore.dataset(options); +var datastore = gcloud.datastore(options); // [END build_service] /* diff --git a/logging/package.json b/logging/package.json index bb51229308..dca3aa1946 100644 --- a/logging/package.json +++ b/logging/package.json @@ -14,6 +14,6 @@ "export": "node export.js" }, "dependencies": { - "gcloud": "^0.27.0" + "gcloud": "^0.30.3" } } diff --git a/package.json b/package.json index d6f11e363a..a9428ff728 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "ava": "ava --match='!*: dependencies should install*'", "ava:deps": "npm run deps_appengine && npm run ava", "cover": "npm run deps_appengine && nyc ava --match='!*: dependencies should install*'", - "report": "nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls", + "report": "nyc report --reporter=lcov | codecov", "report-html": "nyc report --reporter=html", "deps_gce": "cd computeengine; npm i; cd ../", "deps_bigquery": "cd bigquery; npm i; cd ../", @@ -52,11 +52,11 @@ "devDependencies": { "async": "^1.5.2", "ava": "^0.13.0", - "coveralls": "^2.11.9", + "codecov": "^1.0.1", "jshint": "~2.9.1", "nyc": "^6.1.1", "proxyquire": "^1.7.4", - "request": "^2.69.0", - "supertest": "^1.1.0" + "request": "^2.70.0", + "supertest": "^1.2.0" } } diff --git a/pubsub/package.json b/pubsub/package.json index 564b9a5d29..7417aefb3a 100644 --- a/pubsub/package.json +++ b/pubsub/package.json @@ -12,6 +12,6 @@ "subscription": "node subscription.js" }, "dependencies": { - "gcloud": "^0.27.0" + "gcloud": "^0.30.3" } } diff --git a/test/appengine/all.test.js b/test/appengine/all.test.js index 5284ffab9b..74241cd8e0 100644 --- a/test/appengine/all.test.js +++ b/test/appengine/all.test.js @@ -79,14 +79,14 @@ var sampleTests = [ cmd: 'node', args: ['./bin/www'], msg: 'Hello World! Express.js on Google App Engine.', - TRAVIS_NODE_VERSION: '0.10' + TRAVIS_NODE_VERSION: '0.12' }, { dir: 'appengine/express-memcached-session', cmd: 'node', args: ['server.js'], msg: 'Viewed', - TRAVIS_NODE_VERSION: '0.10' + TRAVIS_NODE_VERSION: '0.12' }, { dir: 'appengine/geddy', @@ -212,7 +212,7 @@ var sampleTests = [ } ]; -if (process.env.TRAVIS_NODE_VERSION === '0.10') { +if (process.env.TRAVIS_NODE_VERSION === '0.12') { // For some reason the "npm install" step for the Sails sample doesn't work on // Travis when using Node.js stable. It works locally, however. sampleTests.push({ diff --git a/test/datastore/concepts.test.js b/test/datastore/concepts.test.js index bc3447c518..93326fee79 100644 --- a/test/datastore/concepts.test.js +++ b/test/datastore/concepts.test.js @@ -65,19 +65,19 @@ test.cb.serial('gets a snapshot of task list entities', function (t) { // Metadata -test.cb('performs a namespace query', function (t) { +test.cb.serial('performs a namespace query', function (t) { metadata.testNamespaceRunQuery(t.end); }); -test.cb('performs a kind query', function (t) { +test.cb.serial('performs a kind query', function (t) { metadata.testKindRunQuery(t.end); }); -test.cb('performs a property query', function (t) { +test.cb.serial('performs a property query', function (t) { metadata.testPropertyRunQuery(t.end); }); -test.cb('performs a property by kind query', function (t) { +test.cb.serial('performs a property by kind query', function (t) { metadata.testPropertyByKindRunQuery(t.end); }); @@ -216,66 +216,66 @@ test.skip('performs an ancestor query', function (t) { // Entities -test.cb('saves with an incomplete key', function (t) { +test.cb.serial('saves with an incomplete key', function (t) { entity.testIncompleteKey(t.end); }); -test.cb('saves with a named key', function (t) { +test.cb.serial('saves with a named key', function (t) { entity.testNamedKey(t.end); }); -test.cb('saves a key with a parent', function (t) { +test.cb.serial('saves a key with a parent', function (t) { entity.testKeyWithParent(t.end); }); -test.cb('saves a key with multiple parents', function (t) { +test.cb.serial('saves a key with multiple parents', function (t) { entity.testKeyWithMultiLevelParent(t.end); }); -test.cb('saves an entity with a parent', function (t) { +test.cb.serial('saves an entity with a parent', function (t) { entity.testEntityWithParent(t.end); }); -test.cb('saves an entity with properties', function (t) { +test.cb.serial('saves an entity with properties', function (t) { entity.testProperties(t.end); }); -test.cb('saves an entity with arrays', function (t) { +test.cb.serial('saves an entity with arrays', function (t) { entity.testArrayValue(t.end); }); -test.cb('saves a basic entity', function (t) { +test.cb.serial('saves a basic entity', function (t) { entity.testBasicEntity(t.end); }); -test.cb('saves with an upsert', function (t) { +test.cb.serial('saves with an upsert', function (t) { entity.testUpsert(t.end); }); -test.cb('saves with an insert', function (t) { +test.cb.serial('saves with an insert', function (t) { entity.testInsert(t.end); }); -test.cb('performs a lookup', function (t) { +test.cb.serial('performs a lookup', function (t) { entity.testLookup(t.end); }); -test.cb('saves with an update', function (t) { +test.cb.serial('saves with an update', function (t) { entity.testUpdate(t.end); }); -test.cb('deletes an entity', function (t) { +test.cb.serial('deletes an entity', function (t) { entity.testDelete(t.end); }); -test.cb('performs a batch upsert', function (t) { +test.cb.serial('performs a batch upsert', function (t) { entity.testBatchUpsert(t.end); }); -test.cb('performs a batch lookup', function (t) { +test.cb.serial('performs a batch lookup', function (t) { entity.testBatchLookup(t.end); }); -test.cb('performs a batch delete', function (t) { +test.cb.serial('performs a batch delete', function (t) { entity.testBatchDelete(t.end); });