Skip to content

chore(topk): improvements to reduce alloc bytes and alloc space #102

chore(topk): improvements to reduce alloc bytes and alloc space

chore(topk): improvements to reduce alloc bytes and alloc space #102

name: LogQL correctness tests
on:
schedule:
- cron: "30 2 * * 1-5" # Mon-Fri at 2.30am UTC
pull_request:
paths:
- "pkg/engine/**"
- "pkg/dataobj/**"
workflow_dispatch:
inputs:
ref:
description: "Git ref to run correctness tests on"
required: false
default: "main"
type: "string"
failfast:
description: "Fail fast on first test failure"
required: false
default: true
type: "boolean"
permissions: {}
jobs:
generate-testdata:
name: Generate test data
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.24.8"
# The metastore generates invalid filenames for Windows (with colons),
# which get rejected by upload-artifact. We zip these files to avoid this
# issue.
- name: Generate test data
run: make generate && zip -r data.zip data/
working-directory: ./pkg/logql/bench
- name: Upload test data
uses: actions/upload-artifact@v4
with:
name: logql-bench-testdata-${{ steps.checkout.outputs.commit }}
path: ./pkg/logql/bench/data.zip
retention-days: 7
tests:
name: Run correctness tests for ${{ matrix.store }}
runs-on: github-hosted-ubuntu-arm64-large
needs: generate-testdata
timeout-minutes: 60
strategy:
matrix:
store: [dataobj-engine]
range_type: [instant, range]
fail-fast: false # Continue testing other stores if one fails
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Download test data
uses: actions/download-artifact@v4
with:
name: logql-bench-testdata-${{ steps.checkout.outputs.commit }}
path: ./pkg/logql/bench
- name: Unzip test data
run: unzip data.zip
working-directory: ./pkg/logql/bench
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.24.8"
- name: Create results directory
run: mkdir -p ./pkg/logql/bench/results
- name: Run tests
shell: bash # Use bash shell to propagate pipe failures
run: |
go test \
-v -slow-tests -timeout=60m \
-run=TestStorageEquality/query=.+/kind=.+/store=${{ matrix.store }}$ \
${{ matrix.range_type == 'instant' && '-range-type=instant' || '' }} \
${{ inputs.failfast == true && '-failfast' || '' }} \
| tee results/results.txt
working-directory: ./pkg/logql/bench
- name: Upload results
uses: actions/upload-artifact@v4
if: always() # Upload results even if one of the test tests fails
with:
name: logql-bench-results-${{ matrix.store }}-${{ matrix.range_type }}-${{ steps.checkout.outputs.commit }}
path: ./pkg/logql/bench/results
retention-days: 7