(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestDetectRuntimeFromCommand_GhAw(t *testing.T) { |
| 47 | originalVersion := GetVersion() |
| 48 | originalRelease := IsRelease() |
| 49 | t.Cleanup(func() { |
| 50 | SetVersion(originalVersion) |
| 51 | SetIsRelease(originalRelease) |
| 52 | }) |
| 53 | |
| 54 | t.Run("release build uses compiler version", func(t *testing.T) { |
| 55 | SetVersion("v9.9.9") |
| 56 | SetIsRelease(true) |
| 57 | |
| 58 | requirements := make(map[string]*RuntimeRequirement) |
| 59 | detectRuntimeFromCommand("gh aw add https://github.com/githubnext/agentics/blob/main/workflows/ci-doctor.md", requirements) |
| 60 | |
| 61 | req, ok := requirements["gh-aw"] |
| 62 | require.True(t, ok) |
| 63 | assert.Equal(t, "v9.9.9", req.Version) |
| 64 | }) |
| 65 | |
| 66 | t.Run("dev build uses current build version", func(t *testing.T) { |
| 67 | SetVersion("dev-build-sha") |
| 68 | SetIsRelease(false) |
| 69 | |
| 70 | requirements := make(map[string]*RuntimeRequirement) |
| 71 | detectRuntimeFromCommand("gh aw add https://github.com/githubnext/agentics/blob/main/workflows/ci-doctor.md", requirements) |
| 72 | |
| 73 | req, ok := requirements["gh-aw"] |
| 74 | require.True(t, ok) |
| 75 | assert.Equal(t, "dev-build-sha", req.Version) |
| 76 | }) |
| 77 | } |
| 78 | |
| 79 | func TestGetDomainsFromRuntimes_GhAw(t *testing.T) { |
| 80 | domains := getDomainsFromRuntimes(map[string]any{ |
nothing calls this directly
no test coverage detected