add github workflow

This commit is contained in:
Johannes Heuel
2022-08-22 20:49:24 +02:00
parent 12e5c79a5e
commit 20c61d76f3
2 changed files with 33 additions and 27 deletions

View File

@@ -114,30 +114,3 @@ async fn main() -> std::io::Result<()> {
.run()
.await
}
#[cfg(test)]
mod tests {
use super::*;
use actix_web::test;
#[actix_web::test]
async fn user_routes() {
std::env::set_var("RUST_LOG", "actix_web=debug");
env_logger::init();
dotenv::dotenv().ok();
let connspec = std::env::var("DATABASE_URL").expect("DATABASE_URL");
let manager = ConnectionManager::<PgConnection>::new(connspec);
let pool = r2d2::Pool::builder()
.build(manager)
.expect("Failed to create pool.");
let _app = test::init_service(
App::new()
.app_data(web::Data::new(pool.clone()))
.wrap(middleware::Logger::default()), // .service(get_user)
// .service(add_user),
)
.await;
}
}