diff --git a/readme.md b/readme.md index 5a2571e..09e313f 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,19 @@ Deletes the build folder that cmake creates to ensure a fresh rebuild. __release__ -Use _Release_ as cmake build type. _Debug_ will be used as default. +Uses _Release_ as cmake build type. _Debug_ will be used as default. In _Debug_ mode code coverage flags will be set when GNU or Clang compiler is detected. + +__without_tests__ + +Builds the project without tests + +__skip_tests__ + +Skips the execution of project tests + +__without_examples__ + +Builds the project without examples __with_ssl__ diff --git a/test/k6/load-test.js b/test/k6/load-test.js index 2b687b3..843c4f4 100644 --- a/test/k6/load-test.js +++ b/test/k6/load-test.js @@ -1,3 +1,7 @@ +// k6 script to perform some load tests. Also cf. https://k6.io +// command line: +// k6 run test/k6/load-test.js + import http from 'k6/http'; import exec from 'k6/execution'; import { check, sleep } from 'k6'; @@ -7,35 +11,35 @@ export const options = { duration: '30s', }; -export default function() { +export default function () { const baseUrl = __ENV.url || 'http://localhost:8888'; const td = http.get(baseUrl); - check(td, {'get thing description status was 200': (r) => r.status == 200 }); + check(td, { 'get thing description status was 200': (r) => r.status == 200 }); const ps = http.get(baseUrl + '/properties'); - check(ps, {'get properties status was 200': (r) => r.status == 200 }); + check(ps, { 'get properties status was 200': (r) => r.status == 200 }); const as = http.get(baseUrl + '/actions'); - check(as, {'get actions status was 200': (r) => r.status == 200 }); + check(as, { 'get actions status was 200': (r) => r.status == 200 }); const es = http.get(baseUrl + '/events'); - check(es, {'get events status was 200': (r) => r.status == 200 }); + check(es, { 'get events status was 200': (r) => r.status == 200 }); const headers = { headers: { - 'Content-Type': 'application/json', + 'Content-Type': 'application/json', }, }; const on = exec.scenario.iterationInTest % 2 == 0; - const onProp = http.put(baseUrl + '/properties/on', JSON.stringify({"on":on}), headers); - check(onProp, {'put on property status was 200': (r) => r.status == 200 }); + const onProp = http.put(baseUrl + '/properties/on', JSON.stringify({ "on": on }), headers); + check(onProp, { 'put on property status was 200': (r) => r.status == 200 }); const brightness = 10 * (exec.scenario.iterationInTest % 10); const duration = 1 + 200 * (exec.scenario.iterationInTest % 5); - const fadePayload = {"fade":{"input":{"brightness":brightness, "duration":duration}}}; + const fadePayload = { "fade": { "input": { "brightness": brightness, "duration": duration } } }; const fade = http.post(baseUrl + '/actions', JSON.stringify(fadePayload), headers); - check(fade, {'post fade actions status was 201': (r) => r.status == 201 }); + check(fade, { 'post fade actions status was 201': (r) => r.status == 201 }); }