CI: Add a test with no-default-features and ensure it passes

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-08-17 22:29:04 +02:00
parent 34467dd4a6
commit 2e3004f89e
3 changed files with 9 additions and 2 deletions

View file

@ -29,7 +29,8 @@ variables:
.test:
stage: test
script:
- cargo test --verbose
- cargo test --verbose --release -- --include-ignored
- cargo test --verbose --no-default-features
rustfmt:
stage: lint

View file

@ -25,6 +25,10 @@ tokio-util = { version = "0.7", features = ["codec"] }
[dev-dependencies]
env_logger = "0.10"
[[example]]
name = "hello_bot"
required-features = ["avatar"]
[features]
default = ["avatars"]
avatars = []

View file

@ -576,9 +576,11 @@ mod tests {
.set_client(ClientType::Bot, "xmpp-rs")
.set_website("https://gitlab.com/xmpp-rs/xmpp-rs")
.set_default_nick("bot")
.enable_feature(ClientFeature::Avatars)
.enable_feature(ClientFeature::ContactList);
#[cfg(feature = "avatars")]
let client_builder = client_builder.enable_feature(ClientFeature::Avatars);
let mut agent: Agent = client_builder.build_impl(client);
while let Some(events) = agent.wait_for_events().await {