mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 02:49:58 +00:00
Removed some test workarounds and updated README
This commit is contained in:
@@ -65,8 +65,7 @@ function getApplicationStatus(host, app, clientDialVer) {
|
||||
if(statusCode !== 200) {
|
||||
return reject(new Error("Expected statusCode 200 while querying application status but got " + statusCode));
|
||||
}
|
||||
// TODO: Remove application/xml from accepted types
|
||||
if(contentType.indexOf("text/xml") === -1 && contentType.indexOf("application/xml") === -1) {
|
||||
if(contentType.indexOf("text/xml") === -1) {
|
||||
return reject(new Error("Expected MIME type 'text/xml' while querying application status but got " + contentType));
|
||||
}
|
||||
// Extract fields from body
|
||||
@@ -121,8 +120,6 @@ function launchApplication(host, app, payload) {
|
||||
method: "POST",
|
||||
timeout: 6000,
|
||||
headers: {
|
||||
// TODO: Remove host header
|
||||
"Host" : appResourceUrl.split("http://")[1].split("/")[0],
|
||||
"Content-Type" : "text/plain;charset=\"utf-8\""
|
||||
}
|
||||
};
|
||||
@@ -162,9 +159,7 @@ function stopApplication(host, app) {
|
||||
var request = {
|
||||
url: appResourceUrl,
|
||||
method: "DELETE",
|
||||
timeout: 6000,
|
||||
// TODO: Remove host header
|
||||
headers: {"Host" : appResourceUrl.split("http://")[1].split("/")[0]}
|
||||
timeout: 6000
|
||||
};
|
||||
return new Q.Promise(function (resolve, reject) {
|
||||
return httpRequest(request, function handleResponse(error, response) {
|
||||
@@ -193,9 +188,7 @@ function hideApplication(host, app) {
|
||||
var request = {
|
||||
url: appResourceUrl,
|
||||
method: "POST",
|
||||
timeout: 6000,
|
||||
// TODO: Remove host header
|
||||
headers: {"Host" : appResourceUrl.split("http://")[1].split("/")[0]}
|
||||
timeout: 6000
|
||||
};
|
||||
return new Q.Promise(function (resolve, reject) {
|
||||
return httpRequest(request, function handleResponse(error, response) {
|
||||
@@ -218,9 +211,7 @@ function stopApplicationInstance(instanceUrl) {
|
||||
var request = {
|
||||
url: instanceUrl,
|
||||
method: "DELETE",
|
||||
timeout: 6000,
|
||||
// TODO: Remove host header
|
||||
headers: {"Host" : instanceUrl.split("http://")[1].split("/")[0]}
|
||||
timeout: 6000
|
||||
};
|
||||
return new Q.Promise(function (resolve, reject) {
|
||||
return httpRequest(request, function handleResponse(error, response) {
|
||||
@@ -239,9 +230,7 @@ function hideApplicationInstance(instanceUrl) {
|
||||
var request = {
|
||||
url: instanceUrl,
|
||||
method: "POST",
|
||||
timeout: 6000,
|
||||
// TODO: Remove host header
|
||||
headers: {"Host" : instanceUrl.split("http://")[1].split("/")[0]}
|
||||
timeout: 6000
|
||||
};
|
||||
return new Q.Promise(function (resolve, reject) {
|
||||
return httpRequest(request, function handleResponse(error, response) {
|
||||
|
||||
@@ -3,30 +3,18 @@
|
||||
const colors = require("colors/safe");
|
||||
const sprintf = require("sprintf-js").sprintf;
|
||||
|
||||
function getParam(key) {
|
||||
var value;
|
||||
var args = process.argv.slice(2);
|
||||
args.forEach(function (param) {
|
||||
if(param.indexOf(key + "=") === 0) {
|
||||
value = param.split("=")[1];
|
||||
}
|
||||
});
|
||||
return value;
|
||||
}
|
||||
|
||||
function printTestInfo(test, msg) {
|
||||
return console.log(sprintf("%-20s : %-s\n%-20s : %-s", "Test", test, "Description", msg));
|
||||
}
|
||||
|
||||
function printSuccess() {
|
||||
function printTestSuccess() {
|
||||
return console.log(colors.green("TEST PASSED\n"));
|
||||
}
|
||||
|
||||
function printFailure(err) {
|
||||
function printTestFailure(err) {
|
||||
return console.log(colors.red(sprintf("%-20s : %-s\n", "TEST FAILED", err)));
|
||||
}
|
||||
|
||||
module.exports.getParam = getParam;
|
||||
module.exports.printTestInfo = printTestInfo;
|
||||
module.exports.printSuccess = printSuccess;
|
||||
module.exports.printFailure = printFailure;
|
||||
module.exports.printTestInfo = printTestInfo;
|
||||
module.exports.printTestSuccess = printTestSuccess;
|
||||
module.exports.printTestFailure = printTestFailure;
|
||||
|
||||
@@ -39,10 +39,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -88,10 +88,10 @@ function test() {
|
||||
})
|
||||
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ function test() {
|
||||
})
|
||||
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ function test() {
|
||||
})
|
||||
.delay(timeToWaitForStateChange)
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ function test() {
|
||||
})
|
||||
.delay(timeToWaitForStateChange)
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -79,10 +79,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -80,10 +80,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -88,10 +88,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -80,10 +80,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -107,10 +107,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ function test() {
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
utils.printSuccess()
|
||||
utils.printTestSuccess()
|
||||
})
|
||||
.fail(function handleError(err) {
|
||||
utils.printFailure(err);
|
||||
utils.printTestFailure(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user