CodeMie Test Harness
End-to-end, integration, and UI test suite for CodeMie services. Test LLM assistants, workflows, tools, and integrations with a user-friendly CLI or pytest.
Quick Start
# Install and launch interactive mode
pip install codemie-test-harness
codemie-test-harness
# Or run without installing
uvx codemie-test-harness
First time? The CLI guides you through setup. Just select Configuration → Setup and follow the prompts.
Running tests? Choose Run Tests → Run Test Suite → smoke for a quick 5-10 minute validation.
Requirements
- Python: 3.9 or higher
- Platform: Linux, macOS, Windows (WSL recommended)
- For UI tests: Playwright browsers (
playwright install) - Settings: every setting comes from a source you control (environment variable, config file,
.env). An AWS Parameter Store is used only when you enable it (see Settings sources and secret store).
No AWS account is needed by default. The harness makes no AWS call unless
HARNESS_SECRET_STORE=aws-parameter-storeis set.
Table of Contents
- Quick Start
- Requirements
- Part 1: Interactive CLI (Recommended)
- Complete Example: First Test Run
- Part 2: Running with pytest
- Troubleshooting
- Quick Reference Card
- Support
Part 1: Interactive CLI (Recommended)
The easiest way to use the test harness. No command memorization required - just navigate menus and follow prompts.
For developers: See Part 2: Running with pytest for direct pytest commands and
.envconfiguration.For technical details: See
CLAUDE.mdin the repository for architecture and development patterns.
Installation
Option 1: Install with pip (persistent installation)
pip install codemie-test-harness
Option 2: Run with uvx (no installation needed)
uvx codemie-test-harness
Verify installation:
codemie-test-harness --help
Getting Started
Launch the interactive CLI:
codemie-test-harness
You'll see the main menu:
╔═══════════════════════════════════════════════╗
║ CodeMie Test Harness - Interactive Mode ║
╚═══════════════════════════════════════════════╝
? What would you like to do?
🚀 Run Tests
❯ ⚙️ Configuration
🤖 Chat with Assistant
🔄 Execute Workflow
❌ Exit
First-time setup: Navigate to Configuration → Setup (Quick Configuration) to configure your environment.
Navigation Tips
Before diving into configuration, here's how to navigate the interactive CLI:
- Arrow Keys: Navigate menu options
- Enter: Select an option
- Ctrl+C: Cancel/Exit at any time
- Back Options: Every submenu has a "Back" option
- Menu Loops: Configuration menus loop until you select "Back"
- Smart Defaults: Pre-filled values for common configurations
- Validation: Input validation prevents invalid values
Configuration
The interactive CLI guides you through configuration with smart defaults and validation.
Quick Setup Wizard
Select: Configuration → Setup (Quick Configuration)
The wizard will guide you through:
1. Select Environment
? Select environment:
Localhost - http://localhost:8080
Custom - Enter URL manually
2. Authentication Setup
The wizard automatically detects localhost and skips authentication setup. For remote environments (Preview/Production), it prompts for:
- Auth Server URL (default provided)
- Client ID (default provided)
- Realm Name (default provided)
- Client Secret
- Optional: Username/Password authentication
3. AWS Parameter Store credentials (optional)
Only needed when you enable the AWS Parameter Store (HARNESS_SECRET_STORE=aws-parameter-store, see Settings sources and secret store). Skip this step otherwise:
? How would you like to configure AWS Parameter Store credentials?
📁 Use existing AWS profile
➕ Create new AWS profile
🔑 Enter access keys directly
⏭️ Skip AWS configuration
⬅️ Back
4. Summary & Confirmation
The wizard displays all configured values with masked sensitive data.
Configuration for Localhost
Minimal localhost setup:
- Select Configuration → Setup
- Choose Localhost environment
- Authentication is automatically skipped ✓
- Set integration settings with
config set(or enable the secret store, see below) - Done! Ready to run tests
What you need:
- CodeMie API running on localhost:8080
- Integration settings for the suites you run (configured by you; AWS is optional)
Configuration for Preview/Production
Remote environment setup:
- Select Configuration → Setup
- Choose Preview or Production environment
- Configure authentication:
- Accept default Auth Server URL or enter custom
- Accept default Client ID or enter custom
- Accept default Realm Name or enter custom
- Enter Client Secret
- Optional: Configure username/password
- Set integration settings with
config set(or enable the secret store, see below) - Done! Ready to run tests
AWS Credentials Setup
AWS credentials are used only when the AWS Parameter Store is enabled (HARNESS_SECRET_STORE=aws-parameter-store). They are the credentials the harness uses to read the store. With the store disabled, they are never read.
When do you need AWS?
- Only if you keep your settings in an AWS Parameter Store and enable it (see Settings sources and secret store).
- Otherwise set the settings yourself (
config set, environment variables or.env).
Navigate to: Configuration → AWS Management
Option 1: Use Existing AWS Profile (Recommended)
Select your profile from ~/.aws/credentials:
? Select AWS profile:
❯ default
my-profile
other-profile
Option 2: Create New AWS Profile
The CLI guides you through:
- Enter profile name (e.g., "codemie")
- Enter AWS Access Key ID
- Enter AWS Secret Access Key
- Profile is saved to
~/.aws/credentialswith secure permissions
Option 3: Enter Access Keys Directly
Keys are stored in the test harness configuration file (~/.codemie/test-harness.json).
Option 4: Remove AWS Credentials
Clears all AWS configuration from the test harness.
Integrations Management
Manage credentials for 86+ integration variables across 10 categories.
Navigate to: Configuration → Integrations Management
Features:
- 📋 View Current Integrations - See all configured integrations (masked or real values)
- 📂 View Categories - List all integration categories:
- Version Control (GitLab, GitHub)
- Project Management (JIRA Server/Cloud, Confluence Server/Cloud)
- Cloud Providers (AWS, Azure, GCP)
- Code Quality (SonarQube, SonarCloud)
- DevOps (Azure DevOps)
- Access Management (Keycloak)
- Notifications (Email, OAuth, Telegram)
- Data Management (MySQL, PostgreSQL, MSSQL, LiteLLM, Elasticsearch)
- IT Service (ServiceNow)
- Quality Assurance (Report Portal, Kubernetes)
- ⚙️ Setup by Category - Interactive wizard for specific category
- ✅ Validate Integrations - Check configuration completeness
Example: Setup GitLab Integration
- Select Configuration → Integrations Management → Setup by Category
- Choose Version Control
- Enter values for each prompt (or press Enter to skip):
GITLAB_URL: https://gitlab.example.com GITLAB_TOKEN: ********************** GITLAB_PROJECT: https://gitlab.example.com/group/project GITLAB_PROJECT_ID: 12345
Running Tests
Test Suites (Recommended)
Navigate to: Run Tests → Run Test Suite
Choose from 6 predefined test suites optimized for different use cases:
| Suite | Use Case | Description | Workers | Reruns | Time |
|---|---|---|---|---|---|
| sanity | DevOps CI/CD | Fastest - API sanity checks for deployment validation | 8 | 2 | ~2 min |
| smoke | Local Dev | All smoke tests (API + UI) for rapid feedback | 8 | 2 | 8-12 min |
| smoke-api | Local Dev | API-only smoke tests - fast backend validation | 8 | 2 | 3-5 min |
| smoke-ui | Local Dev | UI-only smoke tests - critical user paths | 4 | 2 | 3-5 min |
| api | QA Regression | Full API regression (parallel-safe tests) | 10 | 2 | 30-45 min |
| ui | QA UI Tests | Full UI regression with Playwright | 4 | 2 | 20-30 min |
| opensource | Feature Testing | Non-enterprise (open-source) features | 10 | 2 | 25-35 min |
| enterprise | Feature Testing | Enterprise-only features | 10 | 2 | 15-25 min |
Interactive Flow:
- Select suite from the list with descriptions
- Configure number of parallel workers (default provided)
- Configure number of reruns on failure (default provided)
- Review execution summary with marks, workers, and reruns
- Confirm to start execution
- Tests run with live output
- See completion status
Example: Running Smoke Tests
? Select a test suite:
❯ smoke - Quick smoke tests for local development
sanity - Sanity check for DevOps CI/CD pipelines
api - Full API regression suite
[...]
? Number of parallel workers: 8
? Number of test reruns on failure: 2
Running test suite: smoke
Description: Quick smoke tests for local development
Marks: smoke
Workers: 8
Reruns: 2
? Proceed with test execution? Yes
[pytest output...]
✓ Test execution completed!
Capability and Setting Gating
A test can declare what it needs: @pytest.mark.requires_capability("retrieval") (a component of GET /v1/config) or @pytest.mark.requires_setting("JIRA_URL") (a harness setting; an integration name such as jira expands to its keys). In a gated run a test whose need is missing is skipped, and the reason names it: missing capability 'retrieval' or missing setting 'JIRA_URL'. The terminal summary groups these skips by reason.
Most tests need no declaration, because their existing markers count:
datasourceneeds theretrievalcapability.- An integration marker needs that integration's settings, so a suite tests the integrations you configured and skips the others. For example, with
SERVICENOW_URLandSERVICENOW_TOKENset, theservicenowtests run; without them, they are skipped.
| Integration marker | Settings |
|---|---|
jira / jira_cloud |
JIRA_URL, JIRA_TOKEN / JIRA_CLOUD_URL, JIRA_CLOUD_TOKEN |
confluence / confluence_cloud |
CONFLUENCE_URL, CONFLUENCE_TOKEN / CONFLUENCE_CLOUD_URL, CONFLUENCE_CLOUD_TOKEN |
gitlab |
GITLAB_URL, GITLAB_TOKEN |
github |
GITHUB_TOKEN |
ado |
AZURE_DEVOPS_URL, AZURE_DEVOPS_TOKEN |
servicenow |
SERVICENOW_URL, SERVICENOW_TOKEN |
xwiki |
XWIKI_URL |
keycloak |
KEYCLOAK_URL, KEYCLOAK_CLIENT_SECRET |
report_portal |
REPORT_PORTAL_URL, REPORT_PORTAL_API_KEY |
kubernetes |
KUBERNETES_URL, KUBERNETES_TOKEN |
telegram |
TELEGRAM_TOKEN |
aws |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION |
azure |
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID |
gcp |
GCP_SA_KEY_BASE64 |
Tests of other integrations (Sonar, e-mail, Elasticsearch, SQL, InfluxDB) are not gated yet and run as before.
A test that needs something its markers do not say carries an explicit declaration. Example: a Git tools test creates a code datasource, so it has requires_capability("retrieval") without the datasource marker, which would add it to the datasource suites. A test can carry several markers; it runs only when all of its needs are met.
| Run | Gated |
|---|---|
codemie-test-harness run <suite>, bare run, pytest -m ... over the whole test path |
yes |
run --marks ... (passes --no-gate), a path, -k, a node id |
no - tests show their real result |
Add --no-gate to a raw pytest run to turn the gate off.
A MissingRequiredSettingError in a gated test also becomes a skip. Add --strict (--strict-requirements for pytest, or HARNESS_STRICT=1) to fail instead of skip.
| Capability | /v1/config component ids (any enabled) |
|---|---|
retrieval |
features:knowledgeBases, features:datasources, features:codeIndexing |
The tables live in codemie_test_harness/capability_gate.py (CAPABILITIES, INTEGRATION_SETTINGS). A name that is not a key of CAPABILITIES is read as a /v1/config component id (for example requires_capability("features:webSearch")). A component missing from /v1/config counts as unavailable. The run reads GET /v1/config once at start; if that fails, it exits with code 2 before any test.
Minimal standalone run (no AWS, no secret store):
export CODEMIE_API_DOMAIN=https://your-codemie.example.com AUTH_USERNAME=... AUTH_PASSWORD=...
codemie-test-harness run smoke-api --strict
Running by Custom Marks
Navigate to: Run Tests → Run with Custom Marks
Interactive Flow:
- Optional: View available marks first
- Choose format: List view (simple) or Table view (with file details)
- Enter pytest marks expression with logical operators
- Configure workers and reruns
- Review summary and confirm
- Execute tests
Common Mark Examples:
# Single mark
api
# Multiple marks with AND
smoke and api
# Multiple marks with OR
jira or confluence
# Exclude marks with NOT
api and not ui
# Complex expressions with parentheses
(gitlab or github) and code_kb
# Multiple exclusions
api and not (ui or not_for_parallel_run)
📋 Available Marks by Category:
Before running custom marks, view all available marks:
codemie-test-harness marks # List view
codemie-test-harness marks --verbose # Detailed view with file locations
🏗️ Architecture
api- API integration testsui- UI tests with Playwrightmcp- Model Context Protocol tests
💨 Speed
smoke- Quick smoke testssanity- Sanity checks (fastest)
🔐 License
enterprise- Enterprise featuresopensource- Non-enterprise features (implied by absence ofenterprise)
🔗 Integrations
gitlab,github,git- Version control systemsjira,jira_cloud- JIRA integrationsconfluence,confluence_cloud- Confluence integrationsado- Azure DevOpsservicenow- ServiceNow
📚 Knowledge Bases
jira_kb- JIRA knowledge base testsconfluence_kb- Confluence knowledge base testscode_kb- Code knowledge base tests
🤖 Features
assistant- Assistant functionalityworkflow- Workflow executionllm- LLM model testsdatasource- Datasource managementconversations- Conversation API
⚠️ Special
not_for_parallel_run- Sequential execution required
Interactive Features
Configuration Management
List Settings
- View all configured settings
- Sensitive values are masked by default
- See total count of configured values
Set Specific Value
- Set any configuration key manually
- Autocomplete suggestions for common keys
- Secure password input for sensitive values
Get Specific Value
- View a single configuration value
- Shows masked value for sensitive keys
Unset Specific Value
- Remove specific configuration keys
- Confirmation prompt before removal
Assistant Chat
Navigate to: Chat with Assistant
Features:
- Start new conversations or continue existing ones
- Stream responses in real-time
- Langfuse tracing support
- Interactive message input
Usage:
- Enter assistant ID
- Optional: Enter conversation ID to continue previous chat
- Optional: Enable streaming or Langfuse tracing
- Type your message
- View assistant response
- Continue conversation
Workflow Execution
Navigate to: Execute Workflow
Features:
- Execute workflows by ID
- Provide user input
- Custom execution IDs
- View execution results
Usage:
- Enter workflow ID
- Optional: Provide user input for the workflow
- Optional: Specify custom execution ID
- Execute and view results
Configuration File Reference
All configuration is stored in: ~/.codemie/test-harness.json
Priority Order (highest to lowest):
- CLI flags (temporary, for single run)
- Environment variables (set in the shell)
- Configuration file (
~/.codemie/test-harness.json). It fills only variables that are not already set. .envfile- AWS Parameter Store (only if enabled)
- Default value given by the code
- Not configured:
get_parameterreturns the default (""if none is given);get_required_parameterfails the test withMissingRequiredSettingErrornaming the setting
Viewing the file:
cat ~/.codemie/test-harness.json | jq
Manual editing (advanced):
# Backup first
cp ~/.codemie/test-harness.json ~/.codemie/test-harness.json.backup
# Edit with your preferred editor
nano ~/.codemie/test-harness.json
Resetting configuration:
rm ~/.codemie/test-harness.json
codemie-test-harness # Start fresh
Complete Example: First Test Run
Here's a complete walkthrough for first-time users:
1. Install
pip install codemie-test-harness
2. Launch interactive mode
codemie-test-harness
3. Configure (first time only)
Select: ⚙️ Configuration
Select: Setup (Quick Configuration)
Choose: Preview environment
Accept defaults for Auth Server, Client ID, Realm
Enter: Your Client Secret
Choose: Use existing AWS profile (or enter credentials)
Confirm configuration
4. Run tests
Select: 🚀 Run Tests
Select: Run Test Suite
Choose: smoke (Quick smoke tests)
Workers: 8 (press Enter for default)
Reruns: 2 (press Enter for default)
Confirm: Yes
Wait: 5-10 minutes
Result: See test results!
5. Explore results
- Check
~/.codemie/test-harness.jsonfor saved configuration - Test results are displayed in terminal
junit.xmlandresults.jsonare written to./codemie-test-reports/(see "Test results")- If ReportPortal is configured, view results there
Part 2: Running with pytest
For contributors working from the repository or users preferring direct pytest commands.
Licensing
Every tracked .py file under test-harness/ must carry the Apache-2.0 licence header from scripts/license_template.txt in its first 50 lines (shebang and coding cookie stay above it).
make license-checklists files without the header and exits 1 if any are found.make license-fixinserts the header.make license-scanchecks dependency licences againstallow-onlyin[tool.pip-licenses]inpyproject.toml.
To except a dependency from the scan, add it to ignore-packages in pyproject.toml with a comment that gives the reason. The change is reviewed in the PR. Do not exempt copyleft or doubtful licences without that review.
Installation for Contributors
1. Clone the repository:
git clone <repository-url>
cd test-harness
2. Install:
make install
This runs poetry install, so codemie-sdk-python is the version pinned in
poetry.lock — the same as CI (build-codemie-autotests-python). To reproduce a
bug against a specific SDK release:
make install SDK_VERSION=0.1.648
This never writes to pyproject.toml or poetry.lock — they only change
what's installed in the virtualenv.
3. Install the pre-commit hook (recommended):
make install-hooks
This runs ruff check and ruff format --check on staged test-harness/*.py
files before each commit, catching lint/format issues (like the CI
build-codemie-autotests-python job would) before they reach a pull request.
It is a plain git hook, not the pre-commit framework — no extra dependency
— and only touches files under test-harness/, so it is safe alongside the
other codemie-sdk subprojects that share the same .git/hooks directory.
Working against an unpublished SDK change:
The SDK is developed in https://github.com/codemie-ai/codemie-sdk, not in
this repository. The harness always installs the published
codemie-sdk-python. If you need an SDK change that is not released yet,
install your local clone on top of the Poetry environment:
poetry run pip install -e <path-to-codemie-sdk>/sdk/codemie-python
This changes only the virtualenv, not pyproject.toml or poetry.lock. Run
make install again to go back to the published SDK. pip may print a
dependency-conflict warning for codemie-sdk-python; it does not break the
environment. Before you merge, release the SDK change and bump the SDK pin in
pyproject.toml (and relock).
Publishing: SDK dependency pin
test-harness/pyproject.toml pins codemie-sdk-python to one exact PyPI
version (0.1.705) instead of a local path dependency, so a real user of
codemie-test-harness installs the same published SDK a contributor tests
against (see Installation for Contributors).
Where each package is published.
codemie-sdk-pythonis published from GitHub (https://github.com/codemie-ai/codemie-sdk), by thepublish-python.ymlworkflow on a release tagpython-vX.Y.Z. The tag names the version, and it must be on the base line (MAJOR.MINOR) set in the SDK'spyproject.toml. That base line is0.1now. The latest release is0.1.705.codemie-test-harnessis still published from this repository, by a Tekton pipeline (build-codemie-sdk-main-*) in KubeRocketCI, namespaceedp-delivery. On GitLab it surfaces as theauto_epmd-edp_vcsbot's "Build Pipeline" status on the merge commit. This repo has no read access to that pipeline's configuration, so what follows about it is inferred from PyPI, not from its source.- The two version numbers are no longer the same: the harness has its own
0.1.Nbuild number (0.1.707on 2026-10-19), the SDK has the GitHub tag (0.1.698).
Why an exact pin. The SDK ships every release, breaking ones included, on
the 0.1.x line. A range would let uvx codemie-test-harness install SDK
releases the harness was never tested against, and CI runs from the lock and
would not catch it. Bump the pin (and relock) when the harness needs a newer SDK.
Post-merge verification checklist (run once after the first main build
following a change to this dependency):
-
The GitLab "Build Pipeline" status is PASSED on the merge commit.
-
codemie-test-harnesshas a new0.1.Nrelease on PyPI. -
The published harness's
requires_distshowscodemie-sdk-python==0.1.Nwith anNthat exists for the SDK on PyPI. It must not show a local@ file://...path:curl -s https://pypi.org/pypi/codemie-test-harness/json \ | python3 -c "import json,sys; print([r for r in json.load(sys.stdin)['info']['requires_dist'] if 'sdk' in r])"
-
uvx codemie-test-harness --helpinstalls and runs against the newly published package.
3. Install Playwright browsers (for UI tests):
playwright install
Configuration with .env File
Create a .env file in the codemie_test_harness directory. If no .env exists, the harness
falls back to the shipped .env.template (defaults for a local stack: localhost:8080, admin@codemie.ai),
so uvx codemie-test-harness works against a local stack without setup. Copy the template to .env
to override values.
Configuration for Localhost
Minimal localhost setup:
CODEMIE_API_DOMAIN=http://localhost:8080
TEST_USER_FULL_NAME=dev-codemie-user
# Integration settings you need, for example:
# GITLAB_URL=<url>
# GITLAB_TOKEN=<token>
AWS is optional: see Settings sources and secret store.
Configuration for Preview/Production
Full remote setup:
# API Configuration
CODEMIE_API_DOMAIN=https://codemie.example.invalid/code-assistant-api
# Authentication
AUTH_SERVER_URL=https://auth.example.com/
AUTH_CLIENT_ID=<client_id>
AUTH_REALM_NAME=<realm>
AUTH_USERNAME=<username>
AUTH_PASSWORD=<password>
# Keycloak provisioning account (master realm). Only needed by tests that create
# or delete temporary platform users (budgets, projects, roles, ...).
KEYCLOAK_ADMIN_USERNAME=<provisioning_account>
KEYCLOAK_KEY=<provisioning_account_password>
# Optional: Test configuration
DEFAULT_TIMEOUT=60
CLEANUP_DATA=True
# Optional: UI Testing
FRONTEND_URL=https://codemie.example.invalid
HEADLESS=True
Integration Configuration
Configure integrations in .env, with config set, or with the opt-in AWS Parameter Store.
Version Control:
GIT_ENV=gitlab # or github
# GitLab
GITLAB_URL=https://gitlab.example.com
GITLAB_TOKEN=<token>
GITLAB_PROJECT=https://gitlab.example.com/group/project
GITLAB_PROJECT_ID=12345
# GitHub
GITHUB_URL=https://github.com
GITHUB_TOKEN=<token>
GITHUB_PROJECT=https://github.com/org/repo
# Azure DevOps
AZURE_DEVOPS_URL=https://dev.azure.com
AZURE_DEVOPS_ORGANIZATION_NAME=org
AZURE_DEVOPS_PROJECT_NAME=project
AZURE_DEVOPS_TOKEN=<personal_access_token>
VCS tool tests create a persistent seed in each configured repository on first run and reuse it afterwards: a GitHub issue named CodeMie Test Harness Seed Issue, a GitLab MR named CodeMie Test Harness Seed MR (from a branch/file pair also named for the harness), and an Azure DevOps PR named CodeMie Test Harness Seed PR. Do not delete, merge or close these; cleanup never removes them.
Project Management:
# JIRA Server
JIRA_URL=https://jira.example.com
JIRA_TOKEN=<token>
# project for the seed issue
JIRA_PROJECT_KEY=PROJ
# optional; otherwise discovered
# JIRA_CUSTOM_FIELD_1=customfield_10010
# JIRA_CUSTOM_FIELD_2=customfield_10011
# JIRA Cloud
JIRA_CLOUD_URL=https://company.atlassian.net
JIRA_CLOUD_EMAIL=user@company.com
JIRA_CLOUD_TOKEN=<api_token>
# project for the seed issue
JIRA_CLOUD_PROJECT_KEY=PROJ
# JIRA_CLOUD_CUSTOM_FIELD_1 / JIRA_CLOUD_CUSTOM_FIELD_2 work like the Server ones
# Confluence Server
CONFLUENCE_URL=https://confluence.example.com
CONFLUENCE_TOKEN=<token>
# space for the seed page
CONFLUENCE_SPACE_KEY=SPACE
# Confluence Cloud
CONFLUENCE_CLOUD_URL=https://company.atlassian.net/wiki
CONFLUENCE_CLOUD_EMAIL=user@company.com
CONFLUENCE_CLOUD_TOKEN=<api_token>
# space for the seed page
CONFLUENCE_CLOUD_SPACE_KEY=SPACE
# xWiki
XWIKI_URL=https://xwiki.example.com/xwiki
XWIKI_TOKEN=<token>
# space for the seed page
XWIKI_SPACE=SPACE
Google Docs Datasource:
# Document used by the Google Docs datasource tests. Must be readable by
# the service account configured for the Google OAuth
# integration (see google_oauth_credentials in credentials_manager.py). The
# expected-content assertions in google_datasource_test_data.py depend on
# this document's content, so update them too if you point this at a
# different document. A UI test (create_edit_datasource_page.py's
# should_see_google_fields) separately asserts that the product's own
# "View Format Example" link points at this same URL, so it must also equal
# whatever example document the product UI links to — not just any document
# with matching content. Falls back to AWS Parameter Store
# (/codemie/autotests/integrations/google_docs, key document_url) when unset.
GOOGLE_DOC_URL=https://docs.google.com/document/d/<doc-id>/edit
Quality Assurance:
# Report Portal
REPORT_PORTAL_URL=https://reportportal.example.com
REPORT_PORTAL_PROJECT=PROJECT
REPORT_PORTAL_API_KEY=<api_key>
Jira tests create a persistent seed issue named CodeMie Test Harness Seed Issue in the configured project on first run (issue type Task) and reuse it afterwards. Two plain-text custom fields on the project are discovered and filled with harness-cf-1 / harness-cf-2. Do not delete or edit that issue; cleanup never removes it.
Confluence tests create a persistent seed page named CodeMie Test Harness Seed Page in the configured space on first run and reuse it afterwards. Do not delete or edit that page; cleanup never removes it.
xWiki tests write a seed page named CodeMie Test Harness Seed Page into the configured XWIKI_SPACE on every run, with a known token value. The page is rewritten with the same content each time, so repeated runs never create duplicates. The datasource tests assert against that token, and they are skipped when XWIKI_URL is not set. Do not edit that page.
Azure DevOps tests create persistent seed data in the configured project on first run and reuse it afterwards: work items CodeMie Test Harness Seed Work Item and CodeMie Test Harness Seed Parent Work Item (with a comment), wiki pages CodeMie Test Harness Seed Parent Page and CodeMie Test Harness Seed Child Page (with two comments), and test plan CodeMie Test Harness Seed Test Plan. The datasource work-items query matches only the seed work item. Do not delete or edit these items; cleanup never removes them. Creating the test plan needs a token with Test Plans write access.
Cloud tool tests (AWS, GCP, Kubernetes) create nothing. Instead of asserting on full listings of the shared account/cluster, each one is narrowed to one existing, long-lived resource: S3 bucket codemie-bucket, Cloud Storage bucket 009fb622-4e29-42aa-bafd-584c61f5e1e1 and service argo-cd-argocd-server in namespace argocd. The "list" prompts still ask for all buckets/services but assert only on that resource, and the direct-tool tests query it directly. Expected values (creation date, region, generation, etag, timestamps, UIDs, resourceVersion, ...) are read from the live resource at session start, so read access is enough. Do not delete or edit these resources. Set verifySsl: false in the /codemie/autotests/integrations/kubernetes parameter if the cluster API uses a private CA (or KUBERNETES_VERIFY_SSL=false locally).
Report Portal tests create a persistent seed launch named CodeMie Test Harness Seed Launch in the configured project on first run, with one passed, one failed and one skipped test item, and reuse it afterwards. Expected pass/fail/skip counts and duration are read from that launch instead of being hardcoded, so the tests no longer break when the project's real launches are rerun and replaced. Do not delete or edit that launch; cleanup never removes it.
Keycloak tool tests create a persistent seed user codemie-test-harness-seed@example.com (first name CodeMie, last name Test Harness Seed) in the realm configured by KEYCLOAK_URL / KEYCLOAK_REALM on first run and reuse it afterwards, using the KEYCLOAK_CLIENT_ID / KEYCLOAK_CLIENT_SECRET client, whose service account must be allowed to manage users. The "get all users" tests ask for all users but assert only on the seed user (ID and creation timestamp are read from the live user), so they no longer break when other users are added to or removed from the realm. Do not delete or edit that user; cleanup never removes it.
InfluxDB data-management tool tests write a fresh point into a codemie_harness_seed measurement at session start and query it back to confirm the write landed, instead of relying on a point hand-seeded once into a sandbox-only instance. The query task and expected response are read from that point, so an InfluxDB retention-policy expiry or a sandbox reset never leaves the fixture stale. Other Database-backed MCP tool tests (PostgreSQL, SQLite) were audited for the same hand-seeded/personal-data pattern and use only generic, synthetic fixture data already; no further instances were found.
Sonar tests (CodeBaseTool.SONAR / SONAR_CLOUD) create no seed project. The SonarQube project behind these tests is the live codemie codebase, and the SonarCloud project is a third-party GitHub repo, so neither can be frozen; instead the direct-tool tests assert on the shape of an /api/issues/search response (required fields, their types, and Sonar's documented enum values for severity/status/type) via sonar_seed.assert_issue_search_response, rather than on a hardcoded snapshot of counts, issue keys or dates that a rescan would invalidate. The assistant/workflow-level Sonar tests already asked only whether the assistant has Sonar access, so they needed no change.
Credential Priority: see Settings sources and secret store.
Settings sources and secret store
The harness takes every setting from a source you control. Highest priority first:
- Environment variable.
- Config file
~/.codemie/test-harness.json(codemie-test-harness config set KEY VALUE). It fills only variables that are not already set. .envfile.- AWS Parameter Store, only if you enable it.
- Default given by the code.
- Not configured:
CredentialsManager.get_parameter(key, default)returns the default (""if none is given). A test that cannot run without a setting callsCredentialsManager.get_required_parameter(key), which raisesMissingRequiredSettingErrornaming the setting.
A downloaded .env is applied in memory and never written to disk, so a rotated value applies on the next run. It never overwrites or removes a value that is already set.
AWS Parameter Store (opt-in). The store is used only when HARNESS_SECRET_STORE=aws-parameter-store. If AWS variables such as AWS_PROFILE are set in your shell but this setting is not, the harness makes no AWS call and assumes no role. Settings:
| Setting | Required | Purpose |
|---|---|---|
HARNESS_SECRET_STORE |
yes | Set to aws-parameter-store to enable the store |
AWS_PS_REGION |
when enabled | AWS region of the store |
AWS_PS_PATH_PREFIX |
when enabled | Prefix of the parameter names (for example /my-team/integrations/); leading and trailing slashes are added if missing. A setting group such as jira is read from <prefix>jira as a JSON document |
AWS_PS_ROLE_ARN |
no | Role to assume before reading. A role is assumed only if this is set |
AWS_PS_DOTENV_PATH |
no | Full name of a parameter that holds a .env file. It is downloaded at start. If unset, nothing is downloaded |
Store credentials are AWS_PROFILE, or AWS_ACCESS_KEY and AWS_SECRET_KEY (with an optional AWS_SESSION_TOKEN). The harness reads them only when the store is enabled. These settings are listed by codemie-test-harness config in the secret-store category.
If the store is enabled and a required setting is missing, the store is unreachable, or it rejects the credentials, the run stops before any test. The message names the store, region, prefix and reason, for example Secret store 'aws-parameter-store' failed (region=..., prefix=...): .... A single missing parameter or JSON path is not a failure: that setting is "not configured".
Scheduled jobs that read the shared store must set HARNESS_SECRET_STORE, AWS_PS_REGION, AWS_PS_PATH_PREFIX, AWS_PS_ROLE_ARN and AWS_PS_DOTENV_PATH in the job environment.
Internal-value scan
scripts/scan_internal_values.py checks the tracked files under test-harness/ for blocked internal values (hosts, email domains, ticket-key patterns, customer names). The script has no built-in patterns. You supply them at run time and keep them outside the repository:
HARNESS_SCAN_PATTERNS: regular expressions (Pythonresyntax), matched case-insensitively.HARNESS_SCAN_CUSTOMER_NAMES: customer names. Each name is a case-insensitive literal, not a regex.
Format for both: a newline-separated list, one entry per line. Blank lines and lines that start with # are ignored. The value is either the list itself or the path to a file that holds the list.
export HARNESS_SCAN_PATTERNS=~/private/harness-scan-patterns.txt
export HARNESS_SCAN_CUSTOMER_NAMES=~/private/harness-scan-customers.txt
make scan-internal
The scan prints file:line: [rule] for each match. It does not print the matched text. Exit codes: 0 clean, 1 at least one match, 2 no pattern configured (the scan never passes silently). The paths docs/superpowers/**, qa-factory/**, .claude/**, .codegraph/**, test_screenshots/**, AGENTS.md and CLAUDE.md are not scanned.
The pre-commit hook (make install-hooks) runs the scan on every commit. If neither variable is set, the hook prints a notice and skips the scan; the commit goes on. If a match is found, the commit stops.
Running Tests with pytest
Test Suites with pytest
Run the same test suites using pytest directly:
Smoke Tests (Local Development)
# All smoke tests (API + UI)
pytest -n 8 -m "smoke" --reruns 2
# API smoke tests only (fast backend validation)
pytest -n 8 -m "smoke and api and not ui" --reruns 2
# UI smoke tests only (critical user paths)
pytest -n 4 -m "smoke and ui" --reruns 2
Sanity Tests (CI/CD)
pytest -n 8 -m "sanity" --reruns 2
Full API Regression
# Parallel-safe tests
pytest -n 10 -m "api" --reruns 2
# Sequential tests (run separately)
pytest -m "api and not_for_parallel_run" --reruns 2
UI Tests
pytest -n 4 -m "ui" --reruns 2
Open Source Features
pytest -n 10 -m "not enterprise and api" --reruns 2
Enterprise Features
pytest -n 10 -m "enterprise" --reruns 2
Test Suite Comparison
| Suite | CLI Command | pytest Command |
|---|---|---|
| sanity | codemie-test-harness run sanity |
pytest -n 8 -m "sanity" --reruns 2 |
| smoke | codemie-test-harness run smoke |
pytest -n 8 -m "smoke" --reruns 2 |
| api | codemie-test-harness run api |
pytest -n 10 -m "api" --reruns 2 |
| ui | codemie-test-harness run ui |
pytest -n 4 -m "ui" --reruns 2 |
| opensource | codemie-test-harness run opensource |
pytest -n 10 -m "not enterprise and api" --reruns 2 |
| enterprise | codemie-test-harness run enterprise |
pytest -n 10 -m "enterprise" --reruns 2 |
Custom Mark Selection with pytest
Single Mark:
pytest -n 8 -m "gitlab" --reruns 2
AND Operator (both marks required):
pytest -n 8 -m "api and jira" --reruns 2
pytest -n 4 -m "gitlab and code_kb" --reruns 2
OR Operator (either mark):
pytest -n 8 -m "jira or confluence" --reruns 2
pytest -n 6 -m "jira_kb or confluence_kb" --reruns 2
NOT Operator (exclude marks):
pytest -n 10 -m "api and not ui" --reruns 2
pytest -n 8 -m "not not_for_parallel_run" --reruns 2
Complex Expressions:
# Multiple conditions with parentheses
pytest -n 8 -m "(gitlab or github) and code_kb" --reruns 2
# Exclude multiple marks
pytest -n 10 -m "api and not (ui or not_for_parallel_run)" --reruns 2
# Knowledge base tests only
pytest -n 8 -m "(jira_kb or confluence_kb or code_kb)" --reruns 2
Common Testing Scenarios
Testing Specific Integrations:
# GitLab integration
pytest -n 8 -m "api and gitlab" --reruns 2
# JIRA integration
pytest -n 8 -m "api and jira" --reruns 2
# Confluence integration
pytest -n 8 -m "api and confluence" --reruns 2
# All Git providers
pytest -n 8 -m "gitlab or github or git" --reruns 2
Testing Specific Components:
# Workflows
pytest -n 8 -m "api and workflow" --reruns 2
# Assistants
pytest -n 8 -m "api and assistant" --reruns 2
# LLM models
pytest -n 8 -m "api and llm" --reruns 2
# MCP (Model Context Protocol)
pytest -n 8 -m "api and mcp" --reruns 2
Testing Without Full Backend:
# Exclude MCP tests (when mcp-connect is not running)
pytest -n 8 -m "api and not mcp" --reruns 2
pytest Flags Explained
| Flag | Description | Example |
|---|---|---|
-n <number> |
Number of parallel workers (pytest-xdist) | -n 8 |
-m "<expression>" |
Select tests by marks | -m "api and not ui" |
--reruns <number> |
Retry failed tests N times (pytest-rerunfailures) | --reruns 2 |
--count <number> |
Run each test N times (pytest-repeat) | --count 50 |
--timeout <seconds> |
Per-test timeout in seconds (pytest-timeout) | --timeout 600 |
-v |
Verbose output | -v |
-s |
Show print statements | -s |
-x |
Stop on first failure | -x |
--lf |
Run last failed tests | --lf |
--reportportal |
Report results to ReportPortal | --reportportal |
Test Timeout Configuration
Control per-test timeout to prevent hanging tests.
In .env file:
TEST_TIMEOUT=600 # 10 minutes per test
Via pytest command:
# Set timeout for this run
pytest -n 8 -m "api" --timeout 900 --reruns 2
# Disable timeout (debugging only)
pytest -m "slow_tests" --timeout 0
Default: 300 seconds (5 minutes) per test
When a test exceeds the timeout:
- Test is terminated immediately
- Marked as FAILED with timeout message
- Stack trace shows where execution stopped
- Other tests continue normally
UI Tests with Playwright
Install browsers (one-time):
playwright install
Run UI tests:
pytest -n 4 -m "ui" --reruns 2
Headless mode:
Set HEADLESS=True in .env or:
HEADLESS=True pytest -n 4 -m "ui" --reruns 2
Test results (JUnit XML and JSON)
Every run started through codemie-test-harness writes two files to a results
folder: junit.xml (pytest --junitxml) and results.json.
- Default folder:
codemie-test-reports/under the directory you start the command from. --results-dir PATHsets another folder. A relative path is resolved against your current directory. If the folder cannot be created or written, the run stops with exit code 1 before any test starts.--no-junit-xmlskipsjunit.xml.--no-jsonskipsresults.json. With both flags no folder is created.- Unless both formats are off, each run first deletes
junit.xmlandresults.jsonof an earlier run from the folder, also for a format that is turned off. A file in the folder is then always from the current run. With--no-junit-xml --no-jsonnothing is created or deleted. - If you pass
--junitxml=...as an extra pytest argument, your file is used and the harness does not write its ownjunit.xml.results.jsonis not affected. durationinresults.jsonis setup + call + teardown, liketimeinjunit.xml. For a test that was rerun it is the sum of all attempts, also likejunit.xml. If a test fails in the call and again in teardown, it staysfailed.- ReportPortal: screenshots of failed UI tests are sent to ReportPortal when the
pytest-reportportalplugin is active for the run. The plugin reads the endpoint and the project from--rp-endpoint/--rp-projector therp_endpoint/rp_projectini keys, and the API key fromRP_API_KEY(orRP_UUID) in the environment. - The exit code of pytest is not changed.
codemie-test-harness run smoke --results-dir ./out
codemie-test-harness --smoke --no-json
results.json has this shape. A test that is rerun appears once, with its final
outcome and the number of reruns. Skipped and xfail tests are skipped;
setup, teardown and collection failures are error. A test that started but did
not finish (Ctrl-C, cancelled job) is also error. A module skipped at collection
is one skipped entry.
collected is the number of tests selected to run and exitstatus is the pytest
exit code. The run is complete only when exitstatus is 0 or 1 and total is not
less than collected.
{
"summary": {"total": 2, "collected": 2, "exitstatus": 0, "passed": 1, "failed": 0, "skipped": 1, "error": 0},
"tests": [
{"nodeid": "path/test_a.py::test_x", "outcome": "passed", "duration": 1.2, "reruns": 1}
]
}
Unit tests of the harness itself (no live platform needed):
make unit-test # poetry run pytest -c unit_tests/pytest.ini unit_tests
ReportPortal Integration
Configure the API key in .env (the pinned pytest-reportportal==5.5.2 only reads
RP_API_KEY from the environment — RP_ENDPOINT and RP_PROJECT are not read
from .env and must be passed as CLI flags or set in pytest.ini, see below):
RP_API_KEY=<api_key>
Run with ReportPortal:
pytest -n 10 -m "api" --reruns 2 --reportportal \
--rp-endpoint="https://reportportal.example.com" \
--rp-project="codemie_tests"
Troubleshooting
Common Issues
"Command not found: codemie-test-harness"
- Run
pip install codemie-test-harnessor useuvx codemie-test-harness - Check that pip's bin directory is in your PATH
"Authentication failed"
- Verify AUTH_CLIENT_SECRET is correct
- Check AUTH_SERVER_URL is accessible
- For localhost, authentication is automatically skipped
"AWS Parameter Store access denied"
- Verify AWS credentials with
aws sts get-caller-identity - Check that your AWS user has Parameter Store read permissions
- Required path:
<AWS_PS_PATH_PREFIX>*(the store is read only whenHARNESS_SECRET_STORE=aws-parameter-store) - The run stops before any test and the message names the store, region, prefix and reason
"Tests hanging or timing out"
- Check DEFAULT_TIMEOUT in configuration (default: 300 seconds)
- Increase timeout:
pytest --timeout 600 -m "slow_tests" - For debugging, disable timeout:
pytest --timeout 0
"Playwright browser not found"
- Run
playwright installto download browsers - For specific browser:
playwright install chromium
"Integration tests failing"
- Verify integration credentials in Configuration → Integrations Management
- Run validation: Configuration → Integrations Management → Validate Integrations
- Check if integration services (GitLab, JIRA, etc.) are accessible
Stopping tests mid-run
- Press
Ctrl+Cto gracefully stop pytest - Running tests will complete their current test
- Cleanup happens automatically even on interrupt
Configuration not persisting
- Configuration is stored in
~/.codemie/test-harness.json - Check file permissions:
ls -la ~/.codemie/test-harness.json - Use Configuration → List Settings to verify saved values
Quick Reference Card
Most Common Commands
# Interactive mode (easiest)
codemie-test-harness
# Quick test runs
codemie-test-harness run sanity # Fastest (2 min)
codemie-test-harness run smoke # Quick (5-10 min)
codemie-test-harness run api # Full regression (30-45 min)
# Configuration
codemie-test-harness config list # View all settings
codemie-test-harness marks # List available marks
# With pytest
pytest -n 8 -m "smoke" --reruns 2 # Smoke tests
pytest -n 10 -m "api" --reruns 2 # API tests
pytest -n 4 -m "ui" --reruns 2 # UI tests
pytest -m "api and gitlab" --reruns 2 # GitLab tests
Files & Paths
~/.codemie/test-harness.json # Configuration file
~/.aws/credentials # AWS credentials
codemie_test_harness/.env # Environment variables (for pytest)
Quick Setup
# Install
pip install codemie-test-harness
# First run
codemie-test-harness # Interactive setup wizard
# Or quick config
codemie-test-harness config set CODEMIE_API_DOMAIN http://localhost:8080
codemie-test-harness config set AWS_PROFILE my-profile
Support
For issues, questions, or contributions:
- Create an issue in the repository
Notes on settings names and the secret store
- Settings without a store mapping (the generic
LITE_LLM_API_KEY, genericMYSQL_*/POSTGRES_*keys) are read from the environment or config only. - Renamed settings:
SMTP_USERNAME/PASSWORDare nowGMAIL_USER_EMAIL/PASSWORD, andMSSQL_*are nowSANDBOX_MSSQL_*. The old names still work from the environment and the config file. - A downloaded
.env(AWS_PS_DOTENV_PATH) is applied in memory only; it fills variables that are still unset and writes no file. - At startup the store is probed with one
ssm:GetParameterread underAWS_PS_PATH_PREFIX(a missing parameter is fine), so the role needs no other permission. WithAWS_PS_ROLE_ARNthe credentials are renewed once if they expire during a run.
Metadata
Release files for codemie-test-harness 0.1.755
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codemie_test_harness-0.1.755.tar.gz | 2.6 MB | Without provenance | Details for codemie_test_harness-0.1.755.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codemie_test_harness-0.1.755-py3-none-any.whl | Python 3 | none | any | Details for codemie_test_harness-0.1.755-py3-none-any.whl |
Total release size: 5.9 MB
Release files / codemie_test_harness-0.1.755.tar.gz
| Download URL | codemie_test_harness-0.1.755.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb114d688f5a61c4406ebf50bd68f3088e5b8b8d85407af6a4863fbed60da122
|
|
BLAKE2b-256 checksum How to use checksums |
cdfd411552b7ac45720dc635ae91ebda7196cc7530b7e9ca471fca12d94bf4f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Release files / codemie_test_harness-0.1.755-py3-none-any.whl
| Download URL | codemie_test_harness-0.1.755-py3-none-any.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34cfdd71516b19616abd8cfcb4ec5ef6136b14bd8802d1b4382fa68089ed58bb
|
|
BLAKE2b-256 checksum How to use checksums |
38db9117c4803abe0b109740ff1ca98bcc13b7d9beca9e0482e61f903d1fbfda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.5
|
Security for codemie-test-harness 0.1.755
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.