Skip to content

Commit bac8edc

Browse files
authored
Merge pull request DeusData#2019 from CaptainMittens/test/cli-registry-plan-machine-independent
test(cli): stop the registry plan check depending on the developer's machine
2 parents f37a47e + ad04339 commit bac8edc

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎tests/test_cli.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6561,8 +6561,19 @@ TEST(cli_agent_client_registry_routes_plan_install_and_uninstall) {
65616561
char *plan = cbm_build_install_plan_json(tmpdir, binary_path);
65626562
yyjson_doc *plan_doc = plan ? yyjson_read(plan, strlen(plan), 0) : NULL;
65636563
yyjson_val *plan_root = plan_doc ? yyjson_doc_get_root(plan_doc) : NULL;
6564+
/* Neither of these agents has a plugin directory, so a planned path under
6565+
* one would be invented. Name the two directories rather than searching the
6566+
* whole plan for "/plugins/": OpenCode does ship a real plugin file, and
6567+
* agent detection finds a command in /usr/local/bin or /opt/homebrew/bin
6568+
* whatever HOME and PATH say, so a blanket search passes or fails according
6569+
* to what the developer happens to have installed. */
6570+
char qoder_plugins[700];
6571+
char pi_plugins[700];
6572+
snprintf(qoder_plugins, sizeof(qoder_plugins), "%s/plugins/", qoder_dir);
6573+
snprintf(pi_plugins, sizeof(pi_plugins), "%s/plugins/", pi_dir);
65646574
bool plan_ok =
6565-
plan && !strstr(plan, "/plugins/") && !strstr(plan, "plugin_files") &&
6575+
plan && !strstr(plan, qoder_plugins) && !strstr(plan, pi_plugins) &&
6576+
!strstr(plan, "plugin_files") &&
65666577
test_json_string_array_contains(plan_root, "config_files_planned", qoder_settings) &&
65676578
test_json_string_array_contains(plan_root, "config_files_planned", amazon_config) &&
65686579
test_json_string_array_contains(plan_root, "config_files_planned", roo_config) &&

0 commit comments

Comments
 (0)