Skip to content

Commit 586e900

Browse files
authored
Merge pull request #16462 from github/mbg/go/add-resolve-env-tests
Go: Add tests for `resolve build-environment`
2 parents 64b8f97 + 28c8611 commit 586e900

File tree

33 files changed

+190
-1
lines changed

33 files changed

+190
-1
lines changed

go/integration-tests-lib/go_integration_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import os
22
from create_database_utils import *
33
from diagnostics_test_utils import *
4+
from resolve_environment_utils import *
45

5-
def go_integration_test(source = "src", db = "db", runFunction = runSuccessfully):
6+
def go_integration_test(toolchain=None, source = "src", db = "db", runFunction = runSuccessfully):
67
# Set up a GOPATH relative to this test's root directory;
78
# we set os.environ instead of using extra_env because we
89
# need it to be set for the call to "go clean -modcache" later
910
goPath = os.path.join(os.path.abspath(os.getcwd()), ".go")
1011
os.environ['GOPATH'] = goPath
1112

13+
extra_env = None
14+
15+
if toolchain != None:
16+
extra_env = { 'GOTOOLCHAIN': toolchain }
17+
1218
try:
19+
run_codeql_resolve_build_environment(lang="go", source=source, extra_env=extra_env)
1320
run_codeql_database_create([], lang="go", source=source, db=db, runFunction=runFunction)
1421

1522
check_diagnostics()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configuration" : {
3+
"go" : { }
4+
}
5+
}

0 commit comments

Comments
 (0)