Skip to content

Conversation

@beonde
Copy link
Member

@beonde beonde commented Dec 27, 2025

Summary

Adds comprehensive E2E test suite for the CLI wrapper, validating all P0 CLI commands against the actual capiscio-core binary.

P0 E2E Tests Added

Test File Tests Coverage
test_validate_e2e.py 8 Validation command
test_badge_e2e.py 9 Badge issue/verify commands
test_score_e2e.py 4 Scoring (via validation)
test_status_e2e.py 8 CLI status/version checks

Total: 29 new E2E tests

Infrastructure

  • pytest.ini: E2E test configuration with markers
  • tests/e2e/conftest.py: Shared fixtures and CLI runner
  • tests/e2e/fixtures/: Test agent cards (valid, invalid, malformed)
  • .github/workflows/e2e.yml: E2E test workflow
  • .github/workflows/test.yml: Updated unit test workflow

Changes

  • Reorganized tests into tests/unit/ and tests/e2e/ directories
  • Added tests/README.md with test documentation
  • Updated pyproject.toml with test dependencies

Testing

# Run E2E tests
uv run pytest tests/e2e/ -v

# Run with specific marker
uv run pytest -m "e2e" -v

P0 E2E Tests Added:
- test_validate_e2e.py: 8 tests for validation command
- test_badge_e2e.py: 9 tests for badge issue/verify commands
- test_score_e2e.py: 4 tests for scoring (via validation)
- test_status_e2e.py: 8 tests for CLI status/version checks

Infrastructure:
- pytest.ini: E2E test configuration with markers
- tests/e2e/conftest.py: Shared fixtures and CLI runner
- tests/e2e/fixtures/: Test agent cards (valid, invalid, malformed)
- .github/workflows/e2e.yml: E2E test workflow
- .github/workflows/test.yml: Updated unit test workflow

Reorganized:
- tests/unit/: Moved existing unit tests
- tests/README.md: Test documentation

Total: 29 new E2E tests
Copilot AI review requested due to automatic review settings December 27, 2025 14:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a comprehensive E2E test suite for the CLI wrapper, validating P0 CLI commands against the actual capiscio-core binary. The implementation includes 29 new E2E tests across validation, badge, scoring, and status commands, along with supporting test infrastructure and CI/CD workflows.

Key Changes

  • Added 29 E2E tests organized into 4 test files covering validate, badge, score, and status commands
  • Reorganized tests into tests/unit/ and tests/e2e/ directories with comprehensive unit tests for CLI and manager modules
  • Created test infrastructure including pytest configuration, fixtures, and GitHub Actions workflows for both unit and E2E testing

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Complete dependency lock file with all test and development dependencies
pytest.ini Pytest configuration with markers for E2E and unit tests
pyproject.toml Added test dependencies section for pytest and pytest-cov
tests/README.md Comprehensive documentation for running and configuring tests
tests/unit/test_manager.py Unit tests for the manager module covering platform detection, binary management, and execution
tests/unit/test_cli.py Unit tests for CLI module covering argument passing, wrapper commands, and exit codes
tests/e2e/conftest.py Shared E2E test fixtures for server connection, API configuration, and test data
tests/e2e/fixtures/*.json Test data files including valid, invalid, and malformed agent cards
tests/e2e/test_validate_e2e.py E2E tests for validate command (8 tests)
tests/e2e/test_score_e2e.py E2E tests for score command (4 tests)
tests/e2e/test_badge_e2e.py E2E tests for badge issue/verify commands (9 tests)
tests/e2e/test_status_e2e.py E2E tests for status commands (8 tests)
.github/workflows/test.yml Unit test workflow for multiple Python versions and OS platforms
.github/workflows/e2e.yml E2E test workflow with local server and optional dev environment testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove test_score_e2e.py (CLI has no 'score' command)
- Remove test_status_e2e.py (CLI has no 'status' command)
- Update conftest.py to remove server dependencies
- Fix test_validate_e2e.py to use --schema-only for offline validation
- Fix test_badge_e2e.py to use --self-sign and --accept-self-signed
- Update valid-agent-card.json to match A2A v1.3.0 schema
- Simplify e2e.yml workflow (no longer needs server/postgres)

Tests now run entirely offline using CLI features:
- badge issue --self-sign
- badge verify --accept-self-signed --offline
- validate --schema-only
Copilot AI review requested due to automatic review settings December 27, 2025 15:50
@github-actions
Copy link

✅ All checks passed! Ready for review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 14 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove unused imports (os, json) from test files
- Rename malformed.json to malformed.txt to avoid linter issues
- Update tests/README.md to match actual test coverage
@github-actions
Copy link

✅ All checks passed! Ready for review.

The test was failing on Windows CI because Path('/bin/capiscio')
normalizes to backslashes on Windows. Compare using str(binary_path)
to ensure consistent comparison across platforms.
Copilot AI review requested due to automatic review settings December 27, 2025 20:13
@github-actions
Copy link

✅ All checks passed! Ready for review.

@beonde beonde merged commit 4c905c6 into main Dec 27, 2025
23 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- ✅ JSON output format
- ✅ Help command

### ├── test_validate_e2e.sue self-signed badge
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

Line 58 contains a broken line that appears to be incorrectly formatted: "### ├── test_validate_e2e.sue self-signed badge". This appears to be a copy-paste error or incomplete edit. The section header is malformed and the content doesn't make sense ("sue self-signed badge"). This should likely be removed or replaced with proper documentation about the Badge Command test coverage.

Suggested change
### ├── test_validate_e2e.sue self-signed badge
### Badge Command (`test_badge_e2e.py`)

Copilot uses AI. Check for mistakes.
### Run Specific Test File

```bash
pytest tests/e2scio --cov-report=html
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

There's an error in the example command. Line 35 shows pytest tests/e2scio --cov-report=html where "e2scio" should be "e2e". This is a typo in the documentation that would cause the command to fail.

Suggested change
pytest tests/e2scio --cov-report=html
pytest tests/e2e/ --cov-report=html

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +47
- name: Run unit tests
run: |
pytest tests/unit/ -v --cov=capiscio --cov-report=xml --cov-report=term
- name: Run E2E tests
run: |
pytest tests/e2e/ -v --tb=short
- name: Upload coverage reports
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The E2E workflow is running unit tests (lines 32-34) in addition to E2E tests. This duplicates the work done in the separate unit test workflow (test.yml). The E2E workflow should only run E2E tests to avoid redundancy and reduce CI time.

Suggested change
- name: Run unit tests
run: |
pytest tests/unit/ -v --cov=capiscio --cov-report=xml --cov-report=term
- name: Run E2E tests
run: |
pytest tests/e2e/ -v --tb=short
- name: Upload coverage reports
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Run E2E tests
run: |
pytest tests/e2e/ -v --tb=short

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants