mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-09 03:19:59 +00:00
use yargs to get commandline params for nodejs tests
This commit is contained in:
@@ -4,10 +4,31 @@ var dial = require("../libs/dialClient.js"),
|
||||
utils = require("../libs/utils.js"),
|
||||
Q = require("q");
|
||||
|
||||
const argv = require("yargs")
|
||||
.usage("\nUsage: node " + __filename.slice(__dirname.length + 1) + "[options]")
|
||||
.option("host", {
|
||||
describe: "IP address of host on which DIAL server under test is running",
|
||||
type: "string",
|
||||
demand: true
|
||||
})
|
||||
.option("application", {
|
||||
alias: "app",
|
||||
describe: "Application to test",
|
||||
type: "string",
|
||||
demand: true
|
||||
})
|
||||
.option("timeToWaitForStateChange", {
|
||||
alias: "ttw",
|
||||
describe: "Time(ms) to wait between state changes before querying application status",
|
||||
type: "string",
|
||||
default: 5000
|
||||
})
|
||||
.help("help").alias("help", "h").argv;
|
||||
|
||||
function test() {
|
||||
var host = utils.getParam("host");
|
||||
var app = utils.getParam("app");
|
||||
var timeToWaitForStateChange = utils.getParam("timeToWaitForStateChange") || 5000;
|
||||
var host = argv.host;
|
||||
var app = argv.application;
|
||||
var timeToWaitForStateChange = argv.timeToWaitForStateChange || 5000;
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
|
||||
Reference in New Issue
Block a user