Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NH-88139: update smoke-test readme #254

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions smoke-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ This directory contains the test machinery code and the machinery is held togeth
- `SWO_EMAIL`: The swo user email used to get temporary login credentials.
- `SWO_PWORD`: The swo user password.

## Test Architecture

The testing is done in two phases. In the first phase, we spin up service containers with the agent attached. The test downloads the latest snapshot agent built from the current commit. The `K6` container is used to generates HTTP requests to the other containers based on the specification in [basic.js](k6/basic.js) and helpers [names.js](k6/names.js). With the request generation, the specification in [basic.js](k6/basic.js) contains validation checks and `K6` records the result of these checks in a `json` file. This result is then used in the second phase by the JUnit test to verify that the `K6` checks succeeded. The JUnit checks the result to determine whether to pass or fail the build. The role of the second phase is to fail the build when any `K6` check fail. This is because `K6` checks cannot directly fail the build.

Some test don't depend on the result generated by `K6`, but on the log stream generated by the service containers. [LogStreamAnalyzer.java](src/test/java/com/solarwinds/util/LogStreamAnalyzer.java) is used to analyzer the logs generated by the service container and answers question about what it saw in the stream base on the configured regular expressions.

## Running the test
- build docker image for `spring-boot-webmvc` and tag it with `smt:webmvc`
- set environment variable `LAMBDA=false`
Expand Down