This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
gitgram-ai/aitimemachine/beads/cmd/bd/gitlab_integration_test.go
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

65 lines
1.9 KiB
Go

//go:build cgo && integration
// +build cgo,integration
// Package main provides the bd CLI commands.
package main
import (
"testing"
)
// TestGitLabConflictStrategiesIntegration tests conflict strategy selection.
func TestGitLabConflictStrategiesIntegration(t *testing.T) {
// Test prefer-newer strategy (default)
t.Run("PreferNewer", func(t *testing.T) {
strategy, err := getConflictStrategy(false, false, true)
if err != nil {
t.Fatalf("getConflictStrategy() error = %v", err)
}
if strategy != ConflictStrategyPreferNewer {
t.Errorf("strategy = %q, want %q", strategy, ConflictStrategyPreferNewer)
}
})
// Test prefer-local strategy
t.Run("PreferLocal", func(t *testing.T) {
strategy, err := getConflictStrategy(true, false, false)
if err != nil {
t.Fatalf("getConflictStrategy() error = %v", err)
}
if strategy != ConflictStrategyPreferLocal {
t.Errorf("strategy = %q, want %q", strategy, ConflictStrategyPreferLocal)
}
})
// Test prefer-gitlab strategy
t.Run("PreferGitLab", func(t *testing.T) {
strategy, err := getConflictStrategy(false, true, false)
if err != nil {
t.Fatalf("getConflictStrategy() error = %v", err)
}
if strategy != ConflictStrategyPreferGitLab {
t.Errorf("strategy = %q, want %q", strategy, ConflictStrategyPreferGitLab)
}
})
// Test default (no flags) returns prefer-newer
t.Run("DefaultIsPreferNewer", func(t *testing.T) {
strategy, err := getConflictStrategy(false, false, false)
if err != nil {
t.Fatalf("getConflictStrategy() error = %v", err)
}
if strategy != ConflictStrategyPreferNewer {
t.Errorf("strategy = %q, want %q (default)", strategy, ConflictStrategyPreferNewer)
}
})
// Test multiple flags returns error
t.Run("MultipleFlags", func(t *testing.T) {
_, err := getConflictStrategy(true, true, false)
if err == nil {
t.Error("Expected error for multiple conflicting flags")
}
})
}