Skip to content

Commit

Permalink
rm out of scope tests and testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav committed Jan 31, 2024
1 parent 46a5828 commit c3125f3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 104 deletions.
60 changes: 0 additions & 60 deletions pkg/engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
24 changes: 0 additions & 24 deletions pkg/engine/testdata/mixed_secrets.txt

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/engine/testdata/verified_canary_secrets.txt

This file was deleted.

0 comments on commit c3125f3

Please sign in to comment.