@@ -589,4 +589,88 @@ if [[ "$FAIL" -eq "$_fail_before_yye" ]]; then
589589 echo " test_yaml_yml_extension ... PASS"
590590fi
591591
592+ # ── .claude/dso-config.conf resolution tests ─────────────────────────────────
593+ # These tests assert the new resolution behavior: read-config.sh should resolve
594+ # from .claude/dso-config.conf in the git root (not workflow-config.conf).
595+ # These tests are RED (failing) until the implementation task dso-opue runs.
596+
597+ # ── test_resolves_from_dot_claude_dso_config_conf ─────────────────────────────
598+ # Given a temp git repo with .claude/dso-config.conf (no workflow-config.conf),
599+ # read-config.sh reads config from .claude/dso-config.conf.
600+ _fail_before_rdcd=$FAIL
601+ _tmp_repo_rdcd=" $( mktemp -d) "
602+ git -C " $_tmp_repo_rdcd " init -q
603+ mkdir -p " $_tmp_repo_rdcd /.claude"
604+ cat > " $_tmp_repo_rdcd /.claude/dso-config.conf" << 'CONF '
605+ test_command=make test-dso
606+ CONF
607+ rdcd_exit=0
608+ rdcd_output=" "
609+ rdcd_output=$(
610+ cd " $_tmp_repo_rdcd " && \
611+ unset WORKFLOW_CONFIG_FILE 2> /dev/null; \
612+ unset CLAUDE_PLUGIN_ROOT 2> /dev/null; \
613+ bash " $SCRIPT " " test_command" 2>&1
614+ ) || rdcd_exit=$?
615+ assert_eq " test_resolves_from_dot_claude_dso_config_conf: exit 0" " 0" " $rdcd_exit "
616+ assert_eq " test_resolves_from_dot_claude_dso_config_conf: reads from .claude/dso-config.conf" " make test-dso" " $rdcd_output "
617+ if [[ " $FAIL " -eq " $_fail_before_rdcd " ]]; then
618+ echo " test_resolves_from_dot_claude_dso_config_conf ... PASS"
619+ fi
620+ rm -rf " $_tmp_repo_rdcd "
621+
622+ # ── test_no_fallback_to_workflow_config_conf ──────────────────────────────────
623+ # Given a temp git repo with only workflow-config.conf at root (no
624+ # .claude/dso-config.conf), read-config.sh returns empty string, exit 0
625+ # (no fallback to old path).
626+ _fail_before_nfwc=$FAIL
627+ _tmp_repo_nfwc=" $( mktemp -d) "
628+ git -C " $_tmp_repo_nfwc " init -q
629+ cat > " $_tmp_repo_nfwc /workflow-config.conf" << 'CONF '
630+ test_command=make test-old
631+ CONF
632+ nfwc_exit=0
633+ nfwc_output=" "
634+ nfwc_output=$(
635+ cd " $_tmp_repo_nfwc " && \
636+ unset WORKFLOW_CONFIG_FILE 2> /dev/null; \
637+ unset CLAUDE_PLUGIN_ROOT 2> /dev/null; \
638+ bash " $SCRIPT " " test_command" 2>&1
639+ ) || nfwc_exit=$?
640+ assert_eq " test_no_fallback_to_workflow_config_conf: exit 0" " 0" " $nfwc_exit "
641+ assert_eq " test_no_fallback_to_workflow_config_conf: empty output (no fallback)" " " " $nfwc_output "
642+ if [[ " $FAIL " -eq " $_fail_before_nfwc " ]]; then
643+ echo " test_no_fallback_to_workflow_config_conf ... PASS"
644+ fi
645+ rm -rf " $_tmp_repo_nfwc "
646+
647+ # ── test_workflow_config_file_env_still_works ─────────────────────────────────
648+ # WORKFLOW_CONFIG_FILE env var still overrides all resolution (backward compat
649+ # for test isolation).
650+ _fail_before_wcfe=$FAIL
651+ _tmp_repo_wcfe=" $( mktemp -d) "
652+ git -C " $_tmp_repo_wcfe " init -q
653+ mkdir -p " $_tmp_repo_wcfe /.claude"
654+ # .claude/dso-config.conf exists but should NOT be used — env var wins
655+ cat > " $_tmp_repo_wcfe /.claude/dso-config.conf" << 'CONF '
656+ test_command=make test-from-dso-config
657+ CONF
658+ _wcfe_override_file=" $( mktemp) "
659+ cat > " $_wcfe_override_file " << 'CONF '
660+ test_command=make test-from-env-override
661+ CONF
662+ wcfe_exit=0
663+ wcfe_output=" "
664+ wcfe_output=$(
665+ cd " $_tmp_repo_wcfe " && \
666+ WORKFLOW_CONFIG_FILE=" $_wcfe_override_file " bash " $SCRIPT " " test_command" 2>&1
667+ ) || wcfe_exit=$?
668+ assert_eq " test_workflow_config_file_env_still_works: exit 0" " 0" " $wcfe_exit "
669+ assert_eq " test_workflow_config_file_env_still_works: env var overrides .claude/dso-config.conf" " make test-from-env-override" " $wcfe_output "
670+ if [[ " $FAIL " -eq " $_fail_before_wcfe " ]]; then
671+ echo " test_workflow_config_file_env_still_works ... PASS"
672+ fi
673+ rm -rf " $_tmp_repo_wcfe "
674+ rm -f " $_wcfe_override_file "
675+
592676print_summary
0 commit comments