Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI configuration for SQLite without pushdown #3381

Merged
merged 7 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,17 @@ jobs:
git diff --exit-code

integration:
name: Integration ${{ matrix.name }} ${{ matrix.shard_index }}/${{ matrix.shard_total }}
name: >
Integration ${{ matrix.name }} ${{ matrix.shard_index }}/${{ matrix.shard_total }}
(pushdown=${{ !(matrix.disable_filter_pushdown || false) }})
runs-on:
group: paid
timeout-minutes: 20

# Do not run this job in parallel for any PR change or branch push
# to save some resources.
concurrency:
group: ${{ github.workflow }}-integration-${{ matrix.name }}-${{ matrix.shard_index }}-${{ github.head_ref || github.ref_name }}
group: ${{ github.workflow }}-integration-${{ matrix.name }}-${{ matrix.shard_index }}-${{ matrix.disable_filter_pushdown || false }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready')
Expand All @@ -185,6 +187,12 @@ jobs:
- { name: "SQLite", task: "sqlite", shard_index: 2, shard_total: 3 }
- { name: "SQLite", task: "sqlite", shard_index: 3, shard_total: 3 }

# move that to cron-only workflow
# TODO https://github.com/FerretDB/FerretDB/issues/3126
- { name: "SQLite", task: "sqlite", shard_index: 1, shard_total: 3, disable_filter_pushdown: true }
- { name: "SQLite", task: "sqlite", shard_index: 2, shard_total: 3, disable_filter_pushdown: true }
- { name: "SQLite", task: "sqlite", shard_index: 3, shard_total: 3, disable_filter_pushdown: true }

steps:
- name: Setup permissions monitoring
uses: GitHubSecurityLab/actions-permissions/monitor@v1
Expand Down Expand Up @@ -214,8 +222,14 @@ jobs:
- name: Wait for and setup environment
run: bin/task env-setup

- name: Run ${{ matrix.name }} tests (${{ matrix.shard_index }}/${{ matrix.shard_total }})
run: bin/task test-integration-${{ matrix.task }} SHARD_INDEX=${{ matrix.shard_index }} SHARD_TOTAL=${{ matrix.shard_total }}
- name: >
Run ${{ matrix.name }} tests
(${{ matrix.shard_index }}/${{ matrix.shard_total }}, pushdown=${{ !(matrix.disable_filter_pushdown || false) }})
run: >
bin/task test-integration-${{ matrix.task }}
SHARD_INDEX=${{ matrix.shard_index }}
SHARD_TOTAL=${{ matrix.shard_total }}
DISABLE_FILTER_PUSHDOWN=${{ matrix.disable_filter_pushdown || false }}
env:
GOFLAGS: ${{ runner.debug == '1' && '-v' || '' }}

Expand All @@ -232,15 +246,15 @@ jobs:
with:
token: 22159d7c-856d-4fe9-8fdb-5d9ecff35514
files: ./integration/integration-${{ matrix.task }}.txt
flags: integration,${{ matrix.task }}-${{ matrix.shard_index }}
flags: integration,${{ matrix.task }}-${{ matrix.shard_index }},pushdown-${{ !(matrix.disable_filter_pushdown || false) }}
fail_ci_if_error: true
verbose: true

- name: Upload coverage information to coveralls
uses: coverallsapp/github-action@v2
with:
file: ./integration/integration-${{ matrix.task }}.txt
flag-name: integration-${{ matrix.task }}-${{ matrix.shard_index }}
flag-name: integration-${{ matrix.task }}-${{ matrix.shard_index }}-pushdown-${{ !(matrix.disable_filter_pushdown || false) }}
parallel: true

# we don't want them on CI
Expand Down
6 changes: 4 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
vars:
SHARD_INDEX: 1
SHARD_TOTAL: 1
DISABLE_FILTER_PUSHDOWN: false
TEST_RUN: ""
TEST_TIMEOUT: 35m
BENCH_TIME: 5s
Expand Down Expand Up @@ -205,7 +206,7 @@ tasks:
sh: go run -C .. ./cmd/envtool tests shard --index={{.SHARD_INDEX}} --total={{.SHARD_TOTAL}}

test-integration-sqlite:
desc: "Run integration tests for `sqlite` handler"
desc: "Run integration tests for `sqlite` backend"
dir: integration
cmds:
- >
Expand All @@ -215,6 +216,7 @@ tasks:
-sqlite-url=file:../tmp/sqlite-tests/
-target-tls
-compat-url='mongodb://username:password@127.0.0.1:47018/?tls=true&tlsCertificateKeyFile=../build/certs/client.pem&tlsCaFile=../build/certs/rootCA-cert.pem'
-disable-filter-pushdown={{.DISABLE_FILTER_PUSHDOWN}}
vars:
SHARD_RUN:
sh: go run -C .. ./cmd/envtool tests shard --index={{.SHARD_INDEX}} --total={{.SHARD_TOTAL}}
Expand Down Expand Up @@ -569,7 +571,7 @@ tasks:
fmt-yaml:
desc: "Format YAML files"
cmds:
- docker compose run --rm prettier --write --parser=yaml "**/*.yml"
- docker compose run --rm prettier --write --parser=yaml --print-width=120 "**/*.yml"

docs:
desc: "Format, lint and build documentation"
Expand Down