test-collector-utils

Crates.iotest-collector-utils
lib.rstest-collector-utils
version0.1.2
sourcesrc
created_at2022-05-28 22:14:11.942198
updated_at2022-06-17 18:33:11.952669
descriptionA utils libraty for test collector
homepage
repositoryhttps://github.com/MIF-0/test-collector/tree/main/test-collector-utils
max_upload_size
id596048
size3,343
(MIF-0)

documentation

https://docs.rs/test-collector-utils

README

test-collector-derive will give you '#[collect_test]' which you can use to collect the tests this lib using inventory

    #[collect_test]
    #[test]
    pub fn sync_test_success() {
        println!("Executed sync!");
        assert_eq!(true, true);
    }

    #[collect_test(async)]
    #[actix_web::test]
    pub async fn async_test_success() {
        let client = reqwest::Client::builder()
            .build()
            .expect("error during client build");
        let response = client.get("http://localhost:9090/").send().await;
        assert!(response.is_ok());
    }

test-collector-lib introduce custom test runner. You will need to create your own main function and in Cargo.toml of you project add this with needed name and path:

[[test]]
name = "integration"
path = "integration-tests/main.rs"
harness = false

example of the main can be found in test-collector-lib/src/lib.rs:88

Commit count: 0

cargo fmt