Skip to content

Commit ce02972

Browse files
committed
added test to verify parsing of all roles
1 parent 39df8df commit ce02972

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • rust/operator-binary/src/controller

rust/operator-binary/src/controller/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,3 +526,20 @@ impl HasUid for ValidatedCluster {
526526
self.uid.clone()
527527
}
528528
}
529+
530+
#[cfg(test)]
531+
mod tests {
532+
use strum::IntoEnumIterator;
533+
534+
use super::ValidatedCluster;
535+
use crate::crd::AirflowRole;
536+
537+
/// Locks the invariant behind the `expect` in [`ValidatedCluster::role_name`]: every
538+
/// `AirflowRole` variant (present and future) must serialise to a valid `RoleName`.
539+
#[test]
540+
fn every_airflow_role_serialises_to_a_valid_role_name() {
541+
for role in AirflowRole::iter() {
542+
ValidatedCluster::role_name(&role);
543+
}
544+
}
545+
}

0 commit comments

Comments
 (0)