From 659eaf88ff15d81b839260e8be71b0cc70f6abf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Fri, 21 Mar 2025 09:16:46 +0100 Subject: [PATCH] Go: add RTJO language tests CI job Triggered by adding label "Run: RTJO Language Tests" --- .github/workflows/go-tests-rtjo.yml | 22 ++++++++++++++++++++++ go/Makefile | 4 ++-- go/actions/test/action.yml | 6 +++++- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/go-tests-rtjo.yml diff --git a/.github/workflows/go-tests-rtjo.yml b/.github/workflows/go-tests-rtjo.yml new file mode 100644 index 00000000000..43721fa1011 --- /dev/null +++ b/.github/workflows/go-tests-rtjo.yml @@ -0,0 +1,22 @@ +name: "Go: Run RTJO Tests" +on: + pull_request: + types: + - labeled + +permissions: + contents: read + +jobs: + test-linux: + if: "github.repository_owner == 'github' && github.event.label.name == 'Run: RTJO Language Tests'" + name: RTJO Test Linux (Ubuntu) + runs-on: ubuntu-latest-xl + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Run tests + uses: ./go/actions/test + with: + run-code-checks: true + dynamic-join-order-mode: all diff --git a/go/Makefile b/go/Makefile index 821ab49fc2a..b32b61bc5c3 100644 --- a/go/Makefile +++ b/go/Makefile @@ -52,9 +52,9 @@ ql/lib/go.dbscheme.stats: ql/lib/go.dbscheme build/stats/src.stamp extractor codeql dataset measure -o $@ build/stats/database/db-go test: all build/testdb/check-upgrade-path - codeql test run -j0 ql/test --search-path .. --consistency-queries ql/test/consistency --compilation-cache=$(cache) + codeql test run -j0 ql/test --search-path .. --consistency-queries ql/test/consistency --compilation-cache=$(cache) --dynamic-join-order-mode=$(rtjo) # use GOOS=linux because GOOS=darwin GOARCH=386 is no longer supported - env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path .. --consistency-queries ql/test/consistency --compilation-cache=$(cache) + env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path .. --consistency-queries ql/test/consistency --compilation-cache=$(cache) --dynamic-join-order-mode=$(rtjo) cd extractor; $(BAZEL) test ... bash extractor-smoke-test/test.sh || (echo "Extractor smoke test FAILED"; exit 1) diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml index 9ab7f9becfb..667ee4751ba 100644 --- a/go/actions/test/action.yml +++ b/go/actions/test/action.yml @@ -9,6 +9,10 @@ inputs: description: Whether to run formatting, code and qhelp generation checks required: false default: false + dynamic-join-order-mode: + description: Value of the --dynamic-join-order-mode flag to pass to the codeql test command + required: false + default: "none" runs: using: composite steps: @@ -74,4 +78,4 @@ runs: shell: bash run: | cd go - make test cache="${{ steps.query-cache.outputs.cache-dir }}" + make test cache="${{ steps.query-cache.outputs.cache-dir }}" rtjo=${{ inputs.dynamic-join-order-mode }}