Skip to content

Commit 88bd598

Browse files
committed
fix: tests. Missing new image cache section in config
1 parent 7cd0cb2 commit 88bd598

File tree

5 files changed

+56
-4
lines changed

5 files changed

+56
-4
lines changed

config-idx-back.toml.local

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ username = ""
3030
password = ""
3131
server = "mailcatcher"
3232
port = 1025
33+
34+
[image_cache]
35+
max_request_timeout_ms = 1000
36+
capacity = 128000000
37+
entry_size_limit = 4000000
38+
user_quota_period_seconds = 3600
39+
user_quota_bytes = 64000000

config.toml.local

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ max_password_length = 64
1818
secret_key = "MaxVerstappenWC2021"
1919

2020
[database]
21-
connect_url = "sqlite://storage/database/data.db?mode=rwc"
21+
connect_url = "sqlite://data.db?mode=rwc"
2222
torrent_info_update_interval = 3600
2323

2424
[mail]
@@ -29,3 +29,10 @@ username = ""
2929
password = ""
3030
server = ""
3131
port = 25
32+
33+
[image_cache]
34+
max_request_timeout_ms = 1000
35+
capacity = 128000000
36+
entry_size_limit = 4000000
37+
user_quota_period_seconds = 3600
38+
user_quota_bytes = 64000000

tests/common/contexts/settings/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub struct Settings {
1111
pub auth: Auth,
1212
pub database: Database,
1313
pub mail: Mail,
14+
pub image_cache: ImageCache,
1415
}
1516

1617
#[derive(Deserialize, Serialize, PartialEq, Debug)]
@@ -57,3 +58,12 @@ pub struct Mail {
5758
pub server: String,
5859
pub port: u64,
5960
}
61+
62+
#[derive(Deserialize, Serialize, PartialEq, Debug)]
63+
pub struct ImageCache {
64+
pub max_request_timeout_ms: u64,
65+
pub capacity: u64,
66+
pub entry_size_limit: u64,
67+
pub user_quota_period_seconds: u64,
68+
pub user_quota_bytes: u64,
69+
}

tests/e2e/contexts/settings/contract.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::common::client::Client;
22
use crate::common::contexts::settings::form::UpdateSettingsForm;
33
use crate::common::contexts::settings::responses::{AllSettingsResponse, Public, PublicSettingsResponse, SiteNameResponse};
4-
use crate::common::contexts::settings::{Auth, Database, Mail, Net, Settings, Tracker, Website};
4+
use crate::common::contexts::settings::{Auth, Database, ImageCache, Mail, Net, Settings, Tracker, Website};
55
use crate::e2e::contexts::user::steps::new_logged_in_admin;
66
use crate::e2e::environment::TestEnv;
77

@@ -112,6 +112,13 @@ async fn it_should_allow_admins_to_update_all_the_settings() {
112112
server: "mailcatcher".to_string(),
113113
port: 1025,
114114
},
115+
image_cache: ImageCache {
116+
max_request_timeout_ms: 1000,
117+
capacity: 128_000_000,
118+
entry_size_limit: 4_000_000,
119+
user_quota_period_seconds: 3600,
120+
user_quota_bytes: 64_000_000,
121+
},
115122
})
116123
.await;
117124

@@ -152,7 +159,14 @@ async fn it_should_allow_admins_to_update_all_the_settings() {
152159
password: String::new(),
153160
server: "mailcatcher".to_string(),
154161
port: 1025,
155-
}
162+
},
163+
image_cache: ImageCache {
164+
max_request_timeout_ms: 1000,
165+
capacity: 128_000_000,
166+
entry_size_limit: 4_000_000,
167+
user_quota_period_seconds: 3600,
168+
user_quota_bytes: 64_000_000,
169+
},
156170
}
157171
);
158172
if let Some(content_type) = &response.content_type {

tests/e2e/environment.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::env;
22

3-
use crate::common::contexts::settings::{Auth, Database, Mail, Net, Settings, Tracker, Website};
3+
use crate::common::contexts::settings::{Auth, Database, ImageCache, Mail, Net, Settings, Tracker, Website};
44
use crate::environments::{self, isolated, shared};
55

66
enum State {
@@ -128,6 +128,13 @@ impl TestEnv {
128128
server: "mailcatcher".to_string(),
129129
port: 1025,
130130
},
131+
image_cache: ImageCache {
132+
max_request_timeout_ms: 1000,
133+
capacity: 128_000_000,
134+
entry_size_limit: 4_000_000,
135+
user_quota_period_seconds: 3600,
136+
user_quota_bytes: 64_000_000,
137+
},
131138
}),
132139
State::RunningIsolated => Some(Settings {
133140
website: Website {
@@ -160,6 +167,13 @@ impl TestEnv {
160167
server: String::new(),
161168
port: 25,
162169
},
170+
image_cache: ImageCache {
171+
max_request_timeout_ms: 1000,
172+
capacity: 128_000_000,
173+
entry_size_limit: 4_000_000,
174+
user_quota_period_seconds: 3600,
175+
user_quota_bytes: 64_000_000,
176+
},
163177
}),
164178
}
165179
}

0 commit comments

Comments
 (0)