@@ -17,13 +17,12 @@ package codeclient_test
1717
1818import (
1919 "context"
20- "github.com/rs/zerolog"
2120 "os"
2221 "path/filepath"
2322 "testing"
24- "time"
2523
2624 "github.com/golang/mock/gomock"
25+ "github.com/rs/zerolog"
2726 "github.com/stretchr/testify/assert"
2827 "github.com/stretchr/testify/require"
2928
@@ -32,7 +31,6 @@ import (
3231 mocks2 "github.com/snyk/code-client-go/bundle/mocks"
3332 "github.com/snyk/code-client-go/deepcode"
3433 mocks3 "github.com/snyk/code-client-go/deepcode/mocks"
35- "github.com/snyk/code-client-go/observability"
3634 "github.com/snyk/code-client-go/observability/mocks"
3735)
3836
@@ -44,8 +42,6 @@ func Test_UploadAndAnalyze(t *testing.T) {
4442 firstDocPath : deepcode .BundleFileFrom (secondDocPath , secondDocContent ),
4543 }
4644
47- scanMetrics := observability .NewScanMetrics (time .Now (), 0 )
48-
4945 logger := zerolog .Nop ()
5046
5147 t .Run (
@@ -62,11 +58,10 @@ func Test_UploadAndAnalyze(t *testing.T) {
6258 mockBundleManager := mocks2 .NewMockBundleManager (ctrl )
6359 mockBundleManager .EXPECT ().Create (gomock .Any (), "testHost" , "testRequestId" , baseDir , gomock .Any (), map [string ]bool {}).Return (mockBundle , nil )
6460 mockBundleManager .EXPECT ().Upload (gomock .Any (), "testHost" , mockBundle , files ).Return (mockBundle , nil )
65- mockAnalytics := mocks .NewMockAnalytics (ctrl )
6661
67- codeScanner := codeclient .NewCodeScanner (mockBundleManager , mockInstrumentor , mockErrorReporter , mockAnalytics , & logger )
62+ codeScanner := codeclient .NewCodeScanner (mockBundleManager , mockInstrumentor , mockErrorReporter , & logger )
6863
69- response , bundle , err := codeScanner .UploadAndAnalyze (context .Background (), "testHost" , baseDir , docs , map [string ]bool {}, scanMetrics )
64+ response , bundle , err := codeScanner .UploadAndAnalyze (context .Background (), "testHost" , baseDir , docs , map [string ]bool {})
7065 require .NoError (t , err )
7166 assert .Equal (t , "" , bundle .GetBundleHash ())
7267 assert .Equal (t , files , bundle .GetFiles ())
@@ -88,12 +83,10 @@ func Test_UploadAndAnalyze(t *testing.T) {
8883 mockBundleManager := mocks2 .NewMockBundleManager (ctrl )
8984 mockBundleManager .EXPECT ().Create (gomock .Any (), "testHost" , "testRequestId" , baseDir , gomock .Any (), map [string ]bool {}).Return (mockBundle , nil )
9085 mockBundleManager .EXPECT ().Upload (gomock .Any (), "testHost" , mockBundle , files ).Return (mockBundle , nil )
91- mockAnalytics := mocks .NewMockAnalytics (ctrl )
92- mockAnalytics .EXPECT ().TrackScan (true , gomock .AssignableToTypeOf (observability.ScanMetrics {}))
9386
94- codeScanner := codeclient .NewCodeScanner (mockBundleManager , mockInstrumentor , mockErrorReporter , mockAnalytics , & logger )
87+ codeScanner := codeclient .NewCodeScanner (mockBundleManager , mockInstrumentor , mockErrorReporter , & logger )
9588
96- response , bundle , err := codeScanner .UploadAndAnalyze (context .Background (), "testHost" , baseDir , docs , map [string ]bool {}, scanMetrics )
89+ response , bundle , err := codeScanner .UploadAndAnalyze (context .Background (), "testHost" , baseDir , docs , map [string ]bool {})
9790 require .NoError (t , err )
9891 assert .Equal (t , "COMPLETE" , response .Status )
9992 assert .Equal (t , "testBundleHash" , bundle .GetBundleHash ())
0 commit comments