From 3acab640b2b990857f9ecad64a8ee166bc109310 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 20 Aug 2024 17:07:09 +0100 Subject: [PATCH] Add configure-baseline integration test --- .../go/configure-baseline/src/a/vendor/avendor.go | 1 + .../go/configure-baseline/src/a/vendor/modules.txt | 0 .../go/configure-baseline/src/b/vendor/bvendor.go | 1 + .../go/configure-baseline/src/b/vendor/modules.txt | 0 .../go/configure-baseline/src/c/vendor/cvendor.go | 1 + .../all-platforms/go/configure-baseline/src/root.go | 1 + .../all-platforms/go/configure-baseline/test.py | 9 +++++++++ 7 files changed, 13 insertions(+) create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/avendor.go create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/modules.txt create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/bvendor.go create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/modules.txt create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/c/vendor/cvendor.go create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/src/root.go create mode 100644 go/ql/integration-tests/all-platforms/go/configure-baseline/test.py diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/avendor.go b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/avendor.go new file mode 100644 index 000000000000..6e423a610721 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/avendor.go @@ -0,0 +1 @@ +package abc diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/modules.txt b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/a/vendor/modules.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/bvendor.go b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/bvendor.go new file mode 100644 index 000000000000..6e423a610721 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/bvendor.go @@ -0,0 +1 @@ +package abc diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/modules.txt b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/b/vendor/modules.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/c/vendor/cvendor.go b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/c/vendor/cvendor.go new file mode 100644 index 000000000000..6e423a610721 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/c/vendor/cvendor.go @@ -0,0 +1 @@ +package abc diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/src/root.go b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/root.go new file mode 100644 index 000000000000..6e423a610721 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/configure-baseline/src/root.go @@ -0,0 +1 @@ +package abc diff --git a/go/ql/integration-tests/all-platforms/go/configure-baseline/test.py b/go/ql/integration-tests/all-platforms/go/configure-baseline/test.py new file mode 100644 index 000000000000..ea4143496662 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/configure-baseline/test.py @@ -0,0 +1,9 @@ +import os.path +import json + +def test(codeql, go): + codeql.database.init(source_root="src") + baseline_info_path = os.path.join("test-db", "baseline-info.json") + with open(baseline_info_path, "r") as f: + baseline_info = json.load(f) + assert set(baseline_info["languages"]["go"]["files"]) == set(["root.go", os.path.join("c", "vendor", "cvendor.go")]), "Expected root.go and cvendor.go in baseline"