Skip to content

Commit 4f860ca

Browse files
test: stabilize sync destination coverage
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent 78099a0 commit 4f860ca

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

tests/sync_test.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,44 @@ fn test_sync_skills_fails_when_source_does_not_exist() {
9191
fn test_sync_skills_syncs_to_enabled_destinations() {
9292
let temp_dir = TempDir::new().unwrap();
9393
let skills_dir = temp_dir.path().join("skills");
94+
let claude_dest = temp_dir.path().join("claude-skills");
95+
let opencode_dest = temp_dir.path().join("opencode-skills");
9496
fs::create_dir_all(&skills_dir).unwrap();
9597

96-
let config = create_test_config(
98+
let mut config = create_test_config(
9799
Some(skills_dir.to_str().unwrap()),
98100
None,
99101
&[("claude", true), ("opencode", true)],
100102
);
103+
config.destinations.get_mut("claude").unwrap().skills_path = claude_dest;
104+
config.destinations.get_mut("opencode").unwrap().skills_path = opencode_dest;
101105

102106
let result = SyncManager::sync_skills(&config).unwrap();
103107

104-
// May get 1 or 2 successes depending on tool availability
105-
assert!(!result.successful.is_empty());
108+
assert_eq!(result.successful.len(), 2);
106109
}
107110

108111
#[test]
109112
fn test_sync_all_with_only_skills_source() {
110113
let temp_dir = TempDir::new().unwrap();
111114
let skills_dir = temp_dir.path().join("skills");
115+
let claude_dest = temp_dir.path().join("claude-skills");
112116
fs::create_dir_all(&skills_dir).unwrap();
113117

114118
// Create a test skill directory to sync
115119
let test_skill = skills_dir.join("test-skill");
116120
fs::create_dir_all(&test_skill).unwrap();
117121

118-
let config = create_test_config(
122+
let mut config = create_test_config(
119123
Some(skills_dir.to_str().unwrap()),
120124
None,
121125
&[("claude", true)],
122126
);
127+
config.destinations.get_mut("claude").unwrap().skills_path = claude_dest;
123128

124129
let result = SyncManager::sync_all(&config).unwrap();
125130

126-
// Should succeed (skills synced, commands skipped since not configured)
127-
assert!(!result.successful.is_empty());
131+
assert_eq!(result.successful.len(), 1);
128132
}
129133

130134
#[test]

0 commit comments

Comments
 (0)