Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(deps): bump tinyflows to 0.8.17 and add cron import tests

Steven Enamakelfc1217b0a5f9
diff --git a/Cargo.lock b/Cargo.lock
index 2050dbb39c..86719c1444 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -152,7 +152,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -163,7 +163,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -838,7 +838,7 @@ dependencies = [
"cap-primitives",
"cap-std",
"io-lifetimes 3.0.1",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -855,7 +855,7 @@ dependencies = [
"maybe-owned",
"rustix 1.1.5",
"rustix-linux-procfs",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
"winx",
]
@@ -1774,7 +1774,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -2011,7 +2011,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -4166,7 +4166,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -5624,7 +5624,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -6194,7 +6194,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -6263,7 +6263,7 @@ dependencies = [
"security-framework 3.7.0",
"security-framework-sys",
"webpki-root-certs",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -6883,7 +6883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -7222,7 +7222,7 @@ dependencies = [
"getrandom 0.3.4",
"once_cell",
"rustix 1.1.5",
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -7235,7 +7235,7 @@ dependencies = [
"parking_lot",
"rustix 1.1.5",
"signal-hook",
- "windows-sys 0.61.2",
+ "windows-sys 0.60.2",
]
[[package]]
@@ -7783,7 +7783,7 @@ dependencies = [
[[package]]
name = "tinyflows"
-version = "0.8.16"
+version = "0.8.17"
dependencies = [
"async-trait",
"futures-timer",
@@ -9707,7 +9707,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
- "windows-sys 0.61.2",
+ "windows-sys 0.52.0",
]
[[package]]
diff --git a/crates/openhuman-core/src/storage/import/tinyflows.rs b/crates/openhuman-core/src/storage/import/tinyflows.rs
index 726704d375..f3d269d1cf 100644
--- a/crates/openhuman-core/src/storage/import/tinyflows.rs
+++ b/crates/openhuman-core/src/storage/import/tinyflows.rs
@@ -296,3 +296,7 @@ pub(super) fn finish(domain: &'static str, outcome: Result<Outcome>) -> Report {
#[cfg(all(test, feature = "flows"))]
#[path = "tinyflows_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "tinyflows_cron_tests.rs"]
+mod cron_tests;
diff --git a/crates/openhuman-core/src/storage/import/tinyflows_cron_tests.rs b/crates/openhuman-core/src/storage/import/tinyflows_cron_tests.rs
new file mode 100644
index 0000000000..2dccce1330
--- /dev/null
+++ b/crates/openhuman-core/src/storage/import/tinyflows_cron_tests.rs
@@ -0,0 +1,46 @@
+use super::*;
+use crate::storage::MemoryStorage;
+use tinyflows_drivers::schedule::CronDocuments;
+
+fn copy_tree(from: &Path, to: &Path) {
+ std::fs::create_dir_all(to).unwrap();
+ for entry in std::fs::read_dir(from).unwrap() {
+ let entry = entry.unwrap();
+ let target = to.join(entry.file_name());
+ if entry.path().is_dir() {
+ copy_tree(&entry.path(), &target);
+ } else {
+ std::fs::copy(entry.path(), target).unwrap();
+ }
+ }
+}
+
+/// The cron importer rides the `schedule` reader alone, so `run_with` keeps the
+/// legacy cron jobs in a build without `flows` too (it used to log and skip).
+#[test]
+fn run_with_imports_legacy_cron_jobs_whatever_the_flows_gate() {
+ let dir = tempfile::TempDir::new().unwrap();
+ let fixtures = Path::new(env!("CARGO_MANIFEST_DIR")).join("src/storage/import/fixtures/tinyflows/workspace");
+ copy_tree(&fixtures, dir.path());
+ let config = Config {
+ workspace_dir: dir.path().to_path_buf(),
+ ..Config::default()
+ };
+ let backend: Arc<dyn StorageBackend> = Arc::new(MemoryStorage::new());
+
+ let reports = run_with(&backend, &config);
+ let cron = reports
+ .iter()
+ .find(|report| report.domain == CRON_DOMAIN)
+ .expect("a cron report");
+ match cron.outcome.as_ref().unwrap() {
+ Outcome::Imported { written, .. } => assert!(*written > 0),
+ other => panic!("expected the cron jobs to import, got {other:?}"),
+ }
+ let docs = Arc::clone(backend.for_scope(&Scope::local()).unwrap().documents());
+ let jobs = crate::storage::block_on_anyhow(async move {
+ CronDocuments::new(docs).list_jobs().await.map_err(Into::into)
+ })
+ .unwrap();
+ assert!(!jobs.is_empty());
+}