mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
ci(deps): fix tenv in ".*_test.go$" (#6748)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -112,7 +112,6 @@ issues:
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- tenv
|
||||
- unused
|
||||
- linters:
|
||||
- gosec
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package pom
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -87,8 +86,7 @@ func Test_evaluateVariable(t *testing.T) {
|
||||
}
|
||||
|
||||
envName := "TEST_GO_DEP_PARSER"
|
||||
os.Setenv(envName, "1.2.3")
|
||||
defer os.Unsetenv(envName)
|
||||
t.Setenv(envName, "1.2.3")
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
@@ -22,7 +22,7 @@ func setupPodmanSock(t *testing.T) *httptest.Server {
|
||||
runtimeDir, err := os.MkdirTemp("", "daemon")
|
||||
require.NoError(t, err)
|
||||
|
||||
os.Setenv("XDG_RUNTIME_DIR", runtimeDir)
|
||||
t.Setenv("XDG_RUNTIME_DIR", runtimeDir)
|
||||
|
||||
dir := filepath.Join(runtimeDir, "podman")
|
||||
err = os.MkdirAll(dir, os.ModePerm)
|
||||
|
||||
@@ -330,7 +330,7 @@ exception[rules] {
|
||||
|
||||
func Test_RegoScanning_WithRuntimeValues(t *testing.T) {
|
||||
|
||||
_ = os.Setenv("DEFSEC_RUNTIME_VAL", "AOK")
|
||||
t.Setenv("DEFSEC_RUNTIME_VAL", "AOK")
|
||||
|
||||
srcFS := CreateFS(t, map[string]string{
|
||||
"policies/test.rego": `
|
||||
|
||||
@@ -3,7 +3,6 @@ package report_test
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -168,7 +167,7 @@ func TestReportWriter_Template(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := clock.With(context.Background(), time.Date(2020, 8, 10, 7, 28, 17, 958601, time.UTC))
|
||||
|
||||
os.Setenv("AWS_ACCOUNT_ID", "123456789012")
|
||||
t.Setenv("AWS_ACCOUNT_ID", "123456789012")
|
||||
got := bytes.Buffer{}
|
||||
inputReport := types.Report{
|
||||
Results: types.Results{
|
||||
|
||||
Reference in New Issue
Block a user