Comparing version 4.0.0 to 4.0.1
@@ -41,2 +41,3 @@ import './polyfills'; | ||
pool?: string; | ||
tags?: string[] | null; | ||
parallel?: number | string; | ||
@@ -43,0 +44,0 @@ branch?: string; |
@@ -84,3 +84,3 @@ "use strict"; | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var testPlanId, overrideParameters, labels, labelsExpression, additionalDescription, pool, parallel, branch, maxFlakyFlowRetries, _b, testPlanRunId, err; | ||
var testPlanId, overrideParameters, labels, labelsExpression, additionalDescription, pool, tags, parallel, branch, maxFlakyFlowRetries, _b, testPlanRunId, err; | ||
return tslib_1.__generator(this, function (_c) { | ||
@@ -95,2 +95,3 @@ switch (_c.label) { | ||
pool = testPlan.options && testPlan.options.pool; | ||
tags = testPlan.options && testPlan.options.tags && utils_1.filterTags(testPlan.options.tags); | ||
parallel = testPlan.options && testPlan.options.parallel; | ||
@@ -100,3 +101,3 @@ branch = testPlan.options && testPlan.options.branch; | ||
return [4 /*yield*/, superagent.post(testPlansAPI + "/" + testPlanId + "/run") | ||
.send({ overrideParameters: overrideParameters, additionalDescription: additionalDescription, labels: labels, pool: pool, parallel: parallel, branch: branch, maxFlakyFlowRetries: maxFlakyFlowRetries, labelsExpression: labelsExpression }) | ||
.send({ overrideParameters: overrideParameters, additionalDescription: additionalDescription, labels: labels, pool: pool, parallel: parallel, tags: tags, branch: branch, maxFlakyFlowRetries: maxFlakyFlowRetries, labelsExpression: labelsExpression }) | ||
.auth(token, '')]; | ||
@@ -103,0 +104,0 @@ case 1: |
@@ -21,2 +21,3 @@ "use strict"; | ||
.option("--pool <pool>", "Execute tests from a dedicated agent's pool (when using private agent)") | ||
.option("--tags <tags>", "Tag a test plan run with a comma separated list of tags (e.g. 'tag1,tag2')") | ||
.option("-w, --wait", "Wait for the test to finish.") | ||
@@ -42,7 +43,7 @@ .option("-n, --no-bail", "Return exit code 0 even if test fails.") | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
var wait, bail, quiet, token, verbose, colors, report, junitReport, junitReportPath, mochawesomeReport, mochawesomeReportPath, parallel, loadTest, testPlan, additionalDescription, labels, labelsExpression, pool, branch, retryFailedFlows, parametersFile, _a, input, rawParams, logger, parameters, loadmill, testFailed, testStopped, res, planLabels, running, e_1, extInfo, configFile, res_1, id; | ||
var wait, bail, quiet, token, verbose, colors, report, junitReport, junitReportPath, mochawesomeReport, mochawesomeReportPath, parallel, loadTest, testPlan, additionalDescription, labels, labelsExpression, pool, tags, branch, retryFailedFlows, parametersFile, _a, input, rawParams, logger, parameters, loadmill, testFailed, testStopped, res, planLabels, planTags, running, e_1, extInfo, configFile, res_1, id; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
wait = program.wait, bail = program.bail, quiet = program.quiet, token = program.token, verbose = program.verbose, colors = program.colors, report = program.report, junitReport = program.junitReport, junitReportPath = program.junitReportPath, mochawesomeReport = program.mochawesomeReport, mochawesomeReportPath = program.mochawesomeReportPath, parallel = program.parallel, loadTest = program.loadTest, testPlan = program.testPlan, additionalDescription = program.additionalDescription, labels = program.labels, labelsExpression = program.labelsExpression, pool = program.pool, branch = program.branch, retryFailedFlows = program.retryFailedFlows, parametersFile = program.parametersFile, _a = program.args, input = _a[0], rawParams = _a.slice(1); | ||
wait = program.wait, bail = program.bail, quiet = program.quiet, token = program.token, verbose = program.verbose, colors = program.colors, report = program.report, junitReport = program.junitReport, junitReportPath = program.junitReportPath, mochawesomeReport = program.mochawesomeReport, mochawesomeReportPath = program.mochawesomeReportPath, parallel = program.parallel, loadTest = program.loadTest, testPlan = program.testPlan, additionalDescription = program.additionalDescription, labels = program.labels, labelsExpression = program.labelsExpression, pool = program.pool, tags = program.tags, branch = program.branch, retryFailedFlows = program.retryFailedFlows, parametersFile = program.parametersFile, _a = program.args, input = _a[0], rawParams = _a.slice(1); | ||
logger = utils_1.getLogger({ verbose: verbose, colors: colors }); | ||
@@ -76,2 +77,3 @@ if (!token) { | ||
pool: pool, | ||
tags: tags, | ||
branch: branch, | ||
@@ -98,6 +100,7 @@ retryFailedFlows: retryFailedFlows, | ||
if (!(testPlan || !loadTest)) return [3 /*break*/, 13]; | ||
planLabels = utils_1.convertStrToArr(labels); | ||
if (!utils_1.isUUID(input)) { //if test plan flag is on then the input should be uuid | ||
validationFailed("Test plan run flag is on but no valid test plan id was provided."); | ||
} | ||
planLabels = utils_1.convertStrToArr(labels); | ||
planTags = utils_1.convertStrToArr(tags); | ||
_b.label = 1; | ||
@@ -114,2 +117,3 @@ case 1: | ||
pool: pool, | ||
tags: planTags, | ||
parallel: parallel, | ||
@@ -116,0 +120,0 @@ branch: branch, |
"use strict"; | ||
exports.__esModule = true; | ||
exports.TESTING_HOST = exports.getLogger = exports.Logger = exports.sleep = exports.readRawParams = exports.toLoadmillParams = exports.isUUID = exports.isString = exports.isEmptyObj = exports.filterLabels = exports.convertArrToLabelQueryParams = exports.convertStrToArr = exports.printTestSuitesRunsReport = exports.printFlowRunsReport = exports.getObjectAsString = void 0; | ||
exports.TESTING_HOST = exports.getLogger = exports.Logger = exports.sleep = exports.readRawParams = exports.toLoadmillParams = exports.isUUID = exports.isString = exports.isEmptyObj = exports.filterTags = exports.filterLabels = exports.convertArrToLabelQueryParams = exports.convertStrToArr = exports.printTestSuitesRunsReport = exports.printFlowRunsReport = exports.getObjectAsString = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -57,2 +57,12 @@ var fs = require("fs"); | ||
exports.filterLabels = filterLabels; | ||
var filterTags = function (tags) { | ||
if (!Array.isArray(tags)) { | ||
throw new Error("Tags need be in array format i.e. ['tag1', 'another tag']. Got " + tags); | ||
} | ||
if (tags.every(function (l) { return l == ''; })) { | ||
return null; | ||
} | ||
return tags.filter(function (l) { return (typeof l === 'string') && l !== ''; }); | ||
}; | ||
exports.filterTags = filterTags; | ||
var isEmptyObj = function (obj) { return isEmpty(obj); }; | ||
@@ -59,0 +69,0 @@ exports.isEmptyObj = isEmptyObj; |
{ | ||
"name": "loadmill", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A node.js module for running load tests and functional tests on loadmill.com", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -45,3 +45,4 @@ # Loadmill | ||
pool: "some-pool-name", // Execute tests from a dedicated agent's pool (when using private agent) | ||
parallel: 2 , // Set the concurrency amount of a running test suites in a test plan. Max concurrency is 10 | ||
parallel: 2 , // Set the concurrency amount of a running test suites in a test plan. Max concurrency is 10 | ||
tags: ["tag1", "another tags"], // Set of strings attached to the plan run and later can be query by | ||
} | ||
@@ -166,2 +167,3 @@ }, | ||
- `--pool <pool>` Execute tests from a dedicated agent's pool (when using private agent). | ||
- `--tags <tags>` Tag a test plan run with a comma separated list of tags (e.g. 'tag1,tag2'). | ||
- `-b --branch <branch>` Run the test plan's suites from a GitHub branch. The latest version of the selected Git branch will be used as the test configuration for the chosen Test Plan. | ||
@@ -168,0 +170,0 @@ - `--retry-failed-flows <numberOfRetries>` Configure the test plan to re-run failed flows in case your tested system is unstable. Tests that pass after a retry will be considered successful. |
@@ -6,2 +6,3 @@ import './polyfills' | ||
filterLabels, | ||
filterTags, | ||
TESTING_HOST, | ||
@@ -98,2 +99,3 @@ toLoadmillParams, | ||
const pool = testPlan.options && testPlan.options.pool; | ||
const tags = testPlan.options && testPlan.options.tags && filterTags(testPlan.options.tags); | ||
const parallel = testPlan.options && testPlan.options.parallel; | ||
@@ -108,3 +110,3 @@ const branch = testPlan.options && testPlan.options.branch; | ||
} = await superagent.post(`${testPlansAPI}/${testPlanId}/run`) | ||
.send({ overrideParameters, additionalDescription, labels, pool, parallel, branch, maxFlakyFlowRetries, labelsExpression }) | ||
.send({ overrideParameters, additionalDescription, labels, pool, parallel, tags, branch, maxFlakyFlowRetries, labelsExpression }) | ||
.auth(token, ''); | ||
@@ -338,2 +340,3 @@ | ||
pool?: string; | ||
tags?: string[] | null; | ||
parallel?: number | string; | ||
@@ -340,0 +343,0 @@ branch?: string; |
@@ -29,2 +29,3 @@ import * as Loadmill from './index'; | ||
.option("--pool <pool>", "Execute tests from a dedicated agent's pool (when using private agent)") | ||
.option("--tags <tags>", "Tag a test plan run with a comma separated list of tags (e.g. 'tag1,tag2')") | ||
.option("-w, --wait", "Wait for the test to finish.") | ||
@@ -72,2 +73,3 @@ .option("-n, --no-bail", "Return exit code 0 even if test fails.") | ||
pool, | ||
tags, | ||
branch, | ||
@@ -111,2 +113,3 @@ retryFailedFlows, | ||
pool, | ||
tags, | ||
branch, | ||
@@ -140,7 +143,10 @@ retryFailedFlows, | ||
if (testPlan || !loadTest) { | ||
const planLabels = convertStrToArr(labels) | ||
if (!isUUID(input)) { //if test plan flag is on then the input should be uuid | ||
validationFailed("Test plan run flag is on but no valid test plan id was provided."); | ||
} | ||
const planLabels = convertStrToArr(labels); | ||
const planTags = convertStrToArr(tags); | ||
try { | ||
@@ -156,2 +162,3 @@ logger.verbose(`Executing test plan with id ${input}`); | ||
pool, | ||
tags : planTags, | ||
parallel, | ||
@@ -158,0 +165,0 @@ branch, |
@@ -57,2 +57,12 @@ import * as fs from "fs"; | ||
export const filterTags = (tags: Array<string>) => { | ||
if (!Array.isArray(tags)) { | ||
throw new Error(`Tags need be in array format i.e. ['tag1', 'another tag']. Got ${tags}`); | ||
} | ||
if (tags.every(l => l == '')) { | ||
return null; | ||
} | ||
return tags.filter(l => (typeof l === 'string') && l !== ''); | ||
} | ||
export const isEmptyObj = (obj) => isEmpty(obj); | ||
@@ -59,0 +69,0 @@ export const isString = (obj) => isAString(obj); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121854
2470
179