MCPcopy Create free account
hub / github.com/github/gh-aw / TestDetectRuntimeFromCommand_GhAw

Function TestDetectRuntimeFromCommand_GhAw

pkg/workflow/runtime_gh_aw_test.go:46–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func 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
79func TestGetDomainsFromRuntimes_GhAw(t *testing.T) {
80 domains := getDomainsFromRuntimes(map[string]any{

Callers

nothing calls this directly

Calls 6

IsReleaseFunction · 0.85
SetVersionFunction · 0.85
SetIsReleaseFunction · 0.85
detectRuntimeFromCommandFunction · 0.85
GetVersionFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected