Skip to content

Commit d29a081

Browse files
committed
Add test coverage for crud models
1 parent d62d815 commit d29a081

67 files changed

Lines changed: 17651 additions & 4773 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_and_check.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
env:
2727
CARGO_TERM_COLOR: always
2828
THOTH_EXPORT_API: https://export.thoth.pub
29+
TEST_DATABASE_URL: postgres://thoth:thoth@localhost:5432/thoth_test
2930
TEST_REDIS_URL: redis://localhost:6379
3031

3132
jobs:
@@ -47,6 +48,19 @@ jobs:
4748
test:
4849
runs-on: ubuntu-latest
4950
services:
51+
postgres:
52+
image: postgres:17
53+
env:
54+
POSTGRES_DB: thoth_test
55+
POSTGRES_USER: thoth
56+
POSTGRES_PASSWORD: thoth
57+
ports:
58+
- 5432:5432
59+
options: >-
60+
--health-cmd pg_isready
61+
--health-interval 10s
62+
--health-timeout 5s
63+
--health-retries 5
5064
redis:
5165
image: redis:alpine
5266
options: >-

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

thoth-api/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ uuid = { version = "1.16.0", features = ["serde", "v4"] }
5252
zitadel = { version = "5.5.1", features = ["actix"], optional = true}
5353

5454
[dev-dependencies]
55-
tokio = { version = "1.44", features = ["macros"] }
55+
fs2 = "0.4.3"
56+
tokio = { version = "1.44", features = ["macros", "rt"] }

thoth-api/src/model/abstract/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,5 @@ pub mod crud;
142142
mod policy;
143143
#[cfg(feature = "backend")]
144144
pub(crate) use policy::AbstractPolicy;
145+
#[cfg(test)]
146+
mod tests;

0 commit comments

Comments
 (0)