Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 2 additions & 4 deletions .github/workflows/components-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ jobs:
- name: Set up Docker Buildx
if: matrix.component.changed == 'true' || github.event.inputs.force_build_all == 'true' || contains(github.event.inputs.components, matrix.component.name) || (github.event_name == 'workflow_dispatch' && github.event.inputs.components == '' && github.event.inputs.force_build_all != 'true')
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Log in to Quay.io
if: matrix.component.changed == 'true' || github.event.inputs.force_build_all == 'true' || contains(github.event.inputs.components, matrix.component.name) || (github.event_name == 'workflow_dispatch' && github.event.inputs.components == '' && github.event.inputs.force_build_all != 'true')
Expand All @@ -138,7 +136,7 @@ jobs:
with:
context: ${{ matrix.component.context }}
file: ${{ matrix.component.dockerfile }}
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: true
tags: |
${{ matrix.component.image }}:latest
Expand All @@ -153,7 +151,7 @@ jobs:
with:
context: ${{ matrix.component.context }}
file: ${{ matrix.component.dockerfile }}
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: false
tags: ${{ matrix.component.image }}:pr-${{ github.event.pull_request.number }}
cache-from: type=gha
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: E2E Tests

# Requires GitHub Secret: ANTHROPIC_API_KEY
# Set in repository settings β†’ Secrets and variables β†’ Actions
# Without this secret, the agent session test will fail

on:
pull_request:
branches: [ main, master ]
Expand Down Expand Up @@ -169,10 +173,10 @@ jobs:
echo "======================================"
echo "Loading images into kind cluster..."
echo "======================================"
kind load docker-image quay.io/ambient_code/vteam_frontend:e2e-test --name vteam-e2e
kind load docker-image quay.io/ambient_code/vteam_backend:e2e-test --name vteam-e2e
kind load docker-image quay.io/ambient_code/vteam_operator:e2e-test --name vteam-e2e
kind load docker-image quay.io/ambient_code/vteam_claude_runner:e2e-test --name vteam-e2e
kind load docker-image quay.io/ambient_code/vteam_frontend:e2e-test --name ambient-local
kind load docker-image quay.io/ambient_code/vteam_backend:e2e-test --name ambient-local
kind load docker-image quay.io/ambient_code/vteam_operator:e2e-test --name ambient-local
kind load docker-image quay.io/ambient_code/vteam_claude_runner:e2e-test --name ambient-local
echo "βœ… All images loaded into kind cluster"

- name: Update kustomization to use e2e-test images
Expand All @@ -183,6 +187,8 @@ jobs:

- name: Deploy vTeam
working-directory: e2e
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: ./scripts/deploy.sh

- name: Verify deployment
Expand All @@ -192,12 +198,11 @@ jobs:
echo ""
echo "Checking services..."
kubectl get svc -n ambient-code
echo ""
echo "Checking ingress..."
kubectl get ingress -n ambient-code

- name: Run Cypress tests
working-directory: e2e
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: ./scripts/run-tests.sh

- name: Upload test results
Expand Down
62 changes: 0 additions & 62 deletions BRANCH_PROTECTION.md

This file was deleted.

101 changes: 55 additions & 46 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@ instead of service accounts for API operations."

### Quick Start - Local Development

**Single command setup with OpenShift Local (CRC):**
**Recommended: Kind (Kubernetes in Docker):**

```bash
# Prerequisites: Docker installed
# Fast startup, matches CI environment
make kind-up

# Access at http://localhost:8080
# Full guide: docs/developer/local-development/kind.md
```

**Alternative: OpenShift Local (CRC) - for OpenShift-specific features:**

```bash
# Prerequisites: brew install crc
Expand Down Expand Up @@ -967,72 +978,70 @@ Study these files to understand established patterns:

## Testing Strategy

### E2E Tests (Cypress + Kind)
### E2E Tests (Cypress - Portable)

**Purpose**: Automated end-to-end testing of the complete vTeam stack in a Kubernetes environment.
**Purpose**: Automated end-to-end testing of the Ambient Code Platform against any deployed instance.

**Location**: `e2e/`

**Quick Start**:

```bash
make e2e-test CONTAINER_ENGINE=podman # Or docker
# Test against local kind cluster
make test-e2e-local

# Test against external cluster
export CYPRESS_BASE_URL=https://your-frontend.com
export TEST_TOKEN=$(oc whoami -t)
cd e2e && npm test
```

**What Gets Tested**:
**Test Suites**:

- βœ… Full vTeam deployment in kind (Kubernetes in Docker)
- βœ… Frontend UI rendering and navigation
- βœ… Backend API connectivity
- βœ… Project creation workflow (main user journey)
- βœ… Authentication with ServiceAccount tokens
- βœ… Ingress routing
- βœ… All pods deploy and become ready
- **vteam.cy.ts** (5 tests): Platform smoke tests β€” auth, workspace CRUD, API connectivity
- **sessions.cy.ts** (7 tests): Session management β€” creation, UI, workflows, agent interaction

**What Doesn't Get Tested**:
**Total Runtime**: ~15 seconds (12 tests consolidated from original 29)

- ❌ OAuth proxy flow (uses direct token auth for simplicity)
- ❌ Session pod execution (requires Anthropic API key)
- ❌ Multi-user scenarios

**Test Suite** (`e2e/cypress/e2e/vteam.cy.ts`):
**What Gets Tested**:

1. UI loads with token authentication
2. Navigate to new project page
3. Create a new project
4. List created projects
5. Backend API cluster-info endpoint
- βœ… Workspace creation and navigation
- βœ… Session creation and UI components
- βœ… Workflow selection and cards
- βœ… Chat interface availability
- βœ… Breadcrumb navigation
- βœ… Backend API endpoints
- βœ… Real agent interaction (with ANTHROPIC_API_KEY)

**CI Integration**: Tests run automatically on all PRs via GitHub Actions (`.github/workflows/e2e.yml`)
**What Doesn't Get Tested**:

**Key Implementation Details**:
- ❌ OAuth proxy flow (uses direct token auth)
- ❌ OpenShift Routes (uses Ingress for kind)
- ❌ Long-running agent workflows (timeout constraints)
- ❌ Multi-user concurrent sessions

- **Architecture**: Frontend without oauth-proxy, direct token injection via environment variables
- **Authentication**: Test user ServiceAccount with cluster-admin permissions
- **Token Handling**: Frontend deployment includes `OC_TOKEN`, `OC_USER`, `OC_EMAIL` env vars
- **Podman Support**: Auto-detects runtime, uses ports 8080/8443 for rootless Podman
- **Ingress**: Standard nginx-ingress with path-based routing
**CI Integration**: Tests run automatically on all PRs via GitHub Actions (`.github/workflows/e2e.yml`) using kind + Quay.io images.

**Adding New Tests**:
**Local Development**:

```typescript
it('should test new feature', () => {
cy.visit('/some-page')
cy.contains('Expected Content').should('be.visible')
cy.get('#button').click()
// Auth header automatically injected via beforeEach interceptor
})
```bash
# Kind with production images (Quay.io)
make kind-up # Setup
make test-e2e # Test
make kind-down # Cleanup
```

**Debugging Tests**:
**Key Features**:

```bash
cd e2e
source .env.test
CYPRESS_TEST_TOKEN="$TEST_TOKEN" CYPRESS_BASE_URL="http://vteam.local:8080" npm run test:headed
```
- **Portable**: Tests run against any cluster (kind, CRC, dev, prod)
- **Fast**: 15-second runtime, one workspace reused across tests
- **Consolidated**: User journey tests, not isolated element checks
- **Real Agent Testing**: Verifies actual Claude responses (not hardcoded messages)

**Documentation**: See `e2e/README.md` and `docs/testing/e2e-guide.md` for comprehensive testing guide.
**Documentation**:
- [E2E Testing README](e2e/README.md) - Running tests
- [Kind Local Dev Guide](docs/developer/local-development/kind.md) - Using kind for development
- [E2E Testing Guide](docs/testing/e2e-guide.md) - Writing tests

### Backend Tests (Go)

Expand Down Expand Up @@ -1087,7 +1096,7 @@ Special lab track for leadership training located in `docs/labs/director-trainin

- **API keys**: Store in Kubernetes Secrets, managed via ProjectSettings CR
- **RBAC**: Namespace-scoped isolation prevents cross-project access
- **OAuth integration**: OpenShift OAuth for cluster-based authentication (see `docs/OPENSHIFT_OAUTH.md`)
- **OAuth integration**: OpenShift OAuth for cluster-based authentication (see `docs/deployment/OPENSHIFT_OAUTH.md`)
- **Network policies**: Component isolation and secure communication

### Monitoring
Expand Down
Loading
Loading