Skip to content

Commit

Permalink
fix(lint): adjust drift in lint options from makefile to gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tembleking committed Dec 19, 2024
1 parent c152fac commit f5176d3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"

lint:
golangci-lint run --timeout 1h ./...
golangci-lint run --timeout 1h --build-tags unit,tf_acc_sysdig_monitor,tf_acc_sysdig_secure,tf_acc_ibm_monitor,tf_acc_ibm_secure ./...

errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"
Expand Down
16 changes: 16 additions & 0 deletions sysdig/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"os"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
)

const (
Expand All @@ -29,3 +31,17 @@ func preCheckAnyEnv(t *testing.T, envs ...string) func() {
}
}
}

func sysdigOrIBMMonitorPreCheck(t *testing.T) func() {
return func() {
monitor := os.Getenv("SYSDIG_MONITOR_API_TOKEN")
ibmMonitor := os.Getenv("SYSDIG_IBM_MONITOR_API_KEY")
if monitor == "" && ibmMonitor == "" {
t.Fatal("SYSDIG_MONITOR_API_TOKEN or SYSDIG_IBM_MONITOR_API_KEY must be set for acceptance tests")
}
}
}

func randomText(len int) string {
return acctest.RandStringFromCharSet(len, acctest.CharSetAlphaNum)
}
28 changes: 28 additions & 0 deletions sysdig/resource_sysdig_monitor_team_shared_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package sysdig_test

import "fmt"

func monitorTeamMinimumConfiguration(name string) string {
return fmt.Sprintf(`
resource "sysdig_monitor_team" "sample" {
name = "sample-%s"
entrypoint {
type = "Explore"
}
}`, name)
}

func monitorTeamWithName(name string) string {
return fmt.Sprintf(`
resource "sysdig_monitor_team" "sample" {
name = "sample-%s"
description = "%s"
scope_by = "container"
filter = "container.image.repo = \"sysdig/agent\""
entrypoint {
type = "Explore"
}
}`, name, name)
}

0 comments on commit f5176d3

Please sign in to comment.