merge latest dev
This commit is contained in:
commit
7548f0e592
|
@ -46,6 +46,26 @@ jobs:
|
||||||
cargo build --verbose --all-features
|
cargo build --verbose --all-features
|
||||||
cargo test --verbose --all-features
|
cargo test --verbose --all-features
|
||||||
fi
|
fi
|
||||||
|
- name: Check common non-default feature configurations
|
||||||
|
run: |
|
||||||
|
echo "No features:"
|
||||||
|
cargo check --features="" --no-default-features
|
||||||
|
echo "Only client:"
|
||||||
|
cargo check --features="client" --no-default-features
|
||||||
|
echo "Only backend:"
|
||||||
|
cargo check --features="backend" --no-default-features
|
||||||
|
echo "Only voice:"
|
||||||
|
cargo check --features="voice" --no-default-features
|
||||||
|
echo "Only voice gateway:"
|
||||||
|
cargo check --features="voice_gateway" --no-default-features
|
||||||
|
echo "Backend + client:"
|
||||||
|
cargo check --features="backend, client" --no-default-features
|
||||||
|
echo "Backend + voice:"
|
||||||
|
cargo check --features="backend, voice" --no-default-features
|
||||||
|
echo "Backend + voice gateway:"
|
||||||
|
cargo check --features="backend, voice_gateway" --no-default-features
|
||||||
|
echo "Client + voice gateway:"
|
||||||
|
cargo check --features="client, voice_gateway" --no-default-features
|
||||||
# wasm-safari:
|
# wasm-safari:
|
||||||
# runs-on: macos-latest
|
# runs-on: macos-latest
|
||||||
# steps:
|
# steps:
|
||||||
|
@ -75,7 +95,7 @@ jobs:
|
||||||
# cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.88" --force
|
# cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.88" --force
|
||||||
# SAFARIDRIVER=$(which safaridriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt" --no-fail-fast
|
# SAFARIDRIVER=$(which safaridriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt" --no-fail-fast
|
||||||
wasm-gecko:
|
wasm-gecko:
|
||||||
runs-on: macos-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -101,7 +121,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rustup target add wasm32-unknown-unknown
|
rustup target add wasm32-unknown-unknown
|
||||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.88" --force
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.92" --force
|
||||||
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
||||||
wasm-chrome:
|
wasm-chrome:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
@ -130,5 +150,5 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rustup target add wasm32-unknown-unknown
|
rustup target add wasm32-unknown-unknown
|
||||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.88" --force
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.92" --force
|
||||||
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
name: Semver release checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
semver-checks:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: obi1kenobi/cargo-semver-checks-action@v2
|
|
@ -255,61 +255,3 @@ pub struct MessageActivity {
|
||||||
pub activity_type: i64,
|
pub activity_type: i64,
|
||||||
pub party_id: Option<String>,
|
pub party_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
#[test]
|
|
||||||
fn test_deserialize_message() {
|
|
||||||
let raw = r#"{
|
|
||||||
"id":"1246967362553443002",
|
|
||||||
"channel_id":"1246967361836216935",
|
|
||||||
"guild_id":"1246967361001550368",
|
|
||||||
"author":{
|
|
||||||
"username":"integrationtestuser",
|
|
||||||
"discriminator":"3864",
|
|
||||||
"id":"1246967359860699591",
|
|
||||||
"public_flags":0,
|
|
||||||
"avatar":null,
|
|
||||||
"accent_color":null,
|
|
||||||
"banner":null,
|
|
||||||
"bio":"",
|
|
||||||
"bot":false,
|
|
||||||
"premium_since":"2024-06-02T23:23:06.124+00:00",
|
|
||||||
"premium_type":2,
|
|
||||||
"theme_colors":null,
|
|
||||||
"pronouns":null
|
|
||||||
},
|
|
||||||
"member":{
|
|
||||||
"index":142,
|
|
||||||
"id":"1246967359860699591",
|
|
||||||
"guild_id":"1246967361001550368",
|
|
||||||
"nick":null,
|
|
||||||
"joined_at":"2024-06-02T23:23:06.526+00:00",
|
|
||||||
"premium_since":null,"deaf":false,"mute":false,"pending":false,
|
|
||||||
"last_message_id":null,
|
|
||||||
"joined_by":null,
|
|
||||||
"avatar":null,
|
|
||||||
"banner":null,
|
|
||||||
"bio":"",
|
|
||||||
"theme_colors":null,
|
|
||||||
"pronouns":null,
|
|
||||||
"communication_disabled_until":null,
|
|
||||||
"roles":[]
|
|
||||||
},
|
|
||||||
"content":"A Message!",
|
|
||||||
"timestamp":"2024-06-02T23:23:06.762+00:00",
|
|
||||||
"edited_timestamp":null,
|
|
||||||
"tts":false,
|
|
||||||
"mention_everyone":false,
|
|
||||||
"mentions":[],
|
|
||||||
"mention_roles":[],
|
|
||||||
"attachments":[],
|
|
||||||
"embeds":[],
|
|
||||||
"reactions":[],
|
|
||||||
"pinned":false,
|
|
||||||
"type":0,
|
|
||||||
"flags":null
|
|
||||||
}"#;
|
|
||||||
let message: super::Message = serde_json::from_str(raw).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -96,7 +96,7 @@ pub struct ChannelUnreadUpdate {
|
||||||
pub struct ChannelUnreadUpdateObject {
|
pub struct ChannelUnreadUpdateObject {
|
||||||
pub id: Snowflake,
|
pub id: Snowflake,
|
||||||
pub last_message_id: Snowflake,
|
pub last_message_id: Snowflake,
|
||||||
pub last_pin_timestamp: Option<String>,
|
pub last_pin_timestamp: Option<DateTime<Utc>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Deserialize, Serialize, Clone, JsonField, SourceUrlField, WebSocketEvent)]
|
#[derive(Debug, Default, Deserialize, Serialize, Clone, JsonField, SourceUrlField, WebSocketEvent)]
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::NaiveDate;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use crate::types::utils::serde::ts_seconds_option_str;
|
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
|
@ -15,8 +14,8 @@ pub struct RegisterSchema {
|
||||||
pub email: Option<String>,
|
pub email: Option<String>,
|
||||||
pub fingerprint: Option<String>,
|
pub fingerprint: Option<String>,
|
||||||
pub invite: Option<String>,
|
pub invite: Option<String>,
|
||||||
#[serde(with = "ts_seconds_option_str")]
|
/// The user's date of birth, serialized as an ISO8601 date
|
||||||
pub date_of_birth: Option<DateTime<Utc>>,
|
pub date_of_birth: Option<NaiveDate>,
|
||||||
pub gift_code_sku_id: Option<String>,
|
pub gift_code_sku_id: Option<String>,
|
||||||
pub captcha_key: Option<String>,
|
pub captcha_key: Option<String>,
|
||||||
pub promotional_email_opt_in: Option<bool>,
|
pub promotional_email_opt_in: Option<bool>,
|
||||||
|
|
|
@ -2,13 +2,16 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use chrono::DateTime;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use chorus::types::{LoginSchema, RegisterSchema};
|
use chorus::types::{LoginSchema, RegisterSchema};
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
|
use chrono::NaiveDate;
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
@ -17,7 +20,7 @@ async fn test_registration() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let reg = RegisterSchema {
|
let reg = RegisterSchema {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
|
date_of_birth: Some(NaiveDate::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
@ -33,7 +36,7 @@ async fn test_login() {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
email: Some("testuser1@integrationtesting.xyz".into()),
|
email: Some("testuser1@integrationtesting.xyz".into()),
|
||||||
password: Some("Correct-Horse-Battery-Staple1".into()),
|
password: Some("Correct-Horse-Battery-Staple1".into()),
|
||||||
date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
|
date_of_birth: Some(NaiveDate::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
@ -55,7 +58,7 @@ async fn test_wrong_login() {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
email: Some("testuser2@integrationtesting.xyz".into()),
|
email: Some("testuser2@integrationtesting.xyz".into()),
|
||||||
password: Some("Correct-Horse-Battery-Staple1".into()),
|
password: Some("Correct-Horse-Battery-Staple1".into()),
|
||||||
date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
|
date_of_birth: Some(NaiveDate::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use chrono::DateTime;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use chorus::gateway::Gateway;
|
use chorus::gateway::Gateway;
|
||||||
use chorus::types::IntoShared;
|
use chorus::types::IntoShared;
|
||||||
use chorus::{
|
use chorus::{
|
||||||
|
@ -14,6 +15,8 @@ use chorus::{
|
||||||
UrlBundle,
|
UrlBundle,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use chrono::NaiveDate;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct TestBundle {
|
pub(crate) struct TestBundle {
|
||||||
|
@ -31,7 +34,7 @@ impl TestBundle {
|
||||||
let register_schema = RegisterSchema {
|
let register_schema = RegisterSchema {
|
||||||
username: username.to_string(),
|
username: username.to_string(),
|
||||||
consent: true,
|
consent: true,
|
||||||
date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
|
date_of_birth: Some(NaiveDate::from_str("2000-01-01").unwrap()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
self.instance
|
self.instance
|
||||||
|
@ -61,7 +64,7 @@ pub(crate) async fn setup() -> TestBundle {
|
||||||
let reg = RegisterSchema {
|
let reg = RegisterSchema {
|
||||||
username: "integrationtestuser".into(),
|
username: "integrationtestuser".into(),
|
||||||
consent: true,
|
consent: true,
|
||||||
date_of_birth: Some(DateTime::from_timestamp(978325200, 0).unwrap()),
|
date_of_birth: Some(NaiveDate::from_str("2000-01-01").unwrap()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let guild_create_schema = GuildCreateSchema {
|
let guild_create_schema = GuildCreateSchema {
|
||||||
|
|
Loading…
Reference in New Issue