You can use flamegraph for benchmarking with cargo flamegraph --bin transparencies-backend-rs.
The flamegraph.svg will be found in the root of the repository.
-
First create a copy of the
/tests/matchinfo-integration/test_case_templatefolder. Rename it to something reasonable. -
Then edit the
match_info_request.ronfile in this newly created folder structure and let it point to a combination of settings you want to test. -
Then run
cargo run --example export-test-data -- --test-case-folder <test-case-export-path>to download a set of responses that are serialized into JSON-files into the corresponding folder. -
Afterwards open
/tests/matchinfo-integration/main.rsand depending on what you want to achieve either copy one of the functions marked with#[tokio::test]and adapt them or add anotherTestCaseto one of these functions.TestCasesthat are added withtest_cases.add(path)should be only added if they test the same functionality/feature. Otherwhise create a new function from. This makes it easier to see if a test fails which feature is not working.
-
Make sure the data that will be exported again will depict the actual test case. Because everything is redownloaded it's not that sure.
-
Then run
cargo run --example export-test-data -- --test-case-folder <test-case-export-path>to download a set of responses that are serialized into JSON-files into the corresponding folder.
We are using the bunyan CLI to prettify the outputted logs.
The original bunyan requires NPM, but you can install a Rust-port with
cargo install bunyan.
Then run TEST_LOG=true cargo test | bunyan/TEST_LOG=true just test | bunyan
to run our test suite.
Documentation can be easily build and opened with cargo doc --no-deps --document-private-items --open.
GNU AGPLv3 or later; see LICENSE.