From c3125f36c399afbccdefb126b2d8b7c329455fc1 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Wed, 31 Jan 2024 15:09:22 -0600 Subject: [PATCH] rm out of scope tests and testdata --- pkg/engine/engine_test.go | 60 ------------------- pkg/engine/testdata/mixed_secrets.txt | 24 -------- .../testdata/verified_canary_secrets.txt | 20 ------- 3 files changed, 104 deletions(-) delete mode 100644 pkg/engine/testdata/mixed_secrets.txt delete mode 100644 pkg/engine/testdata/verified_canary_secrets.txt diff --git a/pkg/engine/engine_test.go b/pkg/engine/engine_test.go index 9dd78f799f3d..2898ed0c7c88 100644 --- a/pkg/engine/engine_test.go +++ b/pkg/engine/engine_test.go @@ -215,66 +215,6 @@ func TestEngine_DuplicatSecrets(t *testing.T) { assert.Equal(t, want, e.GetMetrics().UnverifiedSecretsFound) } -func TestEngine_DuplicatVerifiedSecrets(t *testing.T) { - ctx := context.Background() - - absPath, err := filepath.Abs("./testdata/verified_canary_secrets.txt") - assert.Nil(t, err) - - ctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() - - e, err := Start(ctx, - WithConcurrency(1), - WithDecoders(decoders.DefaultDecoders()...), - WithDetectors(DefaultDetectors()...), - WithVerify(true), - WithPrinter(new(discardPrinter)), - ) - assert.Nil(t, err) - - cfg := sources.FilesystemConfig{Paths: []string{absPath}} - if err := e.ScanFileSystem(ctx, cfg); err != nil { - return - } - - // Wait for all the chunks to be processed. - assert.Nil(t, e.Finish(ctx)) - want := uint64(4) - assert.Equal(t, want, e.GetMetrics().VerifiedSecretsFound) -} - -func TestEngine_DuplicatVerifiedSecretsMultipleDetectors(t *testing.T) { - ctx := context.Background() - - absPath, err := filepath.Abs("./testdata/mixed_secrets.txt") - assert.Nil(t, err) - - ctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() - - e, err := Start(ctx, - WithConcurrency(1), - WithDecoders(decoders.DefaultDecoders()...), - WithDetectors(DefaultDetectors()...), - WithVerify(true), - WithPrinter(new(discardPrinter)), - ) - assert.Nil(t, err) - - cfg := sources.FilesystemConfig{Paths: []string{absPath}} - if err := e.ScanFileSystem(ctx, cfg); err != nil { - return - } - - // Wait for all the chunks to be processed. - assert.Nil(t, e.Finish(ctx)) - wantVerified := uint64(4) - wantUnverified := uint64(4) - assert.Equal(t, wantVerified, e.GetMetrics().VerifiedSecretsFound) - assert.Equal(t, wantUnverified, e.GetMetrics().UnverifiedSecretsFound) -} - func TestReverifcationChunk(t *testing.T) { ctx := context.Background() diff --git a/pkg/engine/testdata/mixed_secrets.txt b/pkg/engine/testdata/mixed_secrets.txt deleted file mode 100644 index 57e07e62a33a..000000000000 --- a/pkg/engine/testdata/mixed_secrets.txt +++ /dev/null @@ -1,24 +0,0 @@ -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 - sentry 27ac84f4bcdb4fca9701f4d6f6f58cd7d96b69c9d9754d40800645a51d668f90 - sentry 27ac84f4bcdb4fca9701f4d6f6f58cd7d96b69c9d9754d40800645a51d668f90 - sentry 27ac84f4bcdb4fca9701f4d6f6f58cd7d96b69c9d9754d40800645a51d668f90 - sentry 27ac84f4bcdb4fca9701f4d6f6f58cd7d96b69c9d9754d40800645a51d668f90 diff --git a/pkg/engine/testdata/verified_canary_secrets.txt b/pkg/engine/testdata/verified_canary_secrets.txt deleted file mode 100644 index 942d04ffd222..000000000000 --- a/pkg/engine/testdata/verified_canary_secrets.txt +++ /dev/null @@ -1,20 +0,0 @@ -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 -[default] -aws_access_key_id = AKIAQYLPMN5HFC4N7W75 -aws_secret_access_key = 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 -output = json -region = us-east-2 \ No newline at end of file