test: add metering E2E integration tests + Ollama CI tier#1208
Closed
pyramation wants to merge 3 commits into
Closed
test: add metering E2E integration tests + Ollama CI tier#1208pyramation wants to merge 3 commits into
pyramation wants to merge 3 commits into
Conversation
Test #3 from constructive-planning#911: full metering pipeline tests. Metering E2E tests (15 tests): - Config resolution: getLlmBillingConfig reads metaschema tables - Billing functions: check_billing_quota + record_usage SQL stubs - Inference log: logInferenceUsage writes correct fields - meteredEmbed with mock embedder: quota check, record_usage, quota exceeded, request_id propagation - meteredEmbed with real Ollama: live inference + billing pipeline (skipped when Ollama unavailable) CI Tier 4 (ollama-tests): - PostgreSQL + Ollama service containers - Pulls nomic-embed-text model before test run - Runs graphile-llm full test suite including Ollama E2E
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This comment has been minimized.
This comment has been minimized.
Contributor
|
Closing — metering E2E tests should live in constructive-db where the real billing infrastructure exists, not stub SQL in the open source repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test #3 from constructive-planning#911: full metering pipeline E2E tests + new Ollama CI tier.
Metering E2E tests (
metering-e2e.test.ts, 15 tests)Config resolution (3 tests):
getLlmBillingConfigresolves billing + inference log config from metaschema tablesBilling functions (4 tests):
check_billing_quotareturns true when unlimited (no credits row)record_usagewrites to balance + ledger with metadataInference log (1 test):
logInferenceUsageinserts row with all fields (service, operation, cache tokens, etc.)meteredEmbed with mock embedder (4 tests):
quotaExceededwhen limit reachedrequest_idpropagates to billing ledger metadatameteredEmbed with real Ollama (3 tests, skipped when unavailable):
CI Tier 4 — Ollama tests (
run-tests.yaml)New CI job with PostgreSQL + Ollama service containers:
bash /dev/tcphealth check (Ollama image doesn't havecurl)nomic-embed-textmodel before test runmetering-e2etests (existinggraphile-llm.test.tstests require schema setup from pg-tests tier)Test infrastructure (
metering-setup.sql)Minimal stub schemas matching what
config-cache.tsqueries:metaschema_modules_public.billing_module+inference_log_modulecheck_billing_quota+record_usagefunctionsusage_public.usage_log_inferencestableReview & Testing Checklist for Human
metering-setup.sqlstub functions match the real billing function signaturesnomic-embed-textis a reasonable model choice for CI (small, fast)Notes
describe.skip'd whenSKIP_OLLAMA_TESTS=1or Ollama is unreachable — safe for local devCREATE FUNCTION(notCREATE OR REPLACE) — these are test-only stubs in ephemeral databasesLink to Devin session: https://app.devin.ai/sessions/2b5a29d83d3f478e8d3d972653b4879c
Requested by: @pyramation