mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 02:49:58 +00:00
use yargs to get commandline params for nodejs tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var colors = require("colors/safe");
|
||||
var sprintf = require("sprintf-js").sprintf;
|
||||
const colors = require("colors/safe");
|
||||
const sprintf = require("sprintf-js").sprintf;
|
||||
|
||||
function getParam(key) {
|
||||
var value;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"node-ssdp": "^3.2.0",
|
||||
"q": "~1.4.1",
|
||||
"request": "^2.78.0",
|
||||
"sprintf-js": "~1.0.3"
|
||||
"sprintf-js": "~1.0.3",
|
||||
"yargs": "^6.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,23 @@ 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
|
||||
})
|
||||
.help("help").alias("help", "h").argv;
|
||||
|
||||
function test() {
|
||||
var testServer = utils.getParam("host");
|
||||
var testServer = argv.host;
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -4,9 +4,30 @@ 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 timeToWaitForStateChange = utils.getParam("timeToWaitForStateChange") || 5000;
|
||||
var host = argv.host;
|
||||
var timeToWaitForStateChange = argv.timeToWaitForStateChange || 5000;
|
||||
|
||||
return new Q()
|
||||
.then(function () {
|
||||
|
||||
@@ -4,9 +4,24 @@ 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
|
||||
})
|
||||
.help("help").alias("help", "h").argv;
|
||||
|
||||
function test() {
|
||||
var host = utils.getParam("host");
|
||||
var app = utils.getParam("app");
|
||||
var host = argv.host;
|
||||
var app = argv.application;
|
||||
|
||||
var payload = "key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&"
|
||||
+ "key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&key=value&"
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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;
|
||||
var instanceUrl;
|
||||
|
||||
return new Q()
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -2,6 +2,27 @@
|
||||
|
||||
var 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;
|
||||
|
||||
var discoverServerUnderTest = require("../tests/discoverServerUnderTest.js"),
|
||||
launchApplicationNotRecognized = require("../tests/launchApplicationNotRecognized.js"),
|
||||
launchApplicationInRunningStateWithNoPayload = require("../tests/launchApplicationInRunningStateWithNoPayload.js"),
|
||||
|
||||
Reference in New Issue
Block a user