mirror of https://github.com/realaravinth/gitpad
feat: setup tests
parent
aa4d205742
commit
28bbdaebad
|
@ -1,2 +1,4 @@
|
|||
/target
|
||||
.env
|
||||
tarpaulin-report.html
|
||||
**/tmp/
|
||||
|
|
|
@ -908,6 +908,8 @@ dependencies = [
|
|||
"argon2-creds",
|
||||
"config",
|
||||
"db-core",
|
||||
"db-sqlx-postgres",
|
||||
"db-sqlx-sqlite",
|
||||
"derive_more",
|
||||
"git2",
|
||||
"lazy_static",
|
||||
|
@ -917,6 +919,7 @@ dependencies = [
|
|||
"rand 0.8.4",
|
||||
"serde 1.0.136",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"tokio",
|
||||
"url",
|
||||
"validator",
|
||||
|
@ -2146,6 +2149,7 @@ dependencies = [
|
|||
"time 0.2.27",
|
||||
"tokio-stream",
|
||||
"url",
|
||||
"uuid",
|
||||
"webpki",
|
||||
"webpki-roots",
|
||||
"whoami",
|
||||
|
@ -2575,6 +2579,12 @@ version = "0.7.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
|
||||
[[package]]
|
||||
name = "validator"
|
||||
version = "0.14.0"
|
||||
|
|
|
@ -40,3 +40,9 @@ serde_json = "1"
|
|||
tokio = "1.16.1"
|
||||
url = "2.2"
|
||||
validator = { version = "0.14.0", features = ["derive"] }
|
||||
|
||||
[dev-dependencies]
|
||||
db-sqlx-postgres = {path = "./database/db-sqlx-postgres"}
|
||||
db-sqlx-sqlite = {path = "./database/db-sqlx-sqlite"}
|
||||
actix-rt = "2"
|
||||
sqlx = { version = "0.5.10", features = [ "runtime-actix-rustls", "uuid", "postgres", "time", "offline", "sqlite" ] }
|
||||
|
|
7
Makefile
7
Makefile
|
@ -2,6 +2,9 @@ default: ## Debug build
|
|||
cargo build
|
||||
|
||||
clean: ## Clean all build artifacts and dependencies
|
||||
@-/bin/rm -rf target/
|
||||
@-/bin/rm -rf database/migrator/target/
|
||||
@-/bin/rm -rf database/*/target/
|
||||
@cargo clean
|
||||
|
||||
coverage: migrate ## Generate coverage report in HTML format
|
||||
|
@ -34,6 +37,10 @@ migrate: ## run migrations
|
|||
@-rm -rf database/db-sqlx-sqlite/tmp && mkdir database/db-sqlx-sqlite/tmp
|
||||
cd database/migrator && cargo run
|
||||
|
||||
sqlx-offline-data: ## prepare sqlx offline data
|
||||
cargo sqlx prepare --database-url=${POSTGRES_DATABASE_URL} -- --bin gists \
|
||||
--all-features
|
||||
|
||||
test: migrate ## Run tests
|
||||
cd database/db-sqlx-postgres &&\
|
||||
DATABASE_URL=${POSTGRES_DATABASE_URL}\
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"db": "PostgreSQL"
|
||||
}
|
Loading…
Reference in New Issue