Hi!

I am not sure if this is either a sqlx issue or a tarpaulin issue. I am gathering tests with cargo tarpaulin --ignore-tests --all-features --release --out Lcov --skip-clean. For some reason the bind calls are marked as not covered by tests while they must be executed in any case when the function stores the data successfully (which is the case in my tests).

Bug Description

sqlx::query( // Covered by test
        "
            INSERT INTO table(a, b, c, d) 
            SELECT *, $4 FROM UNNEST($1::text[], $2::text[], $3::text[])
            ON CONFLICT (a, b, c) DO UPDATE 
            SET a = excluded.a, 
                d = excluded.d
        ",
    )
    .bind(data.a.clone()) // Not covered by tests
    .bind(data.b.clone()) // Not covered by tests
    .bind(data.c.clone()) // Not covered by tests
    .bind(
        SystemTime::now() // Covered by test
            .duration_since(SystemTime::UNIX_EPOCH)
            .unwrap()
            .as_millis() as i64,
    )
    .execute(pool)
    .await // Covered by test

Info

  • sqlx = { version = "0.6.0", features = [ "runtime-async-std-native-tls", "postgres" ] }
  • Operating system: Ubuntu 20
  • rustc --version: rustc 1.64.0
0
© 2022 pullanswer.com - All rights reserved.