Fix Rust formatting
Server integrations / Paper and protocol tests (push) Failing after 20s
Server integrations / fabric / 1.20.1 (push) Failing after 11s
Server integrations / fabric / 1.21.1 (push) Failing after 14s
Server integrations / fabric / 26.1.2 (push) Failing after 17s
Server integrations / fabric / 26.2 (push) Failing after 12s
Server integrations / fabric / 26.3 (push) Failing after 6s
Server integrations / forge / 1.20.1 (push) Failing after 6s
Server integrations / forge / 1.21.1 (push) Failing after 8s
Server integrations / forge / 26.1.2 (push) Failing after 8s
Server integrations / forge / 26.2 (push) Failing after 8s
Server integrations / forge / 26.3 (push) Failing after 7s
CI / Web UIs (type-check + build) (panel/web) (push) Canceled after 0s
CI / Launcher (Windows build check) (push) Canceled after 2m53s
CI / Real installs (Mojang, Fabric, Quilt, Forge, NeoForge) (push) Canceled after 0s
CI / Docker image builds (push) Canceled after 0s
CI / Rust (fmt, clippy, tests) (push) Canceled after 1m22s
CI / Web UIs (type-check + build) (launcher) (push) Canceled after 1m27s
Server integrations / Paper and protocol tests (push) Failing after 20s
Server integrations / fabric / 1.20.1 (push) Failing after 11s
Server integrations / fabric / 1.21.1 (push) Failing after 14s
Server integrations / fabric / 26.1.2 (push) Failing after 17s
Server integrations / fabric / 26.2 (push) Failing after 12s
Server integrations / fabric / 26.3 (push) Failing after 6s
Server integrations / forge / 1.20.1 (push) Failing after 6s
Server integrations / forge / 1.21.1 (push) Failing after 8s
Server integrations / forge / 26.1.2 (push) Failing after 8s
Server integrations / forge / 26.2 (push) Failing after 8s
Server integrations / forge / 26.3 (push) Failing after 7s
CI / Web UIs (type-check + build) (panel/web) (push) Canceled after 0s
CI / Launcher (Windows build check) (push) Canceled after 2m53s
CI / Real installs (Mojang, Fabric, Quilt, Forge, NeoForge) (push) Canceled after 0s
CI / Docker image builds (push) Canceled after 0s
CI / Rust (fmt, clippy, tests) (push) Canceled after 1m22s
CI / Web UIs (type-check + build) (launcher) (push) Canceled after 1m27s
This commit is contained in:
1 parent
ce49447b6e
commit
60edc99780
58 files changed
+3533
-1375
No files matched your search
@@ -34,7 +34,13 @@ async fn world() -> World {
|
||||
|
||||
impl World {
|
||||
async fn online(&self, uuid: &str, name: &str) {
|
||||
sqlx::query("INSERT OR REPLACE INTO server_online (server_id, uuid, name, joined_at) VALUES (?, ?, ?, '2026-01-01T00:00:00Z')").bind(self.sid).bind(uuid).bind(name).execute(&self.t.db).await.unwrap();
|
||||
sqlx::query("INSERT OR REPLACE INTO server_online (server_id, uuid, name, joined_at) VALUES (?, ?, ?, '2026-01-01T00:00:00Z')")
|
||||
.bind(self.sid)
|
||||
.bind(uuid)
|
||||
.bind(name)
|
||||
.execute(&self.t.db)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
async fn poll(&self) -> Value {
|
||||
self.t.call("POST", "/api/server/v1/actions/poll", Some(&self.server), Some(json!({}))).await.1
|
||||
@@ -55,7 +61,14 @@ async fn tpa_and_messages_are_queued_once_for_the_game_server() {
|
||||
w.online(&w.alex_uuid, "Alex").await;
|
||||
assert_eq!(w.t.call("POST", &path, Some(&w.alex), Some(tpa)).await.0, StatusCode::OK);
|
||||
|
||||
let (s, r) = w.t.call("POST", &path, Some(&w.alex), Some(json!({"action": "message", "target_uuid": w.steve_uuid, "text": " hi\n\tthere\u{7} friend "}))).await;
|
||||
let (s, r) =
|
||||
w.t.call(
|
||||
"POST",
|
||||
&path,
|
||||
Some(&w.alex),
|
||||
Some(json!({"action": "message", "target_uuid": w.steve_uuid, "text": " hi\n\tthere\u{7} friend "})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(s, StatusCode::OK, "{r}");
|
||||
|
||||
let polled = w.poll().await;
|
||||
@@ -70,7 +83,10 @@ async fn tpa_and_messages_are_queued_once_for_the_game_server() {
|
||||
assert_eq!(bad(json!({"action": "message", "target_uuid": w.steve_uuid, "text": " "})).await.0, StatusCode::BAD_REQUEST);
|
||||
assert_eq!(bad(json!({"action": "kill", "target_uuid": w.steve_uuid})).await.0, StatusCode::BAD_REQUEST);
|
||||
assert_eq!(bad(json!({"action": "tpa", "target_uuid": w.alex_uuid})).await.0, StatusCode::BAD_REQUEST);
|
||||
assert_eq!(w.t.call("POST", &path, None, Some(json!({"action": "tpa", "target_uuid": w.steve_uuid}))).await.0, StatusCode::UNAUTHORIZED);
|
||||
assert_eq!(
|
||||
w.t.call("POST", &path, None, Some(json!({"action": "tpa", "target_uuid": w.steve_uuid}))).await.0,
|
||||
StatusCode::UNAUTHORIZED
|
||||
);
|
||||
|
||||
// A burst is slowed down.
|
||||
let mut last = StatusCode::OK;
|
||||
@@ -91,7 +107,14 @@ async fn guild_invites_need_consent() {
|
||||
assert_eq!(s, StatusCode::OK, "{r}");
|
||||
let in_guild = |uuid: &str| {
|
||||
let (db, gid, uuid) = (w.t.db.clone(), w.gid.clone(), uuid.to_string());
|
||||
async move { sqlx::query_scalar::<_, bool>("SELECT EXISTS(SELECT 1 FROM guild_members WHERE guild_id = ? AND uuid = ?)").bind(gid).bind(uuid).fetch_one(&db).await.unwrap() }
|
||||
async move {
|
||||
sqlx::query_scalar::<_, bool>("SELECT EXISTS(SELECT 1 FROM guild_members WHERE guild_id = ? AND uuid = ?)")
|
||||
.bind(gid)
|
||||
.bind(uuid)
|
||||
.fetch_one(&db)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
};
|
||||
assert!(!in_guild(&w.steve_uuid).await, "nobody is added without saying yes");
|
||||
|
||||
@@ -125,14 +148,22 @@ async fn invites_work_in_game_too() {
|
||||
};
|
||||
let (s, r) = server("guilds/invite/send", json!({"uuid": w.alex_uuid, "target": "steve"})).await;
|
||||
assert_eq!(s, StatusCode::OK, "{r}");
|
||||
assert_eq!(server("guilds/invite/send", json!({"uuid": w.steve_uuid, "target": "alex"})).await.0, StatusCode::FORBIDDEN, "not a leader");
|
||||
assert_eq!(
|
||||
server("guilds/invite/send", json!({"uuid": w.steve_uuid, "target": "alex"})).await.0,
|
||||
StatusCode::FORBIDDEN,
|
||||
"not a leader"
|
||||
);
|
||||
assert_eq!(server("guilds/invite/send", json!({"uuid": w.alex_uuid, "target": "nobody"})).await.0, StatusCode::NOT_FOUND);
|
||||
|
||||
let (_, list) = server("guilds/invite/list", json!({"uuid": w.steve_uuid})).await;
|
||||
assert_eq!(list["invites"][0]["guild_tag"], "IRON");
|
||||
let (s, r) = server("guilds/invite/respond", json!({"uuid": w.steve_uuid, "tag": "iron", "accept": false})).await;
|
||||
assert_eq!((s, r["accepted"].clone()), (StatusCode::OK, json!(false)));
|
||||
assert_eq!(server("guilds/invite/respond", json!({"uuid": w.steve_uuid, "accept": true})).await.0, StatusCode::NOT_FOUND, "a declined invitation is gone");
|
||||
assert_eq!(
|
||||
server("guilds/invite/respond", json!({"uuid": w.steve_uuid, "accept": true})).await.0,
|
||||
StatusCode::NOT_FOUND,
|
||||
"a declined invitation is gone"
|
||||
);
|
||||
|
||||
server("guilds/invite/send", json!({"uuid": w.alex_uuid, "target": "Steve"})).await;
|
||||
let (s, r) = server("guilds/invite/respond", json!({"uuid": w.steve_uuid, "accept": true})).await;
|
||||
|
||||
Reference in new issue
Block a user