From 3b1273bb86342427c9e84a6c7dbef629ef64e57f Mon Sep 17 00:00:00 2001 From: Taus Date: Thu, 7 Mar 2024 13:43:08 +0000 Subject: [PATCH] Python: Fix CLI integration tests Two issues: - Tests relying on existing query machinery (i.e. `import python`) were not resolving correctly due to a bad `qlpack.yml` file. - The diagnostics output tests needed an updated import to account for their new location. --- codeql-workspace.yml | 1 + .../writing-diagnostics/test_diagnostics_output.py | 2 +- python/extractor/qlpack.yml | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/codeql-workspace.yml b/codeql-workspace.yml index 5d8b300c8f4a..7078818d1f31 100644 --- a/codeql-workspace.yml +++ b/codeql-workspace.yml @@ -6,6 +6,7 @@ provide: - "*/ql/consistency-queries/qlpack.yml" - "*/ql/automodel/src/qlpack.yml" - "*/ql/automodel/test/qlpack.yml" + - "python/extractor/qlpack.yml" - "shared/**/qlpack.yml" - "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml" - "go/ql/config/legacy-support/qlpack.yml" diff --git a/python/extractor/cli-integration-test/writing-diagnostics/test_diagnostics_output.py b/python/extractor/cli-integration-test/writing-diagnostics/test_diagnostics_output.py index 39982596fc5e..0dce022a0f95 100644 --- a/python/extractor/cli-integration-test/writing-diagnostics/test_diagnostics_output.py +++ b/python/extractor/cli-integration-test/writing-diagnostics/test_diagnostics_output.py @@ -1,6 +1,6 @@ import os import sys -sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "integration-tests")) +sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "..", "integration-tests")) import diagnostics_test_utils test_db = "db" diff --git a/python/extractor/qlpack.yml b/python/extractor/qlpack.yml index 783c301abbb2..88164c64ee80 100644 --- a/python/extractor/qlpack.yml +++ b/python/extractor/qlpack.yml @@ -1,6 +1,6 @@ name: extractor-python dependencies: - codeql/python-all: "*" - codeql/python-queries: "*" + codeql/python-all: ${workspace} + codeql/python-queries: ${workspace} extractor: python warnOnImplicitThis: true