feat: run tests on all workspaces and lints
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
4db76a0705
commit
96c1b807a7
2 changed files with 21 additions and 16 deletions
19
Makefile
19
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
|
||||
|
|
18
src/docs.rs
18
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue