From afc673324f2060cd1e4ea3079da6486c028f6e65 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 17 Jan 2024 13:11:25 +0000 Subject: [PATCH 1/3] Go: Move integration test sources to subdirectories --- .../all-platforms/go/bazel-sample-1/{ => src}/BUILD.bazel | 0 .../all-platforms/go/bazel-sample-1/{ => src}/go.mod | 0 .../all-platforms/go/bazel-sample-1/{ => src}/go.sum | 0 .../all-platforms/go/bazel-sample-1/{ => src}/test.go | 0 .../all-platforms/go/bazel-sample-1/{ => src}/todel.go | 0 .../all-platforms/go/bazel-sample-1/test.expected | 6 +++--- .../all-platforms/go/bazel-sample-1/test.py | 2 +- .../all-platforms/go/bazel-sample-2/{ => src}/BUILD | 0 .../all-platforms/go/bazel-sample-2/{ => src}/go.mod | 0 .../all-platforms/go/bazel-sample-2/{ => src}/go.sum | 0 .../all-platforms/go/bazel-sample-2/{ => src}/test.go | 0 .../all-platforms/go/bazel-sample-2/{ => src}/todel.go | 0 .../all-platforms/go/bazel-sample-2/test.expected | 6 +++--- .../all-platforms/go/bazel-sample-2/test.py | 2 +- .../go/go-get-without-modules-sample/{ => src}/test.go | 0 .../go/go-get-without-modules-sample/test.expected | 4 ++-- .../all-platforms/go/go-get-without-modules-sample/test.py | 2 +- .../all-platforms/go/go-mod-sample/{ => src}/Makefile | 0 .../all-platforms/go/go-mod-sample/{ => src}/go.mod | 0 .../all-platforms/go/go-mod-sample/{ => src}/go.sum | 0 .../all-platforms/go/go-mod-sample/{ => src}/test.go | 0 .../all-platforms/go/go-mod-sample/test.expected | 4 ++-- .../all-platforms/go/go-mod-sample/test.py | 2 +- .../all-platforms/go/make-sample/{ => src}/Makefile | 0 .../all-platforms/go/make-sample/{ => src}/go.mod | 0 .../all-platforms/go/make-sample/{ => src}/go.sum | 0 .../all-platforms/go/make-sample/{ => src}/test.go | 0 .../all-platforms/go/make-sample/{ => src}/todel.go | 0 .../all-platforms/go/make-sample/test.expected | 4 ++-- .../integration-tests/all-platforms/go/make-sample/test.py | 2 +- .../all-platforms/go/ninja-sample/{ => src}/.ninja_log | 0 .../all-platforms/go/ninja-sample/{ => src}/build.ninja | 0 .../all-platforms/go/ninja-sample/{ => src}/go.mod | 0 .../all-platforms/go/ninja-sample/{ => src}/go.sum | 0 .../all-platforms/go/ninja-sample/{ => src}/test.go | 0 .../all-platforms/go/ninja-sample/{ => src}/todel.go | 0 .../all-platforms/go/ninja-sample/test.expected | 4 ++-- .../integration-tests/all-platforms/go/ninja-sample/test.py | 2 +- .../{ => src}/main.go | 0 .../{ => src}/subdir/go.mod | 0 .../{ => src}/subdir/go.sum | 0 .../{ => src}/subdir/subsubdir/add.go | 0 .../{ => src}/subdir/test.go | 0 .../go/single-go-mod-and-go-files-not-under-it/test.py | 2 +- .../all-platforms/go/single-go-mod-in-root/{ => src}/go.mod | 0 .../all-platforms/go/single-go-mod-in-root/{ => src}/go.sum | 0 .../go/single-go-mod-in-root/{ => src}/subdir/add.go | 0 .../go/single-go-mod-in-root/{ => src}/test.go | 0 .../all-platforms/go/single-go-mod-in-root/test.py | 2 +- .../go/single-go-mod-not-in-root/{ => src}/subdir/go.mod | 0 .../go/single-go-mod-not-in-root/{ => src}/subdir/go.sum | 0 .../{ => src}/subdir/subsubdir/add.go | 0 .../go/single-go-mod-not-in-root/{ => src}/subdir/test.go | 0 .../all-platforms/go/single-go-mod-not-in-root/test.py | 2 +- .../go/single-go-work-not-in-root/{ => src}/modules/go.work | 0 .../{ => src}/modules/subdir1/go.mod | 0 .../{ => src}/modules/subdir1/go.sum | 0 .../{ => src}/modules/subdir1/subsubdir1/add.go | 0 .../{ => src}/modules/subdir1/test.go | 0 .../{ => src}/modules/subdir2/go.mod | 0 .../{ => src}/modules/subdir2/go.sum | 0 .../{ => src}/modules/subdir2/subsubdir2/add.go | 0 .../{ => src}/modules/subdir2/test.go | 0 .../all-platforms/go/single-go-work-not-in-root/test.py | 2 +- .../{ => src}/subdir0/go.mod | 0 .../{ => src}/subdir0/go.sum | 0 .../{ => src}/subdir0/subdir1/go.mod | 0 .../{ => src}/subdir0/subdir1/go.sum | 0 .../{ => src}/subdir0/subdir1/subsubdir1/add.go | 0 .../{ => src}/subdir0/subdir1/test.go | 0 .../{ => src}/subdir0/subdir2/add.go | 0 .../{ => src}/subdir0/test.go | 0 .../go/two-go-mods-nested-none-in-root/test.py | 2 +- .../go/two-go-mods-nested-one-in-root/{ => src}/go.mod | 0 .../go/two-go-mods-nested-one-in-root/{ => src}/go.sum | 0 .../two-go-mods-nested-one-in-root/{ => src}/subdir1/go.mod | 0 .../two-go-mods-nested-one-in-root/{ => src}/subdir1/go.sum | 0 .../{ => src}/subdir1/subsubdir1/add.go | 0 .../{ => src}/subdir1/test.go | 0 .../two-go-mods-nested-one-in-root/{ => src}/subdir2/add.go | 0 .../go/two-go-mods-nested-one-in-root/{ => src}/test.go | 0 .../all-platforms/go/two-go-mods-nested-one-in-root/test.py | 2 +- .../go/two-go-mods-not-nested/{ => src}/subdir1/go.mod | 0 .../go/two-go-mods-not-nested/{ => src}/subdir1/go.sum | 0 .../{ => src}/subdir1/subsubdir1/add.go | 0 .../go/two-go-mods-not-nested/{ => src}/subdir1/test.go | 0 .../go/two-go-mods-not-nested/{ => src}/subdir2/go.mod | 0 .../go/two-go-mods-not-nested/{ => src}/subdir2/go.sum | 0 .../{ => src}/subdir2/subsubdir2/add.go | 0 .../go/two-go-mods-not-nested/{ => src}/subdir2/test.go | 0 .../all-platforms/go/two-go-mods-not-nested/test.py | 2 +- 91 files changed, 27 insertions(+), 27 deletions(-) rename go/ql/integration-tests/all-platforms/go/bazel-sample-1/{ => src}/BUILD.bazel (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-1/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-1/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-1/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-1/{ => src}/todel.go (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-2/{ => src}/BUILD (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-2/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-2/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-2/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/bazel-sample-2/{ => src}/todel.go (100%) rename go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/go-mod-sample/{ => src}/Makefile (100%) rename go/ql/integration-tests/all-platforms/go/go-mod-sample/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/go-mod-sample/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/go-mod-sample/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/make-sample/{ => src}/Makefile (100%) rename go/ql/integration-tests/all-platforms/go/make-sample/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/make-sample/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/make-sample/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/make-sample/{ => src}/todel.go (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/.ninja_log (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/build.ninja (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/ninja-sample/{ => src}/todel.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/{ => src}/main.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/{ => src}/subdir/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/{ => src}/subdir/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/{ => src}/subdir/subsubdir/add.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/{ => src}/subdir/test.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/{ => src}/subdir/add.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/{ => src}/subdir/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/{ => src}/subdir/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/{ => src}/subdir/subsubdir/add.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/{ => src}/subdir/test.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/go.work (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir1/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir1/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir1/subsubdir1/add.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir1/test.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir2/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir2/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir2/subsubdir2/add.go (100%) rename go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/{ => src}/modules/subdir2/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/subdir1/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/subdir1/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/subdir1/subsubdir1/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/subdir1/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/subdir2/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/{ => src}/subdir0/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/subdir1/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/subdir1/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/subdir1/subsubdir1/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/subdir1/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/subdir2/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/{ => src}/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir1/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir1/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir1/subsubdir1/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir1/test.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir2/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir2/go.sum (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir2/subsubdir2/add.go (100%) rename go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/{ => src}/subdir2/test.go (100%) diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/BUILD.bazel b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/BUILD.bazel similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-1/BUILD.bazel rename to go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/BUILD.bazel diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/go.mod b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-1/go.mod rename to go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/go.sum b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-1/go.sum rename to go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.go b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.go rename to go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/todel.go b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/todel.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-1/todel.go rename to go/ql/integration-tests/all-platforms/go/bazel-sample-1/src/todel.go diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.expected b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.expected index 00f0cbe3e01..57ce454f2df 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.expected +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.expected @@ -1,7 +1,7 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | +| src/todel.go:0:0:0:0 | src/todel.go | htmlFiles extractionErrors | Extraction failed in test.go with error \tother declaration of test | 2 | | Extraction failed in todel.go with error test redeclared in this block | 2 | -#select -| test.go:0:0:0:0 | test.go | -| todel.go:0:0:0:0 | todel.go | diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/BUILD b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/BUILD similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-2/BUILD rename to go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/BUILD diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/go.mod b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-2/go.mod rename to go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/go.sum b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-2/go.sum rename to go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.go b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.go rename to go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/todel.go b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/todel.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/bazel-sample-2/todel.go rename to go/ql/integration-tests/all-platforms/go/bazel-sample-2/src/todel.go diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.expected b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.expected index 00f0cbe3e01..57ce454f2df 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.expected +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.expected @@ -1,7 +1,7 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | +| src/todel.go:0:0:0:0 | src/todel.go | htmlFiles extractionErrors | Extraction failed in test.go with error \tother declaration of test | 2 | | Extraction failed in todel.go with error test redeclared in this block | 2 | -#select -| test.go:0:0:0:0 | test.go | -| todel.go:0:0:0:0 | todel.go | diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.go b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.go rename to go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.expected b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.expected index 98462a92926..b77d73586b8 100644 --- a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.expected +++ b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.expected @@ -1,4 +1,4 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | htmlFiles extractionErrors -#select -| test.go:0:0:0:0 | test.go | diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py index a59be00eeb3..8e9bee2fd1f 100644 --- a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py @@ -2,4 +2,4 @@ import sys from create_database_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/Makefile b/go/ql/integration-tests/all-platforms/go/go-mod-sample/src/Makefile similarity index 100% rename from go/ql/integration-tests/all-platforms/go/go-mod-sample/Makefile rename to go/ql/integration-tests/all-platforms/go/go-mod-sample/src/Makefile diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/go.mod b/go/ql/integration-tests/all-platforms/go/go-mod-sample/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/go-mod-sample/go.mod rename to go/ql/integration-tests/all-platforms/go/go-mod-sample/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/go.sum b/go/ql/integration-tests/all-platforms/go/go-mod-sample/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/go-mod-sample/go.sum rename to go/ql/integration-tests/all-platforms/go/go-mod-sample/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.go b/go/ql/integration-tests/all-platforms/go/go-mod-sample/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/go-mod-sample/test.go rename to go/ql/integration-tests/all-platforms/go/go-mod-sample/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.expected b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.expected index 12f9e213333..b77d73586b8 100644 --- a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.expected +++ b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.expected @@ -1,4 +1,4 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | htmlFiles extractionErrors -#select -| test.go:0:0:0:0 | test.go | \ No newline at end of file diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py index a59be00eeb3..8e9bee2fd1f 100644 --- a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py @@ -2,4 +2,4 @@ import sys from create_database_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/Makefile b/go/ql/integration-tests/all-platforms/go/make-sample/src/Makefile similarity index 100% rename from go/ql/integration-tests/all-platforms/go/make-sample/Makefile rename to go/ql/integration-tests/all-platforms/go/make-sample/src/Makefile diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/go.mod b/go/ql/integration-tests/all-platforms/go/make-sample/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/make-sample/go.mod rename to go/ql/integration-tests/all-platforms/go/make-sample/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/go.sum b/go/ql/integration-tests/all-platforms/go/make-sample/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/make-sample/go.sum rename to go/ql/integration-tests/all-platforms/go/make-sample/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/test.go b/go/ql/integration-tests/all-platforms/go/make-sample/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/make-sample/test.go rename to go/ql/integration-tests/all-platforms/go/make-sample/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/todel.go b/go/ql/integration-tests/all-platforms/go/make-sample/src/todel.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/make-sample/todel.go rename to go/ql/integration-tests/all-platforms/go/make-sample/src/todel.go diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/test.expected b/go/ql/integration-tests/all-platforms/go/make-sample/test.expected index 98462a92926..b77d73586b8 100644 --- a/go/ql/integration-tests/all-platforms/go/make-sample/test.expected +++ b/go/ql/integration-tests/all-platforms/go/make-sample/test.expected @@ -1,4 +1,4 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | htmlFiles extractionErrors -#select -| test.go:0:0:0:0 | test.go | diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/test.py b/go/ql/integration-tests/all-platforms/go/make-sample/test.py index a59be00eeb3..8e9bee2fd1f 100644 --- a/go/ql/integration-tests/all-platforms/go/make-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/make-sample/test.py @@ -2,4 +2,4 @@ import sys from create_database_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/.ninja_log b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/.ninja_log similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/.ninja_log rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/.ninja_log diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/build.ninja b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/build.ninja similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/build.ninja rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/build.ninja diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/go.mod b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/go.mod rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/go.sum b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/go.sum rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.go b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/test.go rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/todel.go b/go/ql/integration-tests/all-platforms/go/ninja-sample/src/todel.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/ninja-sample/todel.go rename to go/ql/integration-tests/all-platforms/go/ninja-sample/src/todel.go diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.expected b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.expected index 98462a92926..b77d73586b8 100644 --- a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.expected +++ b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.expected @@ -1,4 +1,4 @@ +#select +| src/test.go:0:0:0:0 | src/test.go | htmlFiles extractionErrors -#select -| test.go:0:0:0:0 | test.go | diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py index a59be00eeb3..8e9bee2fd1f 100644 --- a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py @@ -2,4 +2,4 @@ import sys from create_database_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/main.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/main.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/main.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/main.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/go.mod b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/go.mod rename to go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/go.sum b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/go.sum rename to go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/subsubdir/add.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/subsubdir/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/subsubdir/add.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/subsubdir/add.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/test.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/subdir/test.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/src/subdir/test.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/go.mod b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/go.mod rename to go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/go.sum b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/go.sum rename to go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/subdir/add.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/subdir/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/subdir/add.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/subdir/add.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/go.mod b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/go.mod rename to go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/go.sum b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/go.sum rename to go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/subsubdir/add.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/subsubdir/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/subsubdir/add.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/subsubdir/add.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/test.go b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/subdir/test.go rename to go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/src/subdir/test.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/go.work b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/go.work similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/go.work rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/go.work diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/go.mod b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/go.mod rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/go.sum b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/go.sum rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/subsubdir1/add.go b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/subsubdir1/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/subsubdir1/add.go rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/subsubdir1/add.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/test.go b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir1/test.go rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir1/test.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/go.mod b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/go.mod rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/go.sum b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/go.sum rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/subsubdir2/add.go b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/subsubdir2/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/subsubdir2/add.go rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/subsubdir2/add.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/test.go b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/modules/subdir2/test.go rename to go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/src/modules/subdir2/test.go diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/subsubdir1/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/subsubdir1/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/subsubdir1/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/subsubdir1/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir1/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir1/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir2/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir2/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/subdir2/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/subdir2/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/subdir0/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/src/subdir0/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/subsubdir1/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/subsubdir1/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/subsubdir1/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/subsubdir1/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir1/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir1/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir2/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir2/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/subdir2/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/subdir2/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/src/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/subsubdir1/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/subsubdir1/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/subsubdir1/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/subsubdir1/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir1/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir1/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/go.mod b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/go.mod rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/go.sum b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/go.sum similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/go.sum rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/go.sum diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/subsubdir2/add.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/subsubdir2/add.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/subsubdir2/add.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/subsubdir2/add.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/test.go b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/test.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/subdir2/test.go rename to go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/src/subdir2/test.go diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py index 71ace021c22..3ba0e19d445 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py @@ -3,6 +3,6 @@ import sys from create_database_utils import * from diagnostics_test_utils import * -run_codeql_database_create([], lang="go") +run_codeql_database_create([], lang="go", source="src") check_diagnostics() From c00520011c6cc43403e7ad9b113be79595eebcbf Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 17 Jan 2024 14:38:08 +0000 Subject: [PATCH 2/3] Go: Install integration test dependencies to local GOPATH --- .../all-platforms/go/bazel-sample-1/test.py | 12 +++++++++++- .../all-platforms/go/bazel-sample-2/test.py | 12 +++++++++++- .../build-constraints-exclude-all-go-files/test.py | 11 ++++++++++- .../diagnostics/go-files-found-not-processed/test.py | 11 ++++++++++- .../go/diagnostics/newer-go-version-needed/test.py | 11 ++++++++++- .../go/diagnostics/no-go-files-found/test.py | 11 ++++++++++- .../package-not-found-with-go-mod/test.py | 11 ++++++++++- .../package-not-found-without-go-mod/test.py | 11 ++++++++++- .../go/diagnostics/unsupported-relative-path/test.py | 11 ++++++++++- .../go/go-get-without-modules-sample/test.py | 11 ++++++++++- .../all-platforms/go/go-mod-sample/test.py | 11 ++++++++++- .../all-platforms/go/make-sample/test.py | 11 ++++++++++- .../all-platforms/go/ninja-sample/test.py | 11 ++++++++++- .../single-go-mod-and-go-files-not-under-it/test.py | 11 ++++++++++- .../all-platforms/go/single-go-mod-in-root/test.py | 11 ++++++++++- .../go/single-go-mod-not-in-root/test.py | 11 ++++++++++- .../go/single-go-work-not-in-root/test.py | 11 ++++++++++- .../go/two-go-mods-nested-none-in-root/test.py | 11 ++++++++++- .../go/two-go-mods-nested-one-in-root/test.py | 11 ++++++++++- .../all-platforms/go/two-go-mods-not-nested/test.py | 11 ++++++++++- 20 files changed, 202 insertions(+), 20 deletions(-) diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py index 3ba0e19d445..d462e06318e 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py @@ -1,8 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath + run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py index 3ba0e19d445..d462e06318e 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py @@ -1,8 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath + run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py index 9f34f431b93..2831e004f5d 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py index 2f43492da41..1646c52fb3a 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py index 2f43492da41..1646c52fb3a 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py index 2f43492da41..1646c52fb3a 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py index 9f34f431b93..2831e004f5d 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py index 9f34f431b93..2831e004f5d 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['LGTM_INDEX_IMPORT_PATH'] = "test" run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py index be9ec6f5b7a..e3282391bfd 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py @@ -1,9 +1,18 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath os.environ['GITHUB_REPOSITORY'] = "a/b" run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully) check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py index 8e9bee2fd1f..1746da8e00b 100644 --- a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py @@ -1,5 +1,14 @@ -import sys +import os +import subprocess from create_database_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py index 8e9bee2fd1f..1746da8e00b 100644 --- a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py @@ -1,5 +1,14 @@ -import sys +import os +import subprocess from create_database_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/test.py b/go/ql/integration-tests/all-platforms/go/make-sample/test.py index 8e9bee2fd1f..1746da8e00b 100644 --- a/go/ql/integration-tests/all-platforms/go/make-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/make-sample/test.py @@ -1,5 +1,14 @@ -import sys +import os +import subprocess from create_database_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py index 8e9bee2fd1f..1746da8e00b 100644 --- a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py @@ -1,5 +1,14 @@ -import sys +import os +import subprocess from create_database_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py index 3ba0e19d445..9b0e1bdf70f 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py @@ -1,8 +1,17 @@ -import sys +import os +import subprocess from create_database_utils import * from diagnostics_test_utils import * +# Set up a GOPATH relative to this test's root directory; +# we set os.environ instead of using extra_env because we +# need it to be set for the call to "go clean -modcache" later +goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") +os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") check_diagnostics() + +# Clean up the temporary GOPATH +subprocess.call(["go", "clean", "-modcache"]) From 783f006d62f762acc7e566526e6df4b61a5ba62f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 17 Jan 2024 16:03:46 +0000 Subject: [PATCH 3/3] Go: Update `go clean -modcache` comment --- .../integration-tests/all-platforms/go/bazel-sample-1/test.py | 3 ++- .../integration-tests/all-platforms/go/bazel-sample-2/test.py | 3 ++- .../diagnostics/build-constraints-exclude-all-go-files/test.py | 3 ++- .../go/diagnostics/go-files-found-not-processed/test.py | 3 ++- .../go/diagnostics/newer-go-version-needed/test.py | 3 ++- .../all-platforms/go/diagnostics/no-go-files-found/test.py | 3 ++- .../go/diagnostics/package-not-found-with-go-mod/test.py | 3 ++- .../go/diagnostics/package-not-found-without-go-mod/test.py | 3 ++- .../go/diagnostics/unsupported-relative-path/test.py | 3 ++- .../all-platforms/go/go-get-without-modules-sample/test.py | 3 ++- go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py | 3 ++- go/ql/integration-tests/all-platforms/go/make-sample/test.py | 3 ++- go/ql/integration-tests/all-platforms/go/ninja-sample/test.py | 3 ++- .../go/single-go-mod-and-go-files-not-under-it/test.py | 3 ++- .../all-platforms/go/single-go-mod-in-root/test.py | 3 ++- .../all-platforms/go/single-go-mod-not-in-root/test.py | 3 ++- .../all-platforms/go/single-go-work-not-in-root/test.py | 3 ++- .../all-platforms/go/two-go-mods-nested-none-in-root/test.py | 3 ++- .../all-platforms/go/two-go-mods-nested-one-in-root/test.py | 3 ++- .../all-platforms/go/two-go-mods-not-nested/test.py | 3 ++- 20 files changed, 40 insertions(+), 20 deletions(-) diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py index d462e06318e..91e95c1aeb6 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py index d462e06318e..91e95c1aeb6 100644 --- a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py index 2831e004f5d..8364349c22c 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py index 1646c52fb3a..778af4464c7 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None, runFunction=ru check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py index 1646c52fb3a..778af4464c7 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None, runFunction=ru check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py index 1646c52fb3a..778af4464c7 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None, runFunction=ru check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py index 2831e004f5d..8364349c22c 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py index 2831e004f5d..8364349c22c 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None) check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py index e3282391bfd..21a6cd40ef7 100644 --- a/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/test.py @@ -14,5 +14,6 @@ run_codeql_database_create([], lang="go", source="work", db=None, runFunction=ru check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py index 1746da8e00b..481759285e2 100644 --- a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/test.py @@ -10,5 +10,6 @@ goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py index 1746da8e00b..481759285e2 100644 --- a/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/go-mod-sample/test.py @@ -10,5 +10,6 @@ goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/test.py b/go/ql/integration-tests/all-platforms/go/make-sample/test.py index 1746da8e00b..481759285e2 100644 --- a/go/ql/integration-tests/all-platforms/go/make-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/make-sample/test.py @@ -10,5 +10,6 @@ goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py index 1746da8e00b..481759285e2 100644 --- a/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py +++ b/go/ql/integration-tests/all-platforms/go/ninja-sample/test.py @@ -10,5 +10,6 @@ goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") os.environ['GOPATH'] = goPath run_codeql_database_create([], lang="go", source="src") -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"]) diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py index 9b0e1bdf70f..43c7d1b38e8 100644 --- a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/test.py @@ -13,5 +13,6 @@ run_codeql_database_create([], lang="go", source="src") check_diagnostics() -# Clean up the temporary GOPATH +# Clean up the temporary GOPATH to prevent Bazel failures next +# time the tests are run; see https://github.com/golang/go/issues/27161 subprocess.call(["go", "clean", "-modcache"])