Skip to content

Commit 61a5eee

Browse files
committed
Upgraded dependencies, no longer testing on Node v0.10, switched to Codecov
1 parent 4d15ea0 commit 61a5eee

File tree

16 files changed

+54
-52
lines changed

16 files changed

+54
-52
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ language: node_js
1616
node_js:
1717
- "stable"
1818
- "0.12"
19-
- "0.10"
2019

2120
cache:
2221
directories:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This repository holds Node.js samples used throughout [cloud.google.com]().
44

55
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/nodejs-docs-samples.svg)](https://travis-ci.org/GoogleCloudPlatform/nodejs-docs-samples)
6-
[![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)
6+
[![Coverage Status](https://codecov.io/github/GoogleCloudPlatform/nodejs-getting-started/coverage.svg?branch=master)](https://codecov.io/github/GoogleCloudPlatform/nodejs-getting-started?branch=master)
77

88
## Table of Contents
99

appengine/datastore/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var crypto = require('crypto');
2323
var app = express();
2424
app.enable('trust proxy');
2525

26-
var dataset = gcloud.datastore.dataset({
26+
var dataset = gcloud.datastore({
2727
// This environment variable is set by app.yaml when running on GAE, but will
2828
// need to be manually set when running locally.
2929
projectId: process.env.GCLOUD_PROJECT

appengine/datastore/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
},
1616
"dependencies": {
1717
"express": "^4.13.4",
18-
"gcloud": "^0.27.0"
18+
"gcloud": "^0.30.3"
1919
}
2020
}

appengine/pubsub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"body-parser": "^1.14.2",
1818
"express": "^4.13.4",
19-
"gcloud": "^0.27.0",
19+
"gcloud": "^0.30.3",
2020
"jade": "^1.11.0"
2121
}
2222
}

appengine/storage/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"body-parser": "^1.14.2",
1111
"express": "^4.13.4",
12-
"gcloud": "^0.27.0",
12+
"gcloud": "^0.30.3",
1313
"jade": "^1.11.0",
1414
"multer": "^1.1.0"
1515
}

bigquery/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"dependencies": {
1515
"async": "^1.5.2",
16-
"gcloud": "^0.29.0",
16+
"gcloud": "^0.30.3",
1717
"request": "^2.69.0"
1818
}
1919
}

computeengine/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"vms_api": "node vms_api.js"
1515
},
1616
"dependencies": {
17-
"gcloud": "^0.30.2",
17+
"gcloud": "^0.30.3",
1818
"googleapis": "^4.0.0",
1919
"sendgrid": "^2.0.0"
2020
}

datastore/concepts.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Entity(projectId) {
4747
if (keyFile) {
4848
options.keyFilename = keyFile;
4949
}
50-
this.datastore = gcloud.datastore.dataset(options);
50+
this.datastore = gcloud.datastore(options);
5151

5252
// To create the keys, we have to use this instance of Datastore.
5353
datastore.key = this.datastore.key;
@@ -247,7 +247,7 @@ Entity.prototype.testInsert = function(callback) {
247247
// [END insert]
248248

249249
this.datastore.save({
250-
method: 'insert_auto_id',
250+
method: 'insert',
251251
key: taskKey,
252252
data: task
253253
}, callback);
@@ -274,7 +274,7 @@ Entity.prototype.testLookup = function(callback) {
274274
// [END lookup]
275275

276276
this.datastore.save({
277-
method: 'insert_auto_id',
277+
method: 'insert',
278278
key: taskKey,
279279
data: {}
280280
}, function(err) {
@@ -304,7 +304,7 @@ Entity.prototype.testUpdate = function(callback) {
304304
// [END update]
305305

306306
this.datastore.save({
307-
method: 'insert_auto_id',
307+
method: 'insert',
308308
key: taskKey,
309309
data: {}
310310
}, function(err) {
@@ -333,7 +333,7 @@ Entity.prototype.testDelete = function(callback) {
333333
// [END delete]
334334

335335
this.datastore.save({
336-
method: 'insert_auto_id',
336+
method: 'insert',
337337
key: taskKey,
338338
data: {}
339339
}, function(err) {
@@ -444,7 +444,7 @@ function Index(projectId) {
444444
if (keyFile) {
445445
options.keyFilename = keyFile;
446446
}
447-
this.datastore = gcloud.datastore.dataset(options);
447+
this.datastore = gcloud.datastore(options);
448448
}
449449

450450
Index.prototype.testUnindexedPropertyQuery = function(callback) {
@@ -459,11 +459,12 @@ Index.prototype.testUnindexedPropertyQuery = function(callback) {
459459
};
460460

461461
Index.prototype.testExplodingProperties = function(callback) {
462+
var original = datastore.key;
462463
datastore.key = this.datastore.key;
463464

464465
// [START exploding_properties]
465466
var task = {
466-
method: 'insert_auto_id',
467+
method: 'insert',
467468
key: datastore.key('Task'),
468469
data: {
469470
tags: [
@@ -481,7 +482,7 @@ Index.prototype.testExplodingProperties = function(callback) {
481482
};
482483
// [END exploding_properties]
483484

484-
delete datastore.key;
485+
datastore.key = original;
485486

486487
this.datastore.save(task, callback);
487488
};
@@ -494,7 +495,7 @@ function Metadata(projectId) {
494495
if (keyFile) {
495496
options.keyFilename = keyFile;
496497
}
497-
this.datastore = gcloud.datastore.dataset(options);
498+
this.datastore = gcloud.datastore(options);
498499
}
499500

500501
Metadata.prototype.testNamespaceRunQuery = function(callback) {
@@ -632,7 +633,7 @@ function Query(projectId) {
632633
if (keyFile) {
633634
options.keyFilename = keyFile;
634635
}
635-
this.datastore = gcloud.datastore.dataset(options);
636+
this.datastore = gcloud.datastore(options);
636637

637638
this.basicQuery = this.getBasicQuery();
638639
this.projectionQuery = this.getProjectionQuery();
@@ -771,7 +772,8 @@ Query.prototype.testKindlessQuery = function(callback) {
771772

772773
// [START kindless_query]
773774
var query = datastore.createQuery()
774-
.filter('__key__', '>', lastSeenKey);
775+
.filter('__key__', '>', lastSeenKey)
776+
.limit(1);
775777
// [END kindless_query]
776778

777779
this.datastore.runQuery(query, callback);
@@ -825,7 +827,8 @@ Query.prototype.testKeysOnlyQuery = function(callback) {
825827

826828
// [START keys_only_query]
827829
var query = datastore.createQuery()
828-
.select('__key__');
830+
.select('__key__')
831+
.limit(1);
829832
// [END keys_only_query]
830833

831834
this.datastore.runQuery(query, callback);
@@ -1066,7 +1069,7 @@ function Transaction(projectId) {
10661069
if (keyFile) {
10671070
options.keyFilename = keyFile;
10681071
}
1069-
this.datastore = gcloud.datastore.dataset(options);
1072+
this.datastore = gcloud.datastore(options);
10701073

10711074
this.fromKey = this.datastore.key(['Bank', 1, 'Account', 1]);
10721075
this.toKey = this.datastore.key(['Bank', 1, 'Account', 2]);

datastore/error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
var gcloud = require('gcloud');
1717

18-
var dataset = gcloud.datastore.dataset({
18+
var dataset = gcloud.datastore({
1919
projectId: process.env.GCLOUD_PROJECT
2020
});
2121

datastore/tasks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (keyFile) {
3333
options.keyFilename = keyFile;
3434
}
3535

36-
var datastore = gcloud.datastore.dataset(options);
36+
var datastore = gcloud.datastore(options);
3737
// [END build_service]
3838

3939
/*

logging/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"export": "node export.js"
1515
},
1616
"dependencies": {
17-
"gcloud": "^0.27.0"
17+
"gcloud": "^0.30.3"
1818
}
1919
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"ava": "ava --match='!*: dependencies should install*'",
3030
"ava:deps": "npm run deps_appengine && npm run ava",
3131
"cover": "npm run deps_appengine && nyc ava --match='!*: dependencies should install*'",
32-
"report": "nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls",
32+
"report": "nyc report --reporter=lcov | codecov",
3333
"report-html": "nyc report --reporter=html",
3434
"deps_gce": "cd computeengine; npm i; cd ../",
3535
"deps_bigquery": "cd bigquery; npm i; cd ../",
@@ -52,11 +52,11 @@
5252
"devDependencies": {
5353
"async": "^1.5.2",
5454
"ava": "^0.13.0",
55-
"coveralls": "^2.11.9",
55+
"codecov": "^1.0.1",
5656
"jshint": "~2.9.1",
5757
"nyc": "^6.1.1",
5858
"proxyquire": "^1.7.4",
59-
"request": "^2.69.0",
60-
"supertest": "^1.1.0"
59+
"request": "^2.70.0",
60+
"supertest": "^1.2.0"
6161
}
6262
}

pubsub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"subscription": "node subscription.js"
1313
},
1414
"dependencies": {
15-
"gcloud": "^0.27.0"
15+
"gcloud": "^0.30.3"
1616
}
1717
}

test/appengine/all.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ var sampleTests = [
7979
cmd: 'node',
8080
args: ['./bin/www'],
8181
msg: 'Hello World! Express.js on Google App Engine.',
82-
TRAVIS_NODE_VERSION: '0.10'
82+
TRAVIS_NODE_VERSION: '0.12'
8383
},
8484
{
8585
dir: 'appengine/express-memcached-session',
8686
cmd: 'node',
8787
args: ['server.js'],
8888
msg: 'Viewed',
89-
TRAVIS_NODE_VERSION: '0.10'
89+
TRAVIS_NODE_VERSION: '0.12'
9090
},
9191
{
9292
dir: 'appengine/geddy',
@@ -212,7 +212,7 @@ var sampleTests = [
212212
}
213213
];
214214

215-
if (process.env.TRAVIS_NODE_VERSION === '0.10') {
215+
if (process.env.TRAVIS_NODE_VERSION === '0.12') {
216216
// For some reason the "npm install" step for the Sails sample doesn't work on
217217
// Travis when using Node.js stable. It works locally, however.
218218
sampleTests.push({

test/datastore/concepts.test.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ test.cb.serial('gets a snapshot of task list entities', function (t) {
6565

6666
// Metadata
6767

68-
test.cb('performs a namespace query', function (t) {
68+
test.cb.serial('performs a namespace query', function (t) {
6969
metadata.testNamespaceRunQuery(t.end);
7070
});
7171

72-
test.cb('performs a kind query', function (t) {
72+
test.cb.serial('performs a kind query', function (t) {
7373
metadata.testKindRunQuery(t.end);
7474
});
7575

76-
test.cb('performs a property query', function (t) {
76+
test.cb.serial('performs a property query', function (t) {
7777
metadata.testPropertyRunQuery(t.end);
7878
});
7979

80-
test.cb('performs a property by kind query', function (t) {
80+
test.cb.serial('performs a property by kind query', function (t) {
8181
metadata.testPropertyByKindRunQuery(t.end);
8282
});
8383

@@ -216,66 +216,66 @@ test.skip('performs an ancestor query', function (t) {
216216

217217
// Entities
218218

219-
test.cb('saves with an incomplete key', function (t) {
219+
test.cb.serial('saves with an incomplete key', function (t) {
220220
entity.testIncompleteKey(t.end);
221221
});
222222

223-
test.cb('saves with a named key', function (t) {
223+
test.cb.serial('saves with a named key', function (t) {
224224
entity.testNamedKey(t.end);
225225
});
226226

227-
test.cb('saves a key with a parent', function (t) {
227+
test.cb.serial('saves a key with a parent', function (t) {
228228
entity.testKeyWithParent(t.end);
229229
});
230230

231-
test.cb('saves a key with multiple parents', function (t) {
231+
test.cb.serial('saves a key with multiple parents', function (t) {
232232
entity.testKeyWithMultiLevelParent(t.end);
233233
});
234234

235-
test.cb('saves an entity with a parent', function (t) {
235+
test.cb.serial('saves an entity with a parent', function (t) {
236236
entity.testEntityWithParent(t.end);
237237
});
238238

239-
test.cb('saves an entity with properties', function (t) {
239+
test.cb.serial('saves an entity with properties', function (t) {
240240
entity.testProperties(t.end);
241241
});
242242

243-
test.cb('saves an entity with arrays', function (t) {
243+
test.cb.serial('saves an entity with arrays', function (t) {
244244
entity.testArrayValue(t.end);
245245
});
246246

247-
test.cb('saves a basic entity', function (t) {
247+
test.cb.serial('saves a basic entity', function (t) {
248248
entity.testBasicEntity(t.end);
249249
});
250250

251-
test.cb('saves with an upsert', function (t) {
251+
test.cb.serial('saves with an upsert', function (t) {
252252
entity.testUpsert(t.end);
253253
});
254254

255-
test.cb('saves with an insert', function (t) {
255+
test.cb.serial('saves with an insert', function (t) {
256256
entity.testInsert(t.end);
257257
});
258258

259-
test.cb('performs a lookup', function (t) {
259+
test.cb.serial('performs a lookup', function (t) {
260260
entity.testLookup(t.end);
261261
});
262262

263-
test.cb('saves with an update', function (t) {
263+
test.cb.serial('saves with an update', function (t) {
264264
entity.testUpdate(t.end);
265265
});
266266

267-
test.cb('deletes an entity', function (t) {
267+
test.cb.serial('deletes an entity', function (t) {
268268
entity.testDelete(t.end);
269269
});
270270

271-
test.cb('performs a batch upsert', function (t) {
271+
test.cb.serial('performs a batch upsert', function (t) {
272272
entity.testBatchUpsert(t.end);
273273
});
274274

275-
test.cb('performs a batch lookup', function (t) {
275+
test.cb.serial('performs a batch lookup', function (t) {
276276
entity.testBatchLookup(t.end);
277277
});
278278

279-
test.cb('performs a batch delete', function (t) {
279+
test.cb.serial('performs a batch delete', function (t) {
280280
entity.testBatchDelete(t.end);
281281
});

0 commit comments

Comments
 (0)