Skip to content

Commit f5176d3

Browse files
committed
fix(lint): adjust drift in lint options from makefile to gh actions
1 parent c152fac commit f5176d3

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fmtcheck:
6666
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
6767

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

7171
errcheck:
7272
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

sysdig/common_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"os"
55
"strings"
66
"testing"
7+
8+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
79
)
810

911
const (
@@ -29,3 +31,17 @@ func preCheckAnyEnv(t *testing.T, envs ...string) func() {
2931
}
3032
}
3133
}
34+
35+
func sysdigOrIBMMonitorPreCheck(t *testing.T) func() {
36+
return func() {
37+
monitor := os.Getenv("SYSDIG_MONITOR_API_TOKEN")
38+
ibmMonitor := os.Getenv("SYSDIG_IBM_MONITOR_API_KEY")
39+
if monitor == "" && ibmMonitor == "" {
40+
t.Fatal("SYSDIG_MONITOR_API_TOKEN or SYSDIG_IBM_MONITOR_API_KEY must be set for acceptance tests")
41+
}
42+
}
43+
}
44+
45+
func randomText(len int) string {
46+
return acctest.RandStringFromCharSet(len, acctest.CharSetAlphaNum)
47+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package sysdig_test
2+
3+
import "fmt"
4+
5+
func monitorTeamMinimumConfiguration(name string) string {
6+
return fmt.Sprintf(`
7+
resource "sysdig_monitor_team" "sample" {
8+
name = "sample-%s"
9+
10+
entrypoint {
11+
type = "Explore"
12+
}
13+
}`, name)
14+
}
15+
16+
func monitorTeamWithName(name string) string {
17+
return fmt.Sprintf(`
18+
resource "sysdig_monitor_team" "sample" {
19+
name = "sample-%s"
20+
description = "%s"
21+
scope_by = "container"
22+
filter = "container.image.repo = \"sysdig/agent\""
23+
24+
entrypoint {
25+
type = "Explore"
26+
}
27+
}`, name, name)
28+
}

0 commit comments

Comments
 (0)