Skip to content

Commit 3aac181

Browse files
author
sfang97
committed
Change isRunningInEE test
1 parent 52ed810 commit 3aac181

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

gitlab/helper_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,8 @@ func testAccIsSkippedAttribute(needle string, haystack []string) bool {
4343
// Returns true if the acceptance test is running Gitlab EE.
4444
// Meant to be used as SkipFunc to skip tests that work only on Gitlab CE.
4545
func isRunningInEE() (bool, error) {
46-
if conn, ok := testAccProvider.Meta().(*gitlab.Client); ok {
47-
version, _, err := conn.Version.GetVersion()
48-
if err != nil {
49-
return false, err
50-
}
51-
if strings.Contains(version.String(), "-ee") {
52-
return true, nil
53-
}
54-
} else {
55-
return false, errors.New("Provider not initialized, unable to get GitLab connection")
46+
if v := os.Getenv("GITLAB_LICENSE_FILE"); len(v) > 0 {
47+
return true, nil
5648
}
5749
return false, nil
5850
}

0 commit comments

Comments
 (0)