diff --git a/Makefile b/Makefile index 109ab66..acac60f 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,12 @@ +define lint + cargo fmt -v --all -- --emit files + cargo clippy --workspace --tests --all-features +endef + +define test + cargo test --no-fail-fast --workspace --tests --all-features +endef + default: ## Build app in debug mode cargo build @@ -25,8 +34,10 @@ env: ## Setup development environtment cargo fetch lint: ## Lint codebase - cargo fmt -v --all -- --emit files - cargo clippy --workspace --tests --all-features + $(call lint) + cd env/dummy_conductor && $(call lint) + cd env/nginx_bind_le && $(call lint) + cd env/libconductor && $(call lint) #migrate: ## run migrations # unset DATABASE_URL && cargo build @@ -45,7 +56,9 @@ run: ## Run app in debug mode # --all-features test: ## Run all available tests - cargo test --no-fail-fast --workspace + $(call test) + cd env/dummy_conductor && $(call test) + cd env/nginx_bind_le && $(call test) xml-test-coverage: ## Generate code coverage report in XML format cargo tarpaulin -t 1200 --out Xml diff --git a/src/docs.rs b/src/docs.rs index 26b0bf7..41a1dfd 100644 --- a/src/docs.rs +++ b/src/docs.rs @@ -111,26 +111,18 @@ mod tests { ) .await; - let resp = test::call_service( - &app, - test::TestRequest::get().uri(DOCS.home).to_request(), - ) - .await; + let resp = + test::call_service(&app, test::TestRequest::get().uri(DOCS.home).to_request()).await; assert_eq!(resp.status(), StatusCode::OK); - let resp = test::call_service( - &app, - test::TestRequest::get().uri(DOCS.spec).to_request(), - ) - .await; + let resp = + test::call_service(&app, test::TestRequest::get().uri(DOCS.spec).to_request()).await; assert_eq!(resp.status(), StatusCode::OK); let uri = format!("{}/{}", DOCS.home, "favicon-32x32.png"); println!("{uri}"); - let resp = - test::call_service(&app, test::TestRequest::get().uri(&uri).to_request()) - .await; + let resp = test::call_service(&app, test::TestRequest::get().uri(&uri).to_request()).await; assert_eq!(resp.status(), StatusCode::OK); } }