Skip to content

Commit 8d28253

Browse files
committed
Add tests for fourth diagnostic (Go files found but not processed)
1 parent 01a2e74 commit 8d28253

File tree

10 files changed

+44
-0
lines changed

10 files changed

+44
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"internal": false,
3+
"markdownMessage": "[Specify a custom build command](https://docs.github.com/en/github-ae@latest/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language) that includes one or more `go build` commands to build the `.go` files to be analyzed.",
4+
"severity": "error",
5+
"source": {
6+
"extractorName": "go",
7+
"id": "go/autobuilder/go-files-found-but-not-processed",
8+
"name": "Go files were found but not processed"
9+
},
10+
"visibility": {
11+
"cliSummaryTable": true,
12+
"statusPage": true,
13+
"telemetry": true
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
3+
from create_database_utils import *
4+
from diagnostics_test_utils import *
5+
6+
os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
7+
run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully)
8+
9+
check_diagnostics()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
go 1.18
2+
3+
module test

go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/work/go.sum

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
go 1.18
2+
3+
module test/subdir

go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/work/subdir/go.sum

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package test/subdir
2+
3+
func Test() {
4+
}

go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/diagnostics.expected

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
3+
from create_database_utils import *
4+
from diagnostics_test_utils import *
5+
6+
os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
7+
run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully)
8+
9+
check_diagnostics()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// The "Go files were found but not processed" diagnostic should not be emitted because there are no go files

0 commit comments

Comments
 (0)