Swift: prepare integration tests for internal running

This harmonizes Swift integration tests with the rest of the repository,
to prepare for the internal integration test runner to run them. The
stripped down runner is kept compatible, so that current CI can still
use it now. Maybe it will be kept for developer use.

This PR includes:
* moving the integration tests inside `ql`
* editing `qlpack.yml` so that the internal runner can use it
* change database directory to be `test-db` rather than `db`
This commit is contained in:
Paolo Tranquilli
2024-03-25 10:17:55 +01:00
parent 45ce988943
commit 762b4ce42e
164 changed files with 18 additions and 18 deletions

View File

@@ -18,7 +18,7 @@ runs:
- name: Run integration tests - name: Run integration tests
shell: bash shell: bash
run: | run: |
python swift/integration-tests/runner.py --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" python swift/ql/integration-tests/runner.py --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
env: env:
SEMMLE_DEBUG_TRACER: 10000 SEMMLE_DEBUG_TRACER: 10000
- name: Upload test logs - name: Upload test logs
@@ -27,5 +27,5 @@ runs:
with: with:
name: swift-integration-tests-logs-${{ runner.os }} name: swift-integration-tests-logs-${{ runner.os }}
path: | path: |
swift/integration-tests/**/db/log swift/ql/integration-tests/**/db/log
retention-days: 1 retention-days: 1

View File

@@ -1,7 +0,0 @@
name: integration-tests-swift
version: 0.0.0
dependencies:
codeql/swift-all: ${workspace}
tests: .
extractor: swift
warnOnImplicitThis: true

View File

@@ -6,5 +6,5 @@ xcuserdata/
DerivedData/ DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
*.actual *.actual
db test-db
*.swiftmodule *.swiftmodule

View File

@@ -27,8 +27,8 @@ def runUnsuccessfully(cmd):
def run_codeql_database_create(cmds, lang, keep_trap=True, db=None, runFunction=runSuccessfully): def run_codeql_database_create(cmds, lang, keep_trap=True, db=None, runFunction=runSuccessfully):
""" db parameter is here solely for compatibility with the internal test runner """ """ db parameter is here solely for compatibility with the internal test runner """
assert lang == 'swift' assert lang == 'swift'
codeql_root = pathlib.Path(__file__).parents[2] codeql_root = pathlib.Path(__file__).parents[3]
shutil.rmtree("db", ignore_errors=True) shutil.rmtree("test-db", ignore_errors=True)
cmd = [ cmd = [
"codeql", "database", "create", "codeql", "database", "create",
"-s", ".", "-l", "swift", f"--search-path={codeql_root}", "--no-cleanup", "-s", ".", "-l", "swift", f"--search-path={codeql_root}", "--no-cleanup",
@@ -37,5 +37,5 @@ def run_codeql_database_create(cmds, lang, keep_trap=True, db=None, runFunction=
cmd.append("--keep-trap") cmd.append("--keep-trap")
for c in cmds: for c in cmds:
cmd += ["-c", c] cmd += ["-c", c]
cmd.append("db") cmd.append("test-db")
runFunction(cmd) runFunction(cmd)

Some files were not shown because too many files have changed in this diff Show More