Skip to content

Find, verify, and analyze leaked credentials

Fix integration tests (#2970)

Cody Rose15719c2c4f18
diff --git a/pkg/detectors/multi_part_credential_provider_test.go b/pkg/detectors/multi_part_credential_provider_test.go
index a27ce141b..ddc9cb045 100644
--- a/pkg/detectors/multi_part_credential_provider_test.go
+++ b/pkg/detectors/multi_part_credential_provider_test.go
@@ -25,6 +25,7 @@ func TestMultiPartCredentialProviders(t *testing.T) {
}
for _, tc := range testCases {
+ tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
diff --git a/pkg/engine/filesystem_integration_test.go b/pkg/engine/filesystem_integration_test.go
index f458c14c9..b95b31191 100644
--- a/pkg/engine/filesystem_integration_test.go
+++ b/pkg/engine/filesystem_integration_test.go
@@ -61,11 +61,13 @@ func TestFilesystem(t *testing.T) {
// Run the scan.
ctx := context.Background()
- e, err := Start(ctx,
- WithDetectors(DefaultDetectors()...),
- WithVerify(false),
- )
+ e, err := NewEngine(ctx, &Config{
+ Detectors: DefaultDetectors(),
+ SourceManager: sources.NewManager(),
+ Verify: false,
+ })
assert.NoError(t, err)
+ e.Start(ctx)
err = e.ScanFileSystem(ctx, sources.FilesystemConfig{
Paths: []string{rootDir},
ExcludePathsFile: filepath.Join(configDir, "exclude"),
diff --git a/pkg/engine/gitlab_integration_test.go b/pkg/engine/gitlab_integration_test.go
index dbd45ea43..b2b026edd 100644
--- a/pkg/engine/gitlab_integration_test.go
+++ b/pkg/engine/gitlab_integration_test.go
@@ -16,11 +16,13 @@ import (
func TestGitLab(t *testing.T) {
// Run the scan.
ctx := context.Background()
- e, err := Start(ctx,
- WithDetectors(DefaultDetectors()...),
- WithVerify(false),
- )
+ e, err := NewEngine(ctx, &Config{
+ Detectors: DefaultDetectors(),
+ SourceManager: sources.NewManager(),
+ Verify: false,
+ })
assert.NoError(t, err)
+ e.Start(ctx)
secret, err := common.GetTestSecret(ctx)
if err != nil {