Skip to content

Commit

Permalink
cfg(test) does not apply to integration tests, we specify a separate …
Browse files Browse the repository at this point in the history
…feature to make it work
  • Loading branch information
Lun4m committed Jun 24, 2024
1 parent 3ce2acc commit 628c795
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ingestion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name = "lard_ingestion"
version = "0.1.0"
edition.workspace = true

[features]
integration_tests = []

[dependencies]
axum.workspace = true
bb8.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions ingestion/src/kldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,8 @@ pub async fn filter_and_label_kldata(
param_id.to_owned(),
)? {
// TODO: log that the timeseries is closed? Mostly useful for tests
#[cfg(test)]
#[cfg(feature = "integration_tests")]
eprintln!("station {}: timeseries is closed", chunk.station_id);

continue;
}

Expand Down
3 changes: 1 addition & 2 deletions ingestion/src/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ pub struct ParamPermit {
permit_id: i32,
}

// Only used in tests
#[doc(hidden)]
#[cfg(feature = "integration_tests")]
impl ParamPermit {
pub fn new(type_id: i32, param_id: i32, permit_id: i32) -> ParamPermit {
ParamPermit {
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true

[dependencies]
lard_api = { path = "../api" }
lard_ingestion = { path = "../ingestion" }
lard_ingestion = { path = "../ingestion", features = ["integration_tests"] }
chrono.workspace = true
tokio.workspace = true
tokio-postgres.workspace = true
Expand Down

0 comments on commit 628c795

Please sign in to comment.