@@ -29,63 +29,63 @@ func TestCommand(t *testing.T) {
2929 // one specific supported sbom with vulns
3030 {
3131 Name : "folder of supported sbom with vulns" ,
32- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/sbom-insecure/" },
32+ Args : []string {"" , "source" , "./testdata/sbom-insecure/" },
3333 Exit : 1 ,
3434 },
3535 // one specific supported sbom with only unimportant
3636 {
3737 Name : "folder of supported sbom with only unimportant" ,
38- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/sbom-insecure/only-unimportant.spdx.json" },
38+ Args : []string {"" , "source" , "./testdata/sbom-insecure/only-unimportant.spdx.json" },
3939 Exit : 0 ,
4040 },
4141 // one specific supported sbom with only unimportant but with --all-vulns
4242 {
4343 Name : "folder of supported sbom with only unimportant" ,
44- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- all-vulns" , "./testdata/sbom-insecure/only-unimportant.spdx.json" },
44+ Args : []string {"" , "source" , "--all-vulns" , "./testdata/sbom-insecure/only-unimportant.spdx.json" },
4545 Exit : 1 ,
4646 },
4747 // one specific supported sbom with vulns
4848 {
4949 Name : "one specific supported sbom with vulns" ,
50- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- sbom" , "./testdata/sbom-insecure/alpine.cdx.xml" },
50+ Args : []string {"" , "source" , "--sbom" , "./testdata/sbom-insecure/alpine.cdx.xml" },
5151 Exit : 1 ,
5252 },
5353 {
5454 Name : "one specific supported sbom with vulns using -L flag" ,
55- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "./testdata/sbom-insecure/alpine.cdx.xml" },
55+ Args : []string {"" , "source" , "-L" , "./testdata/sbom-insecure/alpine.cdx.xml" },
5656 Exit : 1 ,
5757 },
5858 // one specific supported sbom with vulns and invalid PURLs
5959 {
6060 Name : "one specific supported sbom with invalid PURLs" ,
61- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- sbom" , "./testdata/sbom-insecure/bad-purls.cdx.xml" },
61+ Args : []string {"" , "source" , "--sbom" , "./testdata/sbom-insecure/bad-purls.cdx.xml" },
6262 Exit : 0 ,
6363 },
6464 {
6565 Name : "one specific supported sbom with invalid PURLs using -L flag" ,
66- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "./testdata/sbom-insecure/bad-purls.cdx.xml" },
66+ Args : []string {"" , "source" , "-L" , "./testdata/sbom-insecure/bad-purls.cdx.xml" },
6767 Exit : 0 ,
6868 },
6969 // one specific supported sbom with duplicate PURLs
7070 {
7171 Name : "one specific supported sbom with duplicate PURLs" ,
72- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- sbom" , "./testdata/sbom-insecure/with-duplicates.cdx.xml" },
72+ Args : []string {"" , "source" , "--sbom" , "./testdata/sbom-insecure/with-duplicates.cdx.xml" },
7373 Exit : 1 ,
7474 },
7575 {
7676 Name : "one specific supported sbom with duplicate PURLs using -L flag" ,
77- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "./testdata/sbom-insecure/with-duplicates.cdx.xml" },
77+ Args : []string {"" , "source" , "-L" , "./testdata/sbom-insecure/with-duplicates.cdx.xml" },
7878 Exit : 1 ,
7979 },
8080 // one file that does not match the supported sbom file names
8181 {
8282 Name : "one file that does not match the supported sbom file names" ,
83- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- sbom" , "./testdata/locks-many/composer.lock" },
83+ Args : []string {"" , "source" , "--sbom" , "./testdata/locks-many/composer.lock" },
8484 Exit : 127 ,
8585 },
8686 {
8787 Name : "one file that does not match the supported sbom file names using -L flag" ,
88- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "spdx:./testdata/locks-many/composer.lock" },
88+ Args : []string {"" , "source" , "-L" , "spdx:./testdata/locks-many/composer.lock" },
8989 Exit : 127 ,
9090 },
9191 // one specific unsupported lockfile
@@ -257,12 +257,12 @@ func TestCommand(t *testing.T) {
257257 },
258258 {
259259 Name : "PURL SBOM case sensitivity (api)" ,
260- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- format" , "table" , "./testdata/sbom-insecure/alpine.cdx.xml" },
260+ Args : []string {"" , "source" , "--format" , "table" , "./testdata/sbom-insecure/alpine.cdx.xml" },
261261 Exit : 1 ,
262262 },
263263 {
264264 Name : "PURL SBOM case sensitivity (local)" ,
265- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- offline" , "--download-offline-databases" , "--format" , "table" , "./testdata/sbom-insecure/alpine.cdx.xml" },
265+ Args : []string {"" , "source" , "--offline" , "--download-offline-databases" , "--format" , "table" , "./testdata/sbom-insecure/alpine.cdx.xml" },
266266 Exit : 1 ,
267267 },
268268 // Go project with an overridden go version
@@ -310,12 +310,12 @@ func TestCommand(t *testing.T) {
310310 // a bunch of requirements.txt files with different names
311311 {
312312 Name : "requirements.txt can have all kinds of names" ,
313- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/locks-requirements" },
313+ Args : []string {"" , "source" , "./testdata/locks-requirements" },
314314 Exit : 1 ,
315315 },
316316 {
317317 Name : "go_packages_in_osv-scanner.json_format" ,
318- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "osv-scanner:./testdata/locks-insecure/osv-scanner.json" },
318+ Args : []string {"" , "source" , "-L" , "osv-scanner:./testdata/locks-insecure/osv-scanner.json" },
319319 Exit : 1 ,
320320 },
321321 }
@@ -723,7 +723,6 @@ func TestCommand_LockfileWithExplicitParseAs(t *testing.T) {
723723 Args : []string {
724724 "" ,
725725 "source" ,
726- "--config=./testdata/osv-scanner-empty-config.toml" ,
727726 "-L" ,
728727 "package-lock.json:" + filepath .FromSlash ("./testdata/locks-insecure/my-package-lock.json" ),
729728 filepath .FromSlash ("./testdata/locks-insecure" ),
@@ -735,7 +734,6 @@ func TestCommand_LockfileWithExplicitParseAs(t *testing.T) {
735734 Args : []string {
736735 "" ,
737736 "source" ,
738- "--config=./testdata/osv-scanner-empty-config.toml" ,
739737 "-L" , "package-lock.json:" + filepath .FromSlash ("./testdata/locks-insecure/my-package-lock.json" ),
740738 "-L" , "yarn.lock:" + filepath .FromSlash ("./testdata/locks-insecure/my-yarn.lock" ),
741739 filepath .FromSlash ("./testdata/locks-insecure" ),
@@ -747,7 +745,6 @@ func TestCommand_LockfileWithExplicitParseAs(t *testing.T) {
747745 Args : []string {
748746 "" ,
749747 "source" ,
750- "--config=./testdata/osv-scanner-empty-config.toml" ,
751748 "-L" , "yarn.lock:" + filepath .FromSlash ("./testdata/locks-insecure/my-yarn.lock" ),
752749 "-L" , "package-lock.json:" + filepath .FromSlash ("./testdata/locks-insecure/my-package-lock.json" ),
753750 filepath .FromSlash ("./testdata/locks-insecure" ),
@@ -844,12 +841,12 @@ func TestCommand_GithubActions(t *testing.T) {
844841 tests := []testcmd.Case {
845842 {
846843 Name : "scanning osv-scanner custom format" ,
847- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "osv-scanner:./testdata/locks-insecure/osv-scanner-flutter-deps.json" },
844+ Args : []string {"" , "source" , "-L" , "osv-scanner:./testdata/locks-insecure/osv-scanner-flutter-deps.json" },
848845 Exit : 1 ,
849846 },
850847 {
851848 Name : "scanning osv-scanner custom format output json" ,
852- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "osv-scanner:./testdata/locks-insecure/osv-scanner-flutter-deps.json" , "--format=sarif" },
849+ Args : []string {"" , "source" , "-L" , "osv-scanner:./testdata/locks-insecure/osv-scanner-flutter-deps.json" , "--format=sarif" },
853850 Exit : 1 ,
854851 },
855852 }
@@ -872,7 +869,7 @@ func TestCommand_LocalDatabases(t *testing.T) {
872869 },
873870 {
874871 Name : "one specific supported sbom with vulns" ,
875- Args : []string {"" , "source" , "--offline" , "--download-offline-databases" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/sbom-insecure/postgres-stretch.cdx.xml" },
872+ Args : []string {"" , "source" , "--offline" , "--download-offline-databases" , "./testdata/sbom-insecure/postgres-stretch.cdx.xml" },
876873 Exit : 1 ,
877874 },
878875 {
@@ -951,7 +948,7 @@ func TestCommand_LocalDatabases_AlwaysOffline(t *testing.T) {
951948 tests := []testcmd.Case {
952949 {
953950 Name : "a bunch of different lockfiles and ecosystem" ,
954- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- offline" , "./testdata/locks-requirements" , "./testdata/locks-many" },
951+ Args : []string {"" , "source" , "--offline" , "./testdata/locks-requirements" , "./testdata/locks-many" },
955952 Exit : 127 ,
956953 },
957954 }
@@ -1078,12 +1075,12 @@ func TestCommand_Licenses(t *testing.T) {
10781075 },
10791076 {
10801077 Name : "When offline licenses summary cannot be printed" ,
1081- Args : []string {"" , "source" , "--offline" , "--licenses" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/locks-many/package-lock.json" },
1078+ Args : []string {"" , "source" , "--offline" , "--licenses" , "./testdata/locks-many/package-lock.json" },
10821079 Exit : 127 ,
10831080 },
10841081 {
10851082 Name : "When offline licenses cannot be checked" ,
1086- Args : []string {"" , "source" , "--offline" , "--licenses=MIT" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/locks-many/package-lock.json" },
1083+ Args : []string {"" , "source" , "--offline" , "--licenses=MIT" , "./testdata/locks-many/package-lock.json" },
10871084 Exit : 127 ,
10881085 },
10891086 {
@@ -1107,69 +1104,69 @@ func TestCommand_Transitive(t *testing.T) {
11071104 tests := []testcmd.Case {
11081105 {
11091106 Name : "scans transitive dependencies for pom.xml by default" ,
1110- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/maven-transitive/pom.xml" },
1107+ Args : []string {"" , "source" , "./testdata/maven-transitive/pom.xml" },
11111108 Exit : 1 ,
11121109 },
11131110 {
11141111 Name : "scans transitive dependencies by specifying pom.xml" ,
1115- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "pom.xml:./testdata/maven-transitive/abc.xml" },
1112+ Args : []string {"" , "source" , "-L" , "pom.xml:./testdata/maven-transitive/abc.xml" },
11161113 Exit : 1 ,
11171114 },
11181115 {
11191116 Name : "scans pom.xml with non UTF-8 encoding" ,
1120- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "pom.xml:./testdata/maven-transitive/encoding.xml" },
1117+ Args : []string {"" , "source" , "-L" , "pom.xml:./testdata/maven-transitive/encoding.xml" },
11211118 Exit : 1 ,
11221119 },
11231120 {
11241121 // Direct dependencies do not have any vulnerability.
11251122 Name : "does not scan transitive dependencies for pom.xml with offline mode" ,
1126- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- offline" , "--download-offline-databases" , "./testdata/maven-transitive/pom.xml" },
1123+ Args : []string {"" , "source" , "--offline" , "--download-offline-databases" , "./testdata/maven-transitive/pom.xml" },
11271124 Exit : 0 ,
11281125 },
11291126 {
11301127 // Direct dependencies do not have any vulnerability.
11311128 Name : "does not scan transitive dependencies for pom.xml with no-resolve" ,
1132- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- no-resolve" , "./testdata/maven-transitive/pom.xml" },
1129+ Args : []string {"" , "source" , "--no-resolve" , "./testdata/maven-transitive/pom.xml" },
11331130 Exit : 0 ,
11341131 },
11351132 {
11361133 Name : "scans dependencies from multiple registries" ,
1137- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "- L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
1134+ Args : []string {"" , "source" , "-L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
11381135 Exit : 1 ,
11391136 },
11401137 {
11411138 Name : "resolves transitive dependencies with native data source" ,
1142- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- data-source=native" , "-L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
1139+ Args : []string {"" , "source" , "--data-source=native" , "-L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
11431140 Exit : 1 ,
11441141 },
11451142 {
11461143 Name : "uses native data source for requirements.txt" ,
1147- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/locks-requirements/requirements.txt" },
1144+ Args : []string {"" , "source" , "./testdata/locks-requirements/requirements.txt" },
11481145 Exit : 1 ,
11491146 },
11501147 {
11511148 Name : "fall back to the offline extractor if resolution failed" ,
1152- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , " ./testdata/locks-requirements/unresolvable-requirements.txt" },
1149+ Args : []string {"" , "source" , "./testdata/locks-requirements/unresolvable-requirements.txt" },
11531150 Exit : 1 ,
11541151 },
11551152 {
11561153 Name : "does not scan transitive dependencies for requirements.txt with no-resolve" ,
1157- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- no-resolve" , "./testdata/locks-requirements/requirements.txt" },
1154+ Args : []string {"" , "source" , "--no-resolve" , "./testdata/locks-requirements/requirements.txt" },
11581155 Exit : 1 ,
11591156 },
11601157 {
11611158 Name : "does not scan transitive dependencies for requirements.txt with offline mode" ,
1162- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- offline" , "--download-offline-databases" , "./testdata/locks-requirements/requirements.txt" },
1159+ Args : []string {"" , "source" , "--offline" , "--download-offline-databases" , "./testdata/locks-requirements/requirements.txt" },
11631160 Exit : 1 ,
11641161 },
11651162 {
11661163 Name : "errors_with_invalid_data_source" ,
1167- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- data-source=github" , "-L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
1164+ Args : []string {"" , "source" , "--data-source=github" , "-L" , "pom.xml:./testdata/maven-transitive/registry.xml" },
11681165 Exit : 127 ,
11691166 },
11701167 {
11711168 Name : "scan local disk transitive dependencies" ,
1172- Args : []string {"" , "source" , "--config=./testdata/osv-scanner-empty-config.toml" , "-- no-resolve" , "./testdata/locks-requirements/requirements-transitive.txt" },
1169+ Args : []string {"" , "source" , "--no-resolve" , "./testdata/locks-requirements/requirements-transitive.txt" },
11731170 Exit : 1 ,
11741171 },
11751172 }
0 commit comments