This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 2672bd6 Issue #71 - Use `serial_test` for the test from issue #53
(#72)
2672bd6 is described below
commit 2672bd6e3827ed323698e4069c63c3d097e53ae5
Author: Martin Grigorov <[email protected]>
AuthorDate: Wed Dec 4 11:08:42 2024 +0200
Issue #71 - Use `serial_test` for the test from issue #53 (#72)
The test depends on Serde's is_human_readable() state
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
---
avro/src/de.rs | 4 ++--
avro/src/schema.rs | 7 +++++++
avro/src/ser.rs | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/avro/src/de.rs b/avro/src/de.rs
index cc590ea..7df963a 100644
--- a/avro/src/de.rs
+++ b/avro/src/de.rs
@@ -1449,7 +1449,7 @@ mod tests {
}
#[test]
- #[serial(avro_3747)]
+ #[serial(serde_is_human_readable)]
fn avro_3747_human_readable_false() -> TestResult {
use serde::de::Deserializer as SerdeDeserializer;
@@ -1464,7 +1464,7 @@ mod tests {
}
#[test]
- #[serial(avro_3747)]
+ #[serial(serde_is_human_readable)]
fn avro_3747_human_readable_true() -> TestResult {
use serde::de::Deserializer as SerdeDeserializer;
diff --git a/avro/src/schema.rs b/avro/src/schema.rs
index 343af0a..1289c82 100644
--- a/avro/src/schema.rs
+++ b/avro/src/schema.rs
@@ -2515,6 +2515,8 @@ mod tests {
TestResult,
};
use serde_json::json;
+ use serial_test::serial;
+ use std::sync::atomic::Ordering;
#[test]
fn test_invalid_schema() {
@@ -6444,6 +6446,7 @@ mod tests {
}
#[test]
+ #[serial(serde_is_human_readable)]
fn avro_rs_53_uuid_with_fixed() -> TestResult {
#[derive(Debug, Serialize, Deserialize)]
struct Comment {
@@ -6475,6 +6478,10 @@ mod tests {
id: "de2df598-9948-4988-b00a-a41c0e287398".parse()?,
};
let mut buffer = Vec::new();
+
+ let is_human_readable = true;
+ crate::util::SERDE_HUMAN_READABLE.store(is_human_readable,
Ordering::Release);
+
SpecificSingleObjectWriter::<Comment>::with_capacity(10)?
.write_ref(&payload, &mut buffer)?;
diff --git a/avro/src/ser.rs b/avro/src/ser.rs
index d497568..2d636fe 100644
--- a/avro/src/ser.rs
+++ b/avro/src/ser.rs
@@ -1021,7 +1021,7 @@ mod tests {
}
#[test]
- #[serial(avro_3747)]
+ #[serial(serde_is_human_readable)]
fn avro_3747_human_readable_false() {
use serde::ser::Serializer as SerdeSerializer;
@@ -1033,7 +1033,7 @@ mod tests {
}
#[test]
- #[serial(avro_3747)]
+ #[serial(serde_is_human_readable)]
fn avro_3747_human_readable_true() {
use serde::ser::Serializer as SerdeSerializer;