feat: run tests on all workspaces and lints
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
Aravinth Manivannan 2022-12-12 15:15:11 +05:30
parent 4db76a0705
commit 96c1b807a7
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 21 additions and 16 deletions

View File

@ -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

View File

@ -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);
}
}