@@ -38,7 +38,7 @@ import (
3838 "github.com/snyk/code-client-go/scan"
3939)
4040
41- func TestSmoke_Scan_HTTPS (t * testing.T ) {
41+ func TestSmoke_Scan_IDE (t * testing.T ) {
4242 var cloneTargetDir , err = testutil .SetupCustomTestRepo (t , "https://github.com/snyk-labs/nodejs-goof" , "0336589" , "" , "" )
4343 assert .NoError (t , err )
4444
@@ -88,7 +88,7 @@ func TestSmoke_Scan_HTTPS(t *testing.T) {
8888 require .NotNil (t , response .Sarif .Runs [0 ].Results [0 ].Locations [0 ].PhysicalLocation .ArtifactLocation .URI )
8989}
9090
91- func Test_SmokeScan_HTTPS_CLI (t * testing.T ) {
91+ func Test_SmokeScan_CLI (t * testing.T ) {
9292 var cloneTargetDir , err = testutil .SetupCustomTestRepo (t , "https://github.com/snyk-labs/nodejs-goof" , "0336589" , "" , "" )
9393 assert .NoError (t , err )
9494
@@ -142,51 +142,6 @@ func Test_SmokeScan_HTTPS_CLI(t *testing.T) {
142142 require .NotNil (t , response .Sarif .Runs [0 ].Results [0 ].Locations [0 ].PhysicalLocation .ArtifactLocation .URI )
143143}
144144
145- func TestSmoke_Scan_SSH (t * testing.T ) {
146- var cloneTargetDir ,
err = testutil .
SetupCustomTestRepo (
t ,
"[email protected] :snyk-labs/nodejs-goof" ,
"0336589" ,
"" ,
"" )
147- assert .NoError (t , err )
148-
149- target , err := scan .NewRepositoryTarget (cloneTargetDir )
150- assert .NoError (t , err )
151-
152- files := sliceToChannel ([]string {filepath .Join (cloneTargetDir , "app.js" ), filepath .Join (cloneTargetDir , "utils.js" )})
153-
154- logger := zerolog .New (os .Stdout )
155- instrumentor := testutil .NewTestInstrumentor ()
156- errorReporter := testutil .NewTestErrorReporter ()
157- config := testutil .NewTestConfig ()
158- httpClient := codeClientHTTP .NewHTTPClient (
159- func () * http.Client {
160- client := http.Client {
161- Timeout : time .Duration (180 ) * time .Second ,
162- Transport : testutil.TestAuthRoundTripper {http .DefaultTransport },
163- }
164- return & client
165- },
166- codeClientHTTP .WithRetryCount (3 ),
167- codeClientHTTP .WithLogger (& logger ),
168- )
169- trackerFactory := scan .NewNoopTrackerFactory ()
170-
171- codeScanner := codeClient .NewCodeScanner (
172- config ,
173- httpClient ,
174- codeClient .WithTrackerFactory (trackerFactory ),
175- codeClient .WithInstrumentor (instrumentor ),
176- codeClient .WithErrorReporter (errorReporter ),
177- codeClient .WithLogger (& logger ),
178- )
179-
180- // let's have a requestID that does not change
181- span := instrumentor .StartSpan (context .Background (), "UploadAndAnalyze" )
182- defer span .Finish ()
183-
184- response , bundleHash , scanErr := codeScanner .UploadAndAnalyze (span .Context (), uuid .New ().String (), target , files , map [string ]bool {})
185- require .NoError (t , scanErr )
186- require .NotEmpty (t , bundleHash )
187- require .NotNil (t , response )
188- }
189-
190145func TestSmoke_Scan_SubFolder (t * testing.T ) {
191146 currDir , err := os .Getwd ()
192147 require .NoError (t , err )
0 commit comments