Skip to content

Commit

Permalink
#246 Update dependencies for a Node v6 age
Browse files Browse the repository at this point in the history
MANTA-2929: InvalidUpdateError on mchmod from clients after Node 0.12

- 'make testall' to somewhat easily test against all supported node
  versions
- Convert to using restify-clients instead of restify. This drops
  having the "bin/m*" tools set "serializers" in they logger because
  that gets added via "log.child" in "createBinClient".
- Add "license" field to package.json to avoid 'npm install' warning.
- Added "node-manta-test-" prefix to the dir created in Manta when
  running the test suite. This helps for manual cleaning up after
  failed test runs.
- Fix two places where 'make test' would hang while a Manta client had
  an open connection (the "agent:false" additions in client.test.js).
- MANTA-2929: ensure no implicit content-length by forcing chunked
  transfer-encoding for PutMetadata requests.
  • Loading branch information
trentm committed Jun 23, 2016
1 parent 3cea4e8 commit 662bdd7
Show file tree
Hide file tree
Showing 24 changed files with 151 additions and 86 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ cscope.po.out
cscope.out
smf/manifests/bapi.xml
*.tgz
/test/node.paths
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Makefile
deps
docs
test
tools
tools
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,56 @@ test: deps
unset MANTA_DEFAULT_CONTENT_TYPE; \
$(NODEUNIT) test

#
# Test with a bunch of node versions.
#
# This requires a "test/node.paths" file that looks something like
# "test/node.paths.example".
#
.PHONY: testall
testall: test6 test5 test4 test012 test010

.PHONY: test6
test6:
@([[ -f test/node.paths ]] || (echo "no test/node.paths" && exit 1) \
&& echo "# Test with node `$(shell awk '/^6/ { print $$2 }' test/node.paths)/node --version`" \
&& PATH="$(shell awk '/^6/ { print $$2 }' test/node.paths):$(PATH)" \
NPM_CONFIG_LOGLEVEL=silent NPM_CONFIG_PROGRESS=false \
make clean test)

.PHONY: test5
test5:
@([[ -f test/node.paths ]] || (echo "no test/node.paths" && exit 1) \
&& echo "# Test with node `$(shell awk '/^5/ { print $$2 }' test/node.paths)/node --version`" \
&& PATH="$(shell awk '/^5/ { print $$2 }' test/node.paths):$(PATH)" \
NPM_CONFIG_LOGLEVEL=silent NPM_CONFIG_PROGRESS=false \
make clean test)

.PHONY: test4
test4:
@([[ -f test/node.paths ]] || (echo "no test/node.paths" && exit 1) \
&& echo "# Test with node `$(shell awk '/^4/ { print $$2 }' test/node.paths)/node --version`" \
&& PATH="$(shell awk '/^4/ { print $$2 }' test/node.paths):$(PATH)" \
NPM_CONFIG_LOGLEVEL=silent NPM_CONFIG_PROGRESS=false \
make clean test)

.PHONY: test012
test012:
@([[ -f test/node.paths ]] || (echo "no test/node.paths" && exit 1) \
&& echo "# Test with node `$(shell awk '/^0\.12/ { print $$2 }' test/node.paths)/node --version`" \
&& PATH="$(shell awk '/^0\.12/ { print $$2 }' test/node.paths):$(PATH)" \
NPM_CONFIG_LOGLEVEL=silent NPM_CONFIG_PROGRESS=false \
make clean test)

.PHONY: test010
test010:
@([[ -f test/node.paths ]] || (echo "no test/node.paths" && exit 1) \
&& echo "# Test with node `$(shell awk '/^0\.10/ { print $$2 }' test/node.paths)/node --version`" \
&& PATH="$(shell awk '/^0\.10/ { print $$2 }' test/node.paths):$(PATH)" \
NPM_CONFIG_LOGLEVEL=silent NPM_CONFIG_PROGRESS=false \
make clean test)


$(MAN_OUTDIR):
mkdir -p $@

Expand Down
8 changes: 4 additions & 4 deletions bin/mchattr
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2014, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var path = require('path');
var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -18,8 +19,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mchmod
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2014, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var path = require('path');
var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -19,8 +20,7 @@ var name = path.basename(process.argv[1]);
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mfind
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var http = require('http');
var https = require('https');
Expand All @@ -10,7 +12,6 @@ var url = require('url');
var assert = require('assert-plus');
var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');
var vasync = require('vasync');

var manta = require('../lib');
Expand All @@ -23,8 +24,7 @@ var CLIENT;
var LOG = bunyan.createLogger({
name: require('path').basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mget
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var fs = require('fs');
var http = require('http');
Expand All @@ -9,7 +11,6 @@ var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -20,8 +21,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/minfo
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var http = require('http');
var path = require('path-platform');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -18,8 +19,7 @@ var name = path.basename(process.argv[1]);
var LOG = bunyan.createLogger({
name: name,
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mjob
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var EventEmitter = require('events').EventEmitter;
var fs = require('fs');
Expand All @@ -15,7 +17,6 @@ var cmdln = require('cmdln');
var LineStream = require('lstream');
var moment = require('moment');
var once = require('once');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -30,8 +31,7 @@ var JOB_DATA_FMT = '/%s/jobs/%s/%s.txt';
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});


Expand Down
8 changes: 4 additions & 4 deletions bin/mln
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var fs = require('fs');
var path = require('path-platform');
var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -19,8 +20,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
5 changes: 3 additions & 2 deletions bin/mlogin
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013 Joyent, Inc. All rights reserved.
// vim: set syntax=javascript ts=4 sts=4 sw=4 et:

/*
* Copyright 2016 Joyent, Inc.
*/

var net = require('net');
var url = require('url');
Expand Down
6 changes: 2 additions & 4 deletions bin/mls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/*
* Copyright 2015 Joyent, Inc.
* Copyright 2016 Joyent, Inc.
*/

var path = require('path-platform');
Expand All @@ -10,7 +10,6 @@ var bunyan = require('bunyan');
var dashdash = require('dashdash');
var moment = require('moment');
var once = require('once');
var restify = require('restify');
var sprintf = require('extsprintf').sprintf;

var manta = require('../lib');
Expand All @@ -22,8 +21,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mmd5
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var fs = require('fs');
var path = require('path');
var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');
var vasync = require('vasync');

var manta = require('../lib');
Expand All @@ -22,8 +23,7 @@ var HAD_ERR = false;
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});
var OPTIONS_PARSER = dashdash.createParser({
options: manta.DEFAULT_CLI_OPTIONS
Expand Down
8 changes: 4 additions & 4 deletions bin/mmkdir
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var path = require('path');
var url = require('url');

var bunyan = require('bunyan');
var dashdash = require('dashdash');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -18,8 +19,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
8 changes: 4 additions & 4 deletions bin/mput
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
// -*- mode: js -*-
// Copyright (c) 2013, Joyent, Inc. All rights reserved.
/*
* Copyright 2016 Joyent, Inc.
*/

var crypto = require('crypto');
var fs = require('fs');
Expand All @@ -11,7 +13,6 @@ var backoff = require('backoff');
var bunyan = require('bunyan');
var dashdash = require('dashdash');
var once = require('once');
var restify = require('restify');

var manta = require('../lib');

Expand All @@ -22,8 +23,7 @@ var manta = require('../lib');
var LOG = bunyan.createLogger({
name: path.basename(process.argv[1]),
level: (process.env.LOG_LEVEL || 'info'),
stream: process.stderr,
serializers: restify.bunyan.serializers
stream: process.stderr
});

var OPTIONS_PARSER = dashdash.createParser({
Expand Down
Loading

0 comments on commit 662bdd7

Please sign in to comment.