@@ -313,20 +313,54 @@ Kelemetrix is a separate component that consumes audit logs into metric points.
313313Tag providers provide string tags to use in kelemetrix.toml,
314314and quantifiers provide scalar quantities.
315315
316- ## Testing
316+ ## End-to-end Testing
317317
318318Kelemetry runs end-to-end tests on GitHub CI.
319319Each test suite is a directory under the [ ` e2e ` ] ( ../e2e ) directory
320320with the following structure:
321321
322- - ` client .sh` : Executes a series of operations on a running cluster at ` $KUBECONFIG `
323- to trigger generation of a test trace.
324- It can be assumed that the default ` make quickstart ` configuration is running for the cluster .
325- - ` config.sh ` : Defines the following ` local ` Bash variables.
322+ - ` config .sh` : Sourced by the e2e test script,
323+ executes a series of operations on a running cluster at ` $KUBECONFIG `
324+ to trigger a background ` make quickstart ` to generate the test trace .
325+ Also defines the following ` local ` Bash variables.
326326 It is directly ` source ` d by the e2e test script.
327- - ` TRACE_DISPLAY_NAME ` , the display name of the trace shown on the [ demo index] ( https://kubewharf.io/kelemetry/ )
327+ - ` TRACE_DISPLAY_NAME ` , the display name of the trace shown on the [ demo index] ( https://kubewharf.io/kelemetry/ ) .
328328 - ` TRACE_SEARCH_TAGS ` , an associative array for the search tags to uniquely identify the test trace generated by ` client.sh ` .
329+ - ` TEST_DISPLAY_MODE ` , the display mode of the trace to test with.
330+ - ` EXTRA_DISPLAY_MODES ` (optional), an indexed array for additional display modes to show on GitHub Pages without getting tested in the e2e test.
329331- ` validate.jq ` : A ` jq ` script that takes the test trace JSON as input
330332 and [ fails] ( https://jqlang.github.io/jq/manual/#error ) if errors are encountered.
331333 The script may use library functions defined under [ ` e2e/lib ` ] ( ../e2e/lib ) .
332334 The current framework uses [ gojq] ( https://github.com/itchyny/gojq/ ) as the ` jq ` implementation.
335+
336+ End-to-end tests can be executed locally with the commands:
337+
338+ ``` console
339+ $ make kind
340+ $ make e2e
341+ ```
342+
343+ ` make e2e ` automatically runs ` make quickstart `
344+ using a custom image built from the local ` make output/kelemetry ` output.
345+ If you prefer to run the kelemetry process directly (e.g. with a debugger),
346+ use the following steps instead:
347+
348+ 1 . Clean up all previous data by removing the stack volumes completely:
349+
350+ ``` bash
351+ make stack COMPOSE_COMMAND=' down --remove-orphans --volumes'
352+ ```
353+
354+ 2 . Recreate the stack:
355+
356+ ``` bash
357+ make stack COMPOSE_COMMAND=' up --build -d --remove-orphans'
358+ ```
359+
360+ 3 . Run Kelemetry with your preferred method equivalent to ` make ` .
361+
362+ 4 . Execute the e2e test script:
363+
364+ ``` bash
365+ bash e2e/run-all.sh
366+ ```
0 commit comments