diff --git a/go/ql/integration-tests/mixed-layout/diagnostics.expected b/go/ql/integration-tests/mixed-layout/diagnostics.expected index bbbdd515d68..31e7dd57fcc 100644 --- a/go/ql/integration-tests/mixed-layout/diagnostics.expected +++ b/go/ql/integration-tests/mixed-layout/diagnostics.expected @@ -13,7 +13,7 @@ } } { - "markdownMessage": "Go files were found outside of the Go modules corresponding to these `go.mod` files.\n\n`workspace/subdir/go.mod`, `module/go.mod`", + "markdownMessage": "Go files were found outside of the Go modules corresponding to these `go.mod` files.\n\n`workspace/subdir/go.mod`, `module/go.mod`, `no-packages/go.mod`", "severity": "note", "source": { "extractorName": "go", @@ -26,3 +26,17 @@ "telemetry": true } } +{ + "markdownMessage": "The following 1 Go project could not be extracted successfully:\n\n`no-packages`\n", + "severity": "warning", + "source": { + "extractorName": "go", + "id": "go/autobuilder/extraction-failed-for-project", + "name": "Unable to extract some Go projects" + }, + "visibility": { + "cliSummaryTable": true, + "statusPage": true, + "telemetry": true + } +} diff --git a/go/ql/integration-tests/mixed-layout/src/no-packages/README.md b/go/ql/integration-tests/mixed-layout/src/no-packages/README.md new file mode 100644 index 00000000000..ac54bf0fb4f --- /dev/null +++ b/go/ql/integration-tests/mixed-layout/src/no-packages/README.md @@ -0,0 +1,3 @@ +This folder contains a Go module and a Go source file, but no packages will be extracted due to build constraints. + +Overall extraction should still succeed, because there are other Go modules in this workspace for which we are able to extract files. diff --git a/go/ql/integration-tests/mixed-layout/src/no-packages/go.mod b/go/ql/integration-tests/mixed-layout/src/no-packages/go.mod new file mode 100644 index 00000000000..a335389058a --- /dev/null +++ b/go/ql/integration-tests/mixed-layout/src/no-packages/go.mod @@ -0,0 +1,5 @@ +go 1.22 + +toolchain go1.22.0 + +module module diff --git a/go/ql/integration-tests/mixed-layout/src/no-packages/package_test.go b/go/ql/integration-tests/mixed-layout/src/no-packages/package_test.go new file mode 100644 index 00000000000..404465a7a20 --- /dev/null +++ b/go/ql/integration-tests/mixed-layout/src/no-packages/package_test.go @@ -0,0 +1,11 @@ +//go:build unit + +package subdir + +import ( + "fmt" +) + +func test() { + fmt.Print("Hello world") +}