From b5c5660fe1d7f614f554bd761197061459c20557 Mon Sep 17 00:00:00 2001 From: Nicolas Auler Date: Mon, 30 Sep 2024 00:15:35 -0300 Subject: [PATCH] feat: support database tests in coverage --- .circleci/config.yml | 8 ++++++-- flake.nix | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02e2317..bf5ec71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,6 +139,8 @@ jobs: coverage: docker: - image: cimg/rust:1.81.0 + environment: + DATABASE_URL: postgresql://postgres@localhost/circle_test steps: - checkout - run: @@ -163,12 +165,14 @@ jobs: command: | echo PLUGGY_CLIENT_ID=$PLUGGY_CLIENT_ID > test.env echo PLUGGY_CLIENT_SECRET=$PLUGGY_CLIENT_SECRET >> test.env + - run: + name: Database setup + command: | + sqlx migrate run - run: name: Running code coverage command: | rustup run nightly cargo llvm-cov nextest --locked --all-features --lcov --output-path lcov.info - environment: - DATABASE_URL: postgresql://postgres@localhost/circle_test - codecov/upload: file: "./lcov.info" # token: $CODECOV_TOKEN already default diff --git a/flake.nix b/flake.nix index 2609633..b96db79 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,7 @@ buildInputs = [ bacon cargo-expand + cargo-llvm-cov cargo-nextest cargo-watch jq