mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-21 01:21:21 +00:00
Add feature-flags to exclude some integration tests.
This reduces the number of external services that must be running to succesful run 'cargo test'. In this case one the requirements that ChirpStack has must be present and there is no need to run local Kafka and RabbitMQ instances. These integrations can still be tested using the 'test-all-integrations' feature flag (which is included in the CI workflow).
This commit is contained in:
parent
2184e4eaa5
commit
b263b86675
7
Makefile
7
Makefile
@ -60,3 +60,10 @@ test:
|
||||
cd chirpstack && make test
|
||||
cd lrwn && make test
|
||||
cd lrwn-filters && make test
|
||||
|
||||
# Runs all the tests (including some that normally are ignored)
|
||||
test-all:
|
||||
cd backend && cargo test
|
||||
cd chirpstack && make test-all
|
||||
cd lrwn && make test
|
||||
cd lrwn-filters && make test
|
||||
|
@ -134,6 +134,12 @@ httpmock = "0.6"
|
||||
bytes = "1.4"
|
||||
dotenv = "0.15"
|
||||
|
||||
[features]
|
||||
test-all-integrations = ["test-integration-amqp", "test-integration-kafka", "test-integration-mqtt"]
|
||||
test-integration-amqp = []
|
||||
test-integration-kafka = []
|
||||
test-integration-mqtt = []
|
||||
|
||||
# Debian packaging.
|
||||
[package.metadata.deb]
|
||||
assets = [
|
||||
|
@ -42,3 +42,8 @@ test:
|
||||
cargo fmt --check
|
||||
cargo clippy --no-deps
|
||||
cargo test
|
||||
|
||||
test-all:
|
||||
cargo fmt --check
|
||||
cargo clippy --no-deps
|
||||
cargo test --features test-all-integrations
|
@ -242,7 +242,7 @@ impl<'a> IntegrationTrait for Integration<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, feature = "test-integration-amqp"))]
|
||||
pub mod test {
|
||||
use std::env;
|
||||
|
||||
|
@ -221,7 +221,7 @@ impl<'a> IntegrationTrait for Integration<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, feature = "test-integration-kafka"))]
|
||||
pub mod test {
|
||||
use std::env;
|
||||
|
||||
|
@ -435,7 +435,7 @@ async fn message_callback(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, feature = "test-integration-mqtt"))]
|
||||
pub mod test {
|
||||
use std::env;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user