diff options
author | halil.cakal <halil.cakal@est.tech> | 2024-05-27 16:06:59 +0100 |
---|---|---|
committer | halil.cakal <halil.cakal@est.tech> | 2024-05-27 16:06:59 +0100 |
commit | 0613fbd654bacb9324e07bb2f9f4244302c48aaa (patch) | |
tree | 8fd4f5b3cfdac8f1baf59794395ac6bc9e2f6674 /k6-tests/ncmp/1-create-cmhandles.js | |
parent | c628542edebf7b000bc8646455378ae076bdc9c5 (diff) |
Print summary report for K6 tests
- add a generic template to print summary of k6 test results
- remove container logs since its around 50 mb
Issue-ID: CPS-2215
Change-Id: I8971fc30b9dc8be2ed16eda6755d17a91f608b48
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'k6-tests/ncmp/1-create-cmhandles.js')
-rw-r--r-- | k6-tests/ncmp/1-create-cmhandles.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/k6-tests/ncmp/1-create-cmhandles.js b/k6-tests/ncmp/1-create-cmhandles.js index c32cd2f03d..a6f8086d20 100644 --- a/k6-tests/ncmp/1-create-cmhandles.js +++ b/k6-tests/ncmp/1-create-cmhandles.js @@ -21,36 +21,48 @@ import http from 'k6/http'; import exec from 'k6/execution'; import { check } from 'k6'; -import { NCMP_BASE_URL, DMI_PLUGIN_URL, TOTAL_CM_HANDLES, makeBatchOfCmHandleIds } from './utils.js'; +import { + NCMP_BASE_URL, + DMI_PLUGIN_URL, + TOTAL_CM_HANDLES, + makeBatchOfCmHandleIds, + makeCustomSummaryReport +} from './utils.js'; const BATCH_SIZE = 100; export const options = { - vus: 1, - iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE), - thresholds: { - http_req_failed: ['rate == 0'], - http_req_duration: ['avg <= 1000'], - }, + vus: 1, + iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE), + thresholds: { + http_req_failed: ['rate == 0'], + http_req_duration: ['avg <= 1000'], + }, }; -export default function() { +export default function () { const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(BATCH_SIZE, exec.scenario.iterationInTest); const payload = { "dmiPlugin": DMI_PLUGIN_URL, "createdCmHandles": nextBatchOfCmHandleIds.map(cmHandleId => ({ "cmHandle": cmHandleId, - "cmHandleProperties": { "neType": "RadioNode" }, + "cmHandleProperties": {"neType": "RadioNode"}, "publicCmHandleProperties": { "Color": "yellow", "Size": "small", "Shape": "cube" - } + } })), }; const response = http.post(NCMP_BASE_URL + '/ncmpInventory/v1/ch', JSON.stringify(payload), { - headers: { 'Content-Type': 'application/json' }, + headers: {'Content-Type': 'application/json'}, }); check(response, { 'status equals 200': (r) => r.status === 200, }); } + +export function handleSummary(data) { + return { + stdout: makeCustomSummaryReport(data, options), + }; +}
\ No newline at end of file |