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

Function TestGetAllEngineSecretNames

pkg/constants/constants_test.go:635–686  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

633}
634
635func TestGetAllEngineSecretNames(t *testing.T) {
636 secrets := GetAllEngineSecretNames()
637
638 // Should not be empty
639 if len(secrets) == 0 {
640 t.Error("GetAllEngineSecretNames() should not return empty slice")
641 }
642
643 // Build a set for easy lookup
644 secretSet := make(map[string]bool)
645 for _, s := range secrets {
646 secretSet[s] = true
647 }
648
649 // Verify primary engine secrets are included
650 expectedSecrets := []string{
651 "COPILOT_GITHUB_TOKEN",
652 "ANTHROPIC_API_KEY",
653 "OPENAI_API_KEY",
654 }
655
656 for _, expected := range expectedSecrets {
657 if !secretSet[expected] {
658 t.Errorf("GetAllEngineSecretNames() missing expected secret: %q", expected)
659 }
660 }
661
662 // Verify alternative secrets are included
663 alternativeSecrets := []string{
664 "CODEX_API_KEY",
665 }
666
667 for _, alt := range alternativeSecrets {
668 if !secretSet[alt] {
669 t.Errorf("GetAllEngineSecretNames() missing expected alternative secret: %q", alt)
670 }
671 }
672
673 // Verify system-level secret is included
674 if !secretSet["GH_AW_GITHUB_TOKEN"] {
675 t.Error("GetAllEngineSecretNames() missing GH_AW_GITHUB_TOKEN")
676 }
677
678 // Verify no duplicates
679 seen := make(map[string]bool)
680 for _, s := range secrets {
681 if seen[s] {
682 t.Errorf("GetAllEngineSecretNames() returned duplicate secret: %q", s)
683 }
684 seen[s] = true
685 }
686}
687
688func TestEngineOptions_MultiProviderAlternatives(t *testing.T) {
689 tests := []struct {

Callers

nothing calls this directly

Calls 3

GetAllEngineSecretNamesFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected