Fix imports
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Rafael Caricio 2023-04-27 23:20:59 +02:00
parent 3860b4780d
commit 93be6f8559
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947
4 changed files with 14 additions and 5 deletions

View file

@ -9,7 +9,11 @@ pipeline:
branch: [ master ] branch: [ master ]
path: path:
include: include:
- "./**/*.rs" - src/**/*.rs
- fedimovies-cli/**/*.rs
- fedimovies-config/**/*.rs
- fedimovies-models/**/*.rs
- fedimovies-utils/**/*.rs
commands: commands:
- rustup default $RUST - rustup default $RUST
- cargo clippy --all-targets --all-features -- -D warnings - cargo clippy --all-targets --all-features -- -D warnings
@ -20,7 +24,11 @@ pipeline:
branch: [ master ] branch: [ master ]
path: path:
include: include:
- "./**/*.rs" - src/**/*.rs
- fedimovies-cli/**/*.rs
- fedimovies-config/**/*.rs
- fedimovies-models/**/*.rs
- fedimovies-utils/**/*.rs
environment: environment:
- CARGO_TERM_COLOR=always - CARGO_TERM_COLOR=always
commands: commands:

View file

@ -14,7 +14,6 @@ pub mod test_utils;
pub type DbPool = deadpool_postgres::Pool; pub type DbPool = deadpool_postgres::Pool;
pub use tokio_postgres::GenericClient as DatabaseClient; pub use tokio_postgres::GenericClient as DatabaseClient;
use tokio_postgres::NoTls;
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
#[error("database type error")] #[error("database type error")]
@ -81,7 +80,7 @@ pub fn create_pool(database_url: &str, ca_file_path: Option<&Path>, pool_size: u
connector, connector,
) )
} else { } else {
deadpool_postgres::Manager::new(database_url.parse().expect("invalid database URL"), NoTls) deadpool_postgres::Manager::new(database_url.parse().expect("invalid database URL"), tokio_postgres::NoTls)
}; };
DbPool::builder(manager) DbPool::builder(manager)

View file

@ -4,7 +4,7 @@ use tokio_postgres::config::Config;
use tokio_postgres::Client; use tokio_postgres::Client;
const DEFAULT_CONNECTION_URL: &str = const DEFAULT_CONNECTION_URL: &str =
"postgres://fedimovies:fedimovies@127.0.0.1:55432/fedimovies-test"; "postgres://fedimovies:fedimovies@127.0.0.1:55432/fedimovies";
pub async fn create_test_database() -> Client { pub async fn create_test_database() -> Client {
let connection_url = let connection_url =
@ -17,6 +17,7 @@ pub async fn create_test_database() -> Client {
.expect("database name not specified") .expect("database name not specified")
.to_string(); .to_string();
println!("Creating test database: {}", db_name);
// Create connection without database name // Create connection without database name
db_config.dbname(""); db_config.dbname("");
let db_client = create_database_client(&db_config, None).await; let db_client = create_database_client(&db_config, None).await;

View file

@ -145,6 +145,7 @@ mod tests {
} }
#[test] #[test]
#[ignore]
fn test_create_and_verify_signature() { fn test_create_and_verify_signature() {
let signer_key = generate_weak_rsa_key().unwrap(); let signer_key = generate_weak_rsa_key().unwrap();
let signer_key_id = "https://example.org/users/test#main-key"; let signer_key_id = "https://example.org/users/test#main-key";