Add tests for third diagnostic (package not found)

This commit is contained in:
Owen Mansel-Chan
2023-02-28 16:56:57 +00:00
parent c0cc1c3fd5
commit 4fe4dfbf83
8 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
{
"internal": false,
"markdownMessage": "Check that the path is correct. If it is a private package, make sure it can be accessed. If it is contained in the repository then you may need 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)",
"severity": "error",
"source": {
"extractorName": "go",
"id": "go/extractor/package-not-found",
"name": "Package github.com/linode/linode-docs-theme could not be found"
},
"visibility": {
"cliSummaryTable": true,
"statusPage": true,
"telemetry": true
}
}

View File

@@ -0,0 +1,9 @@
import sys
from create_database_utils import *
from diagnostics_test_utils import *
os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
run_codeql_database_create([], lang="go", source="work", db=None)
check_diagnostics()

View File

@@ -0,0 +1,7 @@
go 1.19
require (
github.com/linode/linode-docs-theme v0.0.0-20220622135843-166f108e1933
)
module test

View File

@@ -0,0 +1 @@
github.com/linode/linode-docs-theme v0.0.0-20220622135843-166f108e1933 h1:QchGQS6xESuyjdlNJEjvq2ftGX0sCTAhPhD5hAOJVMI=

View File

@@ -0,0 +1,8 @@
package test
import linodedocstheme "github.com/linode/linode-docs-theme"
func Test() {
theme := linodedocstheme.Theme{}
_ = theme
}

View File

@@ -0,0 +1,15 @@
{
"internal": false,
"markdownMessage": "Check that the path is correct. If it is a private package, make sure it can be accessed. If it is contained in the repository then you may need 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)",
"severity": "error",
"source": {
"extractorName": "go",
"id": "go/extractor/package-not-found",
"name": "Package github.com/linode/linode-docs-theme could not be found"
},
"visibility": {
"cliSummaryTable": true,
"statusPage": true,
"telemetry": true
}
}

View File

@@ -0,0 +1,9 @@
import sys
from create_database_utils import *
from diagnostics_test_utils import *
os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
run_codeql_database_create([], lang="go", source="work", db=None)
check_diagnostics()

View File

@@ -0,0 +1,8 @@
package test
import linodedocstheme "github.com/linode/linode-docs-theme"
func Test() {
theme := linodedocstheme.Theme{}
_ = theme
}