Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
70 changes: 70 additions & 0 deletions .github/workflows/codebuddy-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright (c) 2026 Tencent Inc.
# SPDX-License-Identifier: Apache-2.0

name: codebuddy-integration

on:
pull_request:
paths:
- "examples/codebuddy-integration/**"
- "docs/**/integrations/codebuddy.md"
- ".github/workflows/codebuddy-integration.yml"
push:
branches: [main]
Comment thread
pei-pei45 marked this conversation as resolved.
Outdated

jobs:
static:
name: Static checks (compile + unit tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Compile host driver scripts
working-directory: examples/codebuddy-integration
run: |
python3 -m py_compile env_utils.py _codebuddy_common.py \
run_codebuddy.py resume_codebuddy.py network_policy.py

- name: Run env_utils unit tests
working-directory: examples/codebuddy-integration
run: python3 -m unittest discover -s . -p test_env_utils.py -v

- name: Smoke-check --help output
working-directory: examples/codebuddy-integration
run: |
python3 run_codebuddy.py --help
python3 resume_codebuddy.py --help
Comment thread
pei-pei45 marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical: CI test discovery silently skips 3 out of 4 test files

The CI uses python3 -m unittest discover which only discovers classes inheriting from unittest.TestCase. Three of the four test files use pytest-style classes (plain object base, bare assert, pytest fixtures) — they are silently skipped with no error or warning:

File Inherits TestCase? Discovered by unittest?
test_env_utils.py ✅ Yes ✅ Yes
test_codebuddy_common.py ❌ No (pytest-style, bare assert) Silently skipped
test_mcp_server.py ❌ No (pytest-style, free functions) Silently skipped
test_sandbox_exec.py ❌ No (pytest-style, bare assert) Silently skipped

Only ~752 lines of test_env_utils.py would run; ~948 lines in the other 3 files are dropped. A developer who checks CI after merging would see a green checkmark but nowhere near the advertised 166-test coverage.

Fix: Change to python3 -m pytest tests/ -v (and add pytest to a requirements file or install step), or convert the pytest-style classes to unittest.TestCase subclasses.

python3 network_policy.py --help

dockerfile:
name: Dockerfile builds cleanly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Build (cache miss is fine; --load is just for smoke)
uses: docker/build-push-action@v6
with:
context: examples/codebuddy-integration
push: false
load: true
tags: codebuddy-cube:ci
cache-from: type=gha
cache-to: type=gha,mode=max

- name: codebuddy --version inside the image
run: |
cid=$(docker run -d --rm codebuddy-cube:ci)
docker exec "$cid" codebuddy --version
# envd /health reachable means the readiness probe will succeed
docker exec "$cid" curl -fsS -o /dev/null \
Comment thread
pei-pei45 marked this conversation as resolved.
Outdated
http://127.0.0.1:49983/health
docker rm -f "$cid"
Loading
Loading