diff --git a/tests/integration/test_data/gomod_packages.yaml b/tests/integration/test_data/gomod_packages.yaml index 77012b41a..eba1d1e18 100644 --- a/tests/integration/test_data/gomod_packages.yaml +++ b/tests/integration/test_data/gomod_packages.yaml @@ -3558,6 +3558,915 @@ with_local_replacements_in_parent_dir: - name: unicode/utf8 type: library purl: pkg:golang/unicode%2Futf8 + - name: unsafe + type: library + purl: pkg:golang/unsafe +multiple_modules: + repo: https://github.com/cachito-testing/gomod-multiple-modules.git + ref: f9c648b9bf9839613dcffcf98e3f2abaa9e6e39a + pkg_managers: ["gomod"] + packages: + gomod: [ { "path": "eggs-module" }, { "path": "spam-module" } ] + response_expectations: + dependencies: + - name: bytes + replaces: null + type: go-package + version: null + - name: errors + replaces: null + type: go-package + version: null + - name: fmt + replaces: null + type: go-package + version: null + - name: golang.org/x/text/internal/tag + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: golang.org/x/text/language + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: internal/abi + replaces: null + type: go-package + version: null + - name: internal/bytealg + replaces: null + type: go-package + version: null + - name: internal/coverage/rtcov + replaces: null + type: go-package + version: null + - name: internal/cpu + replaces: null + type: go-package + version: null + - name: internal/fmtsort + replaces: null + type: go-package + version: null + - name: internal/goarch + replaces: null + type: go-package + version: null + - name: internal/goexperiment + replaces: null + type: go-package + version: null + - name: internal/goos + replaces: null + type: go-package + version: null + - name: internal/itoa + replaces: null + type: go-package + version: null + - name: internal/oserror + replaces: null + type: go-package + version: null + - name: internal/poll + replaces: null + type: go-package + version: null + - name: internal/race + replaces: null + type: go-package + version: null + - name: internal/reflectlite + replaces: null + type: go-package + version: null + - name: internal/safefilepath + replaces: null + type: go-package + version: null + - name: internal/syscall/execenv + replaces: null + type: go-package + version: null + - name: internal/syscall/unix + replaces: null + type: go-package + version: null + - name: internal/testlog + replaces: null + type: go-package + version: null + - name: internal/unsafeheader + replaces: null + type: go-package + version: null + - name: io + replaces: null + type: go-package + version: null + - name: io/fs + replaces: null + type: go-package + version: null + - name: math + replaces: null + type: go-package + version: null + - name: math/bits + replaces: null + type: go-package + version: null + - name: os + replaces: null + type: go-package + version: null + - name: path + replaces: null + type: go-package + version: null + - name: reflect + replaces: null + type: go-package + version: null + - name: rsc.io/quote + replaces: null + type: go-package + version: v1.5.1 + - name: rsc.io/quote + replaces: null + type: go-package + version: v1.5.2 + - name: rsc.io/sampler + replaces: null + type: go-package + version: v1.3.0 + - name: runtime + replaces: null + type: go-package + version: null + - name: runtime/internal/atomic + replaces: null + type: go-package + version: null + - name: runtime/internal/math + replaces: null + type: go-package + version: null + - name: runtime/internal/sys + replaces: null + type: go-package + version: null + - name: runtime/internal/syscall + replaces: null + type: go-package + version: null + - name: sort + replaces: null + type: go-package + version: null + - name: strconv + replaces: null + type: go-package + version: null + - name: strings + replaces: null + type: go-package + version: null + - name: sync + replaces: null + type: go-package + version: null + - name: sync/atomic + replaces: null + type: go-package + version: null + - name: syscall + replaces: null + type: go-package + version: null + - name: time + replaces: null + type: go-package + version: null + - name: unicode + replaces: null + type: go-package + version: null + - name: unicode/utf8 + replaces: null + type: go-package + version: null + - name: unsafe + replaces: null + type: go-package + version: null + - name: golang.org/x/text + replaces: null + type: gomod + version: v0.0.0-20170915032832-14c0d48ead0c + - name: rsc.io/quote + replaces: null + type: gomod + version: v1.5.1 + - name: rsc.io/quote + replaces: null + type: gomod + version: v1.5.2 + - name: rsc.io/sampler + replaces: null + type: gomod + version: v1.3.0 + packages: + - dependencies: + - name: bytes + replaces: null + type: go-package + version: null + - name: errors + replaces: null + type: go-package + version: null + - name: fmt + replaces: null + type: go-package + version: null + - name: golang.org/x/text/internal/tag + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: golang.org/x/text/language + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: internal/abi + replaces: null + type: go-package + version: null + - name: internal/bytealg + replaces: null + type: go-package + version: null + - name: internal/coverage/rtcov + replaces: null + type: go-package + version: null + - name: internal/cpu + replaces: null + type: go-package + version: null + - name: internal/fmtsort + replaces: null + type: go-package + version: null + - name: internal/goarch + replaces: null + type: go-package + version: null + - name: internal/goexperiment + replaces: null + type: go-package + version: null + - name: internal/goos + replaces: null + type: go-package + version: null + - name: internal/itoa + replaces: null + type: go-package + version: null + - name: internal/oserror + replaces: null + type: go-package + version: null + - name: internal/poll + replaces: null + type: go-package + version: null + - name: internal/race + replaces: null + type: go-package + version: null + - name: internal/reflectlite + replaces: null + type: go-package + version: null + - name: internal/safefilepath + replaces: null + type: go-package + version: null + - name: internal/syscall/execenv + replaces: null + type: go-package + version: null + - name: internal/syscall/unix + replaces: null + type: go-package + version: null + - name: internal/testlog + replaces: null + type: go-package + version: null + - name: internal/unsafeheader + replaces: null + type: go-package + version: null + - name: io + replaces: null + type: go-package + version: null + - name: io/fs + replaces: null + type: go-package + version: null + - name: math + replaces: null + type: go-package + version: null + - name: math/bits + replaces: null + type: go-package + version: null + - name: os + replaces: null + type: go-package + version: null + - name: path + replaces: null + type: go-package + version: null + - name: reflect + replaces: null + type: go-package + version: null + - name: rsc.io/quote + replaces: null + type: go-package + version: v1.5.1 + - name: rsc.io/sampler + replaces: null + type: go-package + version: v1.3.0 + - name: runtime + replaces: null + type: go-package + version: null + - name: runtime/internal/atomic + replaces: null + type: go-package + version: null + - name: runtime/internal/math + replaces: null + type: go-package + version: null + - name: runtime/internal/sys + replaces: null + type: go-package + version: null + - name: runtime/internal/syscall + replaces: null + type: go-package + version: null + - name: sort + replaces: null + type: go-package + version: null + - name: strconv + replaces: null + type: go-package + version: null + - name: strings + replaces: null + type: go-package + version: null + - name: sync + replaces: null + type: go-package + version: null + - name: sync/atomic + replaces: null + type: go-package + version: null + - name: syscall + replaces: null + type: go-package + version: null + - name: time + replaces: null + type: go-package + version: null + - name: unicode + replaces: null + type: go-package + version: null + - name: unicode/utf8 + replaces: null + type: go-package + version: null + - name: unsafe + replaces: null + type: go-package + version: null + name: github.com/cachito-testing/gomod-multiple-modules/eggs-module + path: eggs-module + type: go-package + version: v0.0.0-20240219150512-f9c648b9bf98 + - dependencies: + - name: bytes + replaces: null + type: go-package + version: null + - name: errors + replaces: null + type: go-package + version: null + - name: fmt + replaces: null + type: go-package + version: null + - name: golang.org/x/text/internal/tag + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: golang.org/x/text/language + replaces: null + type: go-package + version: v0.0.0-20170915032832-14c0d48ead0c + - name: internal/abi + replaces: null + type: go-package + version: null + - name: internal/bytealg + replaces: null + type: go-package + version: null + - name: internal/coverage/rtcov + replaces: null + type: go-package + version: null + - name: internal/cpu + replaces: null + type: go-package + version: null + - name: internal/fmtsort + replaces: null + type: go-package + version: null + - name: internal/goarch + replaces: null + type: go-package + version: null + - name: internal/goexperiment + replaces: null + type: go-package + version: null + - name: internal/goos + replaces: null + type: go-package + version: null + - name: internal/itoa + replaces: null + type: go-package + version: null + - name: internal/oserror + replaces: null + type: go-package + version: null + - name: internal/poll + replaces: null + type: go-package + version: null + - name: internal/race + replaces: null + type: go-package + version: null + - name: internal/reflectlite + replaces: null + type: go-package + version: null + - name: internal/safefilepath + replaces: null + type: go-package + version: null + - name: internal/syscall/execenv + replaces: null + type: go-package + version: null + - name: internal/syscall/unix + replaces: null + type: go-package + version: null + - name: internal/testlog + replaces: null + type: go-package + version: null + - name: internal/unsafeheader + replaces: null + type: go-package + version: null + - name: io + replaces: null + type: go-package + version: null + - name: io/fs + replaces: null + type: go-package + version: null + - name: math + replaces: null + type: go-package + version: null + - name: math/bits + replaces: null + type: go-package + version: null + - name: os + replaces: null + type: go-package + version: null + - name: path + replaces: null + type: go-package + version: null + - name: reflect + replaces: null + type: go-package + version: null + - name: rsc.io/quote + replaces: null + type: go-package + version: v1.5.2 + - name: rsc.io/sampler + replaces: null + type: go-package + version: v1.3.0 + - name: runtime + replaces: null + type: go-package + version: null + - name: runtime/internal/atomic + replaces: null + type: go-package + version: null + - name: runtime/internal/math + replaces: null + type: go-package + version: null + - name: runtime/internal/sys + replaces: null + type: go-package + version: null + - name: runtime/internal/syscall + replaces: null + type: go-package + version: null + - name: sort + replaces: null + type: go-package + version: null + - name: strconv + replaces: null + type: go-package + version: null + - name: strings + replaces: null + type: go-package + version: null + - name: sync + replaces: null + type: go-package + version: null + - name: sync/atomic + replaces: null + type: go-package + version: null + - name: syscall + replaces: null + type: go-package + version: null + - name: time + replaces: null + type: go-package + version: null + - name: unicode + replaces: null + type: go-package + version: null + - name: unicode/utf8 + replaces: null + type: go-package + version: null + - name: unsafe + replaces: null + type: go-package + version: null + name: github.com/cachito-testing/gomod-multiple-modules/spam-module + path: spam-module + type: go-package + version: v1.2.1-0.20240219150512-f9c648b9bf98 + - dependencies: + - name: golang.org/x/text + replaces: null + type: gomod + version: v0.0.0-20170915032832-14c0d48ead0c + - name: rsc.io/quote + replaces: null + type: gomod + version: v1.5.1 + - name: rsc.io/sampler + replaces: null + type: gomod + version: v1.3.0 + name: github.com/cachito-testing/gomod-multiple-modules/eggs-module + path: eggs-module + type: gomod + version: v0.0.0-20240219150512-f9c648b9bf98 + - dependencies: + - name: golang.org/x/text + replaces: null + type: gomod + version: v0.0.0-20170915032832-14c0d48ead0c + - name: rsc.io/quote + replaces: null + type: gomod + version: v1.5.2 + - name: rsc.io/sampler + replaces: null + type: gomod + version: v1.3.0 + name: github.com/cachito-testing/gomod-multiple-modules/spam-module + path: spam-module + type: gomod + version: v1.2.1-0.20240219150512-f9c648b9bf98 + expected_files: + app: https://github.com/cachito-testing/gomod-multiple-modules/tarball/f9c648b9bf9839613dcffcf98e3f2abaa9e6e39a + deps/gomod/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip: https://github.com/cachito-testing/test_files/raw/master/test_gomod_with_deps_quote.tar.gz + content_manifest: + - purl: "pkg:golang/github.com%2Fcachito-testing%2Fgomod-multiple-modules%2Feggs-module@v0.0.0-20240219150512-f9c648b9bf98" + dep_purls: + - "pkg:golang/bytes" + - "pkg:golang/errors" + - "pkg:golang/fmt" + - "pkg:golang/golang.org%2Fx%2Ftext%2Finternal%2Ftag@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/golang.org%2Fx%2Ftext%2Flanguage@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/internal%2Fabi" + - "pkg:golang/internal%2Fbytealg" + - "pkg:golang/internal%2Fcoverage%2Frtcov" + - "pkg:golang/internal%2Fcpu" + - "pkg:golang/internal%2Ffmtsort" + - "pkg:golang/internal%2Fgoarch" + - "pkg:golang/internal%2Fgoexperiment" + - "pkg:golang/internal%2Fgoos" + - "pkg:golang/internal%2Fitoa" + - "pkg:golang/internal%2Foserror" + - "pkg:golang/internal%2Fpoll" + - "pkg:golang/internal%2Frace" + - "pkg:golang/internal%2Freflectlite" + - "pkg:golang/internal%2Fsafefilepath" + - "pkg:golang/internal%2Fsyscall%2Fexecenv" + - "pkg:golang/internal%2Fsyscall%2Funix" + - "pkg:golang/internal%2Ftestlog" + - "pkg:golang/internal%2Funsafeheader" + - "pkg:golang/io" + - "pkg:golang/io%2Ffs" + - "pkg:golang/math" + - "pkg:golang/math%2Fbits" + - "pkg:golang/os" + - "pkg:golang/path" + - "pkg:golang/reflect" + - "pkg:golang/rsc.io%2Fquote@v1.5.1" + - "pkg:golang/rsc.io%2Fsampler@v1.3.0" + - "pkg:golang/runtime" + - "pkg:golang/runtime%2Finternal%2Fatomic" + - "pkg:golang/runtime%2Finternal%2Fmath" + - "pkg:golang/runtime%2Finternal%2Fsys" + - "pkg:golang/runtime%2Finternal%2Fsyscall" + - "pkg:golang/sort" + - "pkg:golang/strconv" + - "pkg:golang/strings" + - "pkg:golang/sync" + - "pkg:golang/sync%2Fatomic" + - "pkg:golang/syscall" + - "pkg:golang/time" + - "pkg:golang/unicode" + - "pkg:golang/unicode%2Futf8" + - "pkg:golang/unsafe" + source_purls: + - "pkg:golang/golang.org%2Fx%2Ftext@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/rsc.io%2Fquote@v1.5.1" + - "pkg:golang/rsc.io%2Fsampler@v1.3.0" + - purl: "pkg:golang/github.com%2Fcachito-testing%2Fgomod-multiple-modules%2Fspam-module@v1.2.1-0.20240219150512-f9c648b9bf98" + dep_purls: + - "pkg:golang/bytes" + - "pkg:golang/errors" + - "pkg:golang/fmt" + - "pkg:golang/golang.org%2Fx%2Ftext%2Finternal%2Ftag@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/golang.org%2Fx%2Ftext%2Flanguage@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/internal%2Fabi" + - "pkg:golang/internal%2Fbytealg" + - "pkg:golang/internal%2Fcoverage%2Frtcov" + - "pkg:golang/internal%2Fcpu" + - "pkg:golang/internal%2Ffmtsort" + - "pkg:golang/internal%2Fgoarch" + - "pkg:golang/internal%2Fgoexperiment" + - "pkg:golang/internal%2Fgoos" + - "pkg:golang/internal%2Fitoa" + - "pkg:golang/internal%2Foserror" + - "pkg:golang/internal%2Fpoll" + - "pkg:golang/internal%2Frace" + - "pkg:golang/internal%2Freflectlite" + - "pkg:golang/internal%2Fsafefilepath" + - "pkg:golang/internal%2Fsyscall%2Fexecenv" + - "pkg:golang/internal%2Fsyscall%2Funix" + - "pkg:golang/internal%2Ftestlog" + - "pkg:golang/internal%2Funsafeheader" + - "pkg:golang/io" + - "pkg:golang/io%2Ffs" + - "pkg:golang/math" + - "pkg:golang/math%2Fbits" + - "pkg:golang/os" + - "pkg:golang/path" + - "pkg:golang/reflect" + - "pkg:golang/rsc.io%2Fquote@v1.5.2" + - "pkg:golang/rsc.io%2Fsampler@v1.3.0" + - "pkg:golang/runtime" + - "pkg:golang/runtime%2Finternal%2Fatomic" + - "pkg:golang/runtime%2Finternal%2Fmath" + - "pkg:golang/runtime%2Finternal%2Fsys" + - "pkg:golang/runtime%2Finternal%2Fsyscall" + - "pkg:golang/sort" + - "pkg:golang/strconv" + - "pkg:golang/strings" + - "pkg:golang/sync" + - "pkg:golang/sync%2Fatomic" + - "pkg:golang/syscall" + - "pkg:golang/time" + - "pkg:golang/unicode" + - "pkg:golang/unicode%2Futf8" + - "pkg:golang/unsafe" + source_purls: + - "pkg:golang/golang.org%2Fx%2Ftext@v0.0.0-20170915032832-14c0d48ead0c" + - "pkg:golang/rsc.io%2Fquote@v1.5.2" + - "pkg:golang/rsc.io%2Fsampler@v1.3.0" + sbom: + - name: bytes + type: library + purl: pkg:golang/bytes + - name: errors + type: library + purl: pkg:golang/errors + - name: fmt + type: library + purl: pkg:golang/fmt + - name: github.com/cachito-testing/gomod-multiple-modules/eggs-module + type: library + version: v0.0.0-20240219150512-f9c648b9bf98 + purl: pkg:golang/github.com%2Fcachito-testing%2Fgomod-multiple-modules%2Feggs-module@v0.0.0-20240219150512-f9c648b9bf98 + - name: github.com/cachito-testing/gomod-multiple-modules/spam-module + type: library + version: v1.2.1-0.20240219150512-f9c648b9bf98 + purl: pkg:golang/github.com%2Fcachito-testing%2Fgomod-multiple-modules%2Fspam-module@v1.2.1-0.20240219150512-f9c648b9bf98 + - name: golang.org/x/text/internal/tag + type: library + version: v0.0.0-20170915032832-14c0d48ead0c + purl: pkg:golang/golang.org%2Fx%2Ftext%2Finternal%2Ftag@v0.0.0-20170915032832-14c0d48ead0c + - name: golang.org/x/text/language + type: library + version: v0.0.0-20170915032832-14c0d48ead0c + purl: pkg:golang/golang.org%2Fx%2Ftext%2Flanguage@v0.0.0-20170915032832-14c0d48ead0c + - name: golang.org/x/text + type: library + version: v0.0.0-20170915032832-14c0d48ead0c + purl: pkg:golang/golang.org%2Fx%2Ftext@v0.0.0-20170915032832-14c0d48ead0c + - name: internal/abi + type: library + purl: pkg:golang/internal%2Fabi + - name: internal/bytealg + type: library + purl: pkg:golang/internal%2Fbytealg + - name: internal/coverage/rtcov + type: library + purl: pkg:golang/internal%2Fcoverage%2Frtcov + - name: internal/cpu + type: library + purl: pkg:golang/internal%2Fcpu + - name: internal/fmtsort + type: library + purl: pkg:golang/internal%2Ffmtsort + - name: internal/goarch + type: library + purl: pkg:golang/internal%2Fgoarch + - name: internal/goexperiment + type: library + purl: pkg:golang/internal%2Fgoexperiment + - name: internal/goos + type: library + purl: pkg:golang/internal%2Fgoos + - name: internal/itoa + type: library + purl: pkg:golang/internal%2Fitoa + - name: internal/oserror + type: library + purl: pkg:golang/internal%2Foserror + - name: internal/poll + type: library + purl: pkg:golang/internal%2Fpoll + - name: internal/race + type: library + purl: pkg:golang/internal%2Frace + - name: internal/reflectlite + type: library + purl: pkg:golang/internal%2Freflectlite + - name: internal/safefilepath + type: library + purl: pkg:golang/internal%2Fsafefilepath + - name: internal/syscall/execenv + type: library + purl: pkg:golang/internal%2Fsyscall%2Fexecenv + - name: internal/syscall/unix + type: library + purl: pkg:golang/internal%2Fsyscall%2Funix + - name: internal/testlog + type: library + purl: pkg:golang/internal%2Ftestlog + - name: internal/unsafeheader + type: library + purl: pkg:golang/internal%2Funsafeheader + - name: io + type: library + purl: pkg:golang/io + - name: io/fs + type: library + purl: pkg:golang/io%2Ffs + - name: math + type: library + purl: pkg:golang/math + - name: math/bits + type: library + purl: pkg:golang/math%2Fbits + - name: os + type: library + purl: pkg:golang/os + - name: path + type: library + purl: pkg:golang/path + - name: reflect + type: library + purl: pkg:golang/reflect + - name: rsc.io/quote + type: library + version: v1.5.1 + purl: pkg:golang/rsc.io%2Fquote@v1.5.1 + - name: rsc.io/quote + type: library + version: v1.5.2 + purl: pkg:golang/rsc.io%2Fquote@v1.5.2 + - name: rsc.io/sampler + type: library + version: v1.3.0 + purl: pkg:golang/rsc.io%2Fsampler@v1.3.0 + - name: runtime + type: library + purl: pkg:golang/runtime + - name: runtime/internal/atomic + type: library + purl: pkg:golang/runtime%2Finternal%2Fatomic + - name: runtime/internal/math + type: library + purl: pkg:golang/runtime%2Finternal%2Fmath + - name: runtime/internal/sys + type: library + purl: pkg:golang/runtime%2Finternal%2Fsys + - name: runtime/internal/syscall + type: library + purl: pkg:golang/runtime%2Finternal%2Fsyscall + - name: sort + type: library + purl: pkg:golang/sort + - name: strconv + type: library + purl: pkg:golang/strconv + - name: strings + type: library + purl: pkg:golang/strings + - name: sync + type: library + purl: pkg:golang/sync + - name: sync/atomic + type: library + purl: pkg:golang/sync%2Fatomic + - name: syscall + type: library + purl: pkg:golang/syscall + - name: time + type: library + purl: pkg:golang/time + - name: unicode + type: library + purl: pkg:golang/unicode + - name: unicode/utf8 + type: library + purl: pkg:golang/unicode%2Futf8 - name: unsafe type: library purl: pkg:golang/unsafe \ No newline at end of file diff --git a/tests/integration/test_packages.py b/tests/integration/test_packages.py index f7c7f1534..71af54a4e 100755 --- a/tests/integration/test_packages.py +++ b/tests/integration/test_packages.py @@ -27,6 +27,7 @@ ("gomod_packages", "symlink_loop"), ("gomod_packages", "without_pkg_manager"), ("gomod_packages", "with_local_replacements_in_parent_dir"), + ("gomod_packages", "multiple_modules"), ("gomod_vendor_check", "correct_vendor"), ("gomod_vendor_check", "no_vendor"), ("npm_packages", "without_deps_v1_lockfile"),