Skip to content

Commit d4df063

Browse files
committed
test(versioned): Add snapshot test for scale argument
1 parent 55efb1c commit d4df063

3 files changed

Lines changed: 250 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
use stackable_versioned::versioned;
2+
// ---
3+
#[versioned(version(name = "v1alpha1"))]
4+
// ---
5+
pub(crate) mod versioned {
6+
#[versioned(crd(
7+
group = "stackable.tech",
8+
scale(
9+
spec_replicas_path = ".spec.replicas",
10+
status_replicas_path = ".status.replicas",
11+
label_selector_path = ".status.selector"
12+
)
13+
))]
14+
#[derive(
15+
Clone,
16+
Debug,
17+
serde::Deserialize,
18+
serde::Serialize,
19+
schemars::JsonSchema,
20+
kube::CustomResource,
21+
)]
22+
struct FooSpec {
23+
bar: usize,
24+
baz: bool,
25+
}
26+
}
27+
// ---
28+
fn main() {}

crates/stackable-versioned-macros/tests/snapshots/stackable_versioned_macros__snapshots__pass@scale.rs.snap

Lines changed: 221 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-versioned-macros/tests/trybuild.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ mod inputs {
3030
// mod module_preserve;
3131
// mod renamed_field;
3232
// mod renamed_kind;
33+
// mod scale;
3334
// mod shortnames;
3435
// mod submodule;
3536
}

0 commit comments

Comments
 (0)