Skip to content

E2E tests fail: repo sync doesn't read sync.sources from config #1

@hk9890

Description

@hk9890

E2E Tests Failing: repo sync doesn't read sync.sources from config

Problem

All E2E tests are failing with:

Error: no sync sources configured

Add sources using:
  aimgr repo add <source>

Even though the E2E config file (test/e2e/configs/e2e-test.yaml) has sync sources configured:

sync:
  sources:
    - url: "https://github.com/hk9890/ai-tools/tree/main/src"
    - url: "https://github.com/anthropics/skills"
    - url: "https://github.com/hk9890/opencode-coder/tree/main/ai-resources"

Root Cause

The repo sync command is not reading sync.sources from the config file passed via --config flag.

Tests call:

aimgr --config test/e2e/configs/e2e-test.yaml repo sync

But the sync command requires sources to be in ai.repo.yaml instead of reading from the global config.

Evidence

From test comment in test/e2e/sync_test.go:38:

// Note: We need to set AIMGR_REPO_PATH because sync command doesn't read repo.path from config yet

This suggests config reading in sync command is incomplete.

Impact

  • 7 E2E tests failing in CI
  • E2E tests cannot verify sync workflows
  • CI pipeline fails even though unit/integration tests pass

Failing Tests

  • TestE2E_PruneOnCleanRepo
  • TestE2E_PruneActuallyRemovesNothing
  • TestE2E_PruneOutputFormats
  • TestE2E_BasicReadOperations
  • TestE2E_RepoListFiltering
  • TestE2E_RepoShowInvalidID
  • TestE2E_SyncIdempotency

Expected Behavior

repo sync should read sync.sources from:

  1. Config file passed via --config flag
  2. Global config at ~/.config/aimgr/aimgr.yaml
  3. Environment variables (if applicable)

Workaround

None currently. Tests need to be rewritten to manually create ai.repo.yaml files before running sync.

Fix Required

Update cmd/repo_sync.go to:

  1. Load global config via config.LoadGlobal()
  2. Read sync.sources from loaded config
  3. Fall back to ai.repo.yaml if config has no sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions