From ed801e7ab49256b394e9c2adb12a57f2d7744df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Fri, 21 Mar 2025 09:14:16 +0100 Subject: [PATCH 1/2] Ruby: add RTJO language test CI job Triggered by adding "Run: RTJO Language Tests" label. --- .github/workflows/ruby-qltest-rtjo.yml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ruby-qltest-rtjo.yml diff --git a/.github/workflows/ruby-qltest-rtjo.yml b/.github/workflows/ruby-qltest-rtjo.yml new file mode 100644 index 000000000000..d7d1724cd4b6 --- /dev/null +++ b/.github/workflows/ruby-qltest-rtjo.yml @@ -0,0 +1,40 @@ +name: "Ruby: Run RTJO Language Tests" + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + +env: + CARGO_TERM_COLOR: always + +defaults: + run: + working-directory: ruby + +permissions: + contents: read + +jobs: + qltest-rtjo: + if: "github.repository_owner == 'github' && github.event.label.name == 'Run: RTJO Language Tests'" + runs-on: ubuntu-latest-xl + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/fetch-codeql + - uses: ./ruby/actions/create-extractor-pack + - name: Cache compilation cache + id: query-cache + uses: ./.github/actions/cache-query-compilation + with: + key: ruby-qltest + - name: Run QL tests + run: | + codeql test run --dynamic-join-order-mode=all --threads=0 --ram 50000 --search-path "${{ github.workspace }}" --check-databases --check-undefined-labels --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" + env: + GITHUB_TOKEN: ${{ github.token }} 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 2/2] 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 000000000000..43721fa1011a --- /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 821ab49fc2a0..b32b61bc5c38 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 9ab7f9becfb0..667ee4751ba9 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 }}