Skip to content

Commit f0dcde4

Browse files
committed
Work around breaking change in test (new default parameter)
1 parent 5acbb58 commit f0dcde4

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/composite/godot/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ runs:
6868
if grep -q "Leaked instance" "${{ runner.temp }}/stdout.log"; then
6969
exit 1;
7070
fi;
71-
cargo build --features type-tag-fallback;
71+
cargo build --features type-tag-fallback ${{ inputs.rust_extra_args }}
7272
mkdir -p ./project/lib;
7373
cp ../target/debug/libgdnative_test.so ./project/lib/;
7474
${GODOT_BIN} --path ./project/ > >(tee "${{ runner.temp }}/stdout.log");

test/src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,16 @@ godot_itest! { test_from_instance_id {
214214

215215
assert!(unsafe { Node::try_from_instance_id(instance_id).is_none() });
216216

217-
let reconstructed = unsafe { Reference::from_instance_id(instance_id) };
218-
assert_eq!(
219-
"bar",
220-
String::from_variant(&reconstructed.get_meta("foo", Variant::nil())).unwrap()
221-
);
217+
// get_meta() got a new default parameter in Godot 3.5, which is a breaking change in Rust
218+
// So we cannot run this automated test for older Godot versions in CI
219+
#[cfg(not(feature = "custom-godot"))]
220+
{
221+
let reconstructed = unsafe { Reference::from_instance_id(instance_id) };
222+
assert_eq!(
223+
"bar",
224+
String::from_variant(&reconstructed.get_meta("foo", Variant::nil())).unwrap()
225+
);
226+
}
222227
}
223228

224229
assert!(unsafe { Reference::try_from_instance_id(instance_id).is_none() });

0 commit comments

Comments
 (0)