mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-11-23 15:11:15 +08:00
Why:
PR CI previously left six production-critical paths unverified:
1. .github/workflows/app.yml ran without PostgreSQL/ParadeDB or Redis service
containers and left WEKNORA_*_POSTGRES_DSN / WEKNORA_TEST_REDIS_ADDR unset,
causing all PostgreSQL migration, row-locking, pgvector, catalog, and
multi-replica Redis tests to 100% t.Skip (masking a step-down regression in
TestPostgresMigrationsServeAgentHistory once migrations >000106 were added).
2. app.yml invoked go vet/test without -tags sqlite_fts5, causing SQLite FTS5
retriever tests under internal/application/repository/retriever/sqlite to
100% t.Skip.
3. Desktop build-tag checks only ran ./internal/container, missing
./internal/application/service, ./cmd/desktop, and darwin/windows
cross-compilation of ./internal/localsandbox/{seatbelt,winhost}, while
release-lite.yml remained pinned to GO_VERSION=1.24 (go.mod requires 1.26.0).
4. The standalone client/ Go SDK module was excluded by app.yml (!client/**)
and ignored by cli.yml / cli-e2e.yml / pre-push hooks despite cli/
depending on ../client (masking unformatted files and a Unix-only 0o640
permission assertion on Windows in client/).
5. High-concurrency packages (internal/stream, internal/sandbox,
internal/agent, internal/im) ran without -race, and PR CI had no
zero-external-dependency Lite mode end-to-end smoke test.
What:
- Provision paradedb/paradedb:v0.25.11-pg17 and redis:7.0-alpine services in
app.yml, create isolated disposable test databases, and inject all
PostgreSQL/Redis test DSNs with WEKNORA_REQUIRE_INTEGRATION=1; fix
TestPostgresMigrationsServeAgentHistory to migrate down before 000106 and
back up instead of stepping -1 from HEAD.
- Pass -tags sqlite_fts5 across app.yml and git hooks while keeping an explicit
non-FTS5 run for TestSaveWorksWhenTheFTS5ModuleIsNotCompiledIn.
- Vet, test, and build ./internal/container, ./internal/application/service,
and ./cmd/desktop with -tags desktop,sqlite_fts5; isolate cgo-only pg_query
and gojieba bindings behind !cgo stubs so darwin/arm64 and windows/amd64
cross-compilation of ./internal/localsandbox/... runs on Linux CI; align
release-lite.yml GO_VERSION to 1.26.
- Watch client/** in cli.yml, cli-e2e.yml, and git pre-push hooks, running
client gofmt, build, vet, and -race tests across Linux, macOS, and Windows,
and fix the pre-existing gofmt drift and Windows permission assertion in
client/ uncovered by the new gate.
- Enable -race on internal/{stream,sandbox,agent,im}/... and add
tests/lite_smoke/lite_e2e_test.go exercising a real WeKnora-lite subprocess
end-to-end (auth, models, KB, Markdown upload/indexing, vector+FTS5 search,
SSE RAG chat, message persistence, and SIGTERM shutdown).
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: CLI E2E
|
|
|
|
# Runs the cli/acceptance/e2e/ suite against a real WeKnora server.
|
|
# Cost-gated so it doesn't fire on every PR:
|
|
# - workflow_dispatch: maintainer can trigger manually
|
|
# - pull_request labeled "acceptance-e2e": adding the label kicks a run
|
|
#
|
|
# Required repo secrets (only set on Tencent/WeKnora; cross-fork PRs have no
|
|
# access and the job exits early via the secrets-present guard):
|
|
# WEKNORA_E2E_HOST - https URL of the test server
|
|
# WEKNORA_E2E_TOKEN - bearer token / API key for that host
|
|
#
|
|
# Mirrors gh acceptance/ trigger pattern: env-gated, opt-in, single matrix.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
types: [labeled, synchronize]
|
|
paths:
|
|
- 'cli/**'
|
|
- 'client/**'
|
|
- '.github/workflows/cli-e2e.yml'
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: cli
|
|
shell: bash
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
e2e:
|
|
name: rag full loop
|
|
# Skip auto-trigger on label-add unless the label is exactly "acceptance-e2e".
|
|
# Manual workflow_dispatch always runs.
|
|
if: |
|
|
github.event_name == 'workflow_dispatch' ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'acceptance-e2e'))
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.26'
|
|
cache-dependency-path: cli/go.sum
|
|
|
|
- name: secrets present
|
|
id: secrets
|
|
env:
|
|
E2E_HOST: ${{ secrets.WEKNORA_E2E_HOST }}
|
|
E2E_TOKEN: ${{ secrets.WEKNORA_E2E_TOKEN }}
|
|
run: |
|
|
if [ -z "$E2E_HOST" ] || [ -z "$E2E_TOKEN" ]; then
|
|
echo "::warning::WEKNORA_E2E_HOST or WEKNORA_E2E_TOKEN not set; skipping e2e."
|
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: go test -tags=acceptance_e2e
|
|
if: steps.secrets.outputs.skip == 'false'
|
|
env:
|
|
WEKNORA_E2E_HOST: ${{ secrets.WEKNORA_E2E_HOST }}
|
|
WEKNORA_E2E_TOKEN: ${{ secrets.WEKNORA_E2E_TOKEN }}
|
|
run: go test -tags=acceptance_e2e -v -timeout=8m ./acceptance/e2e/...
|