A collection of integration tests for the CentroStella infrastructure.
test
├── common <-- building blocks (API method, checks, ...)
│ └── api
├── e2e <-- end-to-end tests
├── performance <-- load tests
└── smoke <-- smoke tests
- Install
go
(on Mac OS Xbrew install golang
) - Install
xk6
with the following commandgo install go.k6.io/xk6/cmd/xk6@latest
- Build a customized version of
k6
withdotenv
support. The following command will create e customizedk6
executable in the current folderxk6 build --with github.com/szkiba/xk6-dotenv@latest
. Warning: if you are using an arm architecture you may need to specify the k6 version to guarantee all the tests to run smoothly:xk6 build v0.34.0 --with github.com/szkiba/xk6-dotenv@latest
.
- Create a folder named
certs
- Put the private key and the corresponding certificate for mutual-auth in the folder
certs
- Create a copy of the file
./env.local.sample
and rename it as./.env.dev.local
[./.env.uat.local
|./.env.prod.local
] - Customize env variables in
./.env.dev.local
[./.env.uat.local
|./.env.prod.local
] - Run a test with
TARGET_ENV=<ENV> ./k6 run test/smoke/rtdCsvTransaction.js
./smoke_env.sh <ENV>
./load_env.sh <ENV>
With tracing enabled all HTTP responses will be printed to standard output. To enable it just set the environment variable REQ_DUMP:
REQ_DUMP=1 ./k6 run <TEST>
Ensure your code is formatted correctly. The codestyle is defined in the file .prettierrc and enforced via Prettier itself.
To automatically check (and eventually format) files before committing install the pre-commit hooks on your machine:
pre-commit Installation