Skip to content

feat(volcengine): Phase 6 - Documentation, Samples & Testing #185

@Blankll

Description

@Blankll

Phase 6: Documentation, Samples & Testing

Parent Epic: #179
Depends on: All previous phases

Overview

Complete the Volcengine provider implementation with comprehensive documentation, sample configurations, and test coverage.

Tasks

1. Sample Configurations

Create sample YAML files in samples/ directory:

1.1 Basic Function

  • samples/volcengine-poc-function.yml - Minimal function example
version: 0.1.0
provider:
  name: volcengine
  region: cn-beijing

app: insight-poc
service: insight-poc-basic

functions:
  hello:
    name: poc-hello
    code:
      runtime: nodejs/18
      handler: index.handler
      path: ./artifacts/hello.zip
    memory: 128
    timeout: 30

1.2 Function with API Gateway

  • samples/volcengine-poc-api.yml - API Gateway integration

1.3 Object Storage

  • samples/volcengine-poc-bucket.yml - TOS bucket with static website

1.4 VPC Function

  • samples/volcengine-poc-vpc.yml - Function with VPC configuration

1.5 Complete Example

  • samples/volcengine-poc-complete.yml - Full-stack serverless app
version: 0.1.0
provider:
  name: volcengine
  region: cn-beijing

vars:
  runtime: nodejs/18

stages:
  dev:
    memory: 256
  prod:
    memory: 512

app: insight-poc
service: insight-poc-complete

tags:
  owner: geek-fun
  environment: ${stages.stage}

functions:
  api_handler:
    name: poc-api-handler
    code:
      runtime: ${vars.runtime}
      handler: index.handler
      path: ./artifacts/api.zip
    memory: ${stages.memory}
    timeout: 30
    environment:
      NODE_ENV: ${stages.node_env}

events:
  api:
    type: API_GATEWAY
    name: poc-gateway
    triggers:
      - method: GET
        path: /api/hello
        backend: ${functions.api_handler}
    domain:
      domain_name: api.serverlessinsights.com

buckets:
  static_assets:
    name: poc-static-assets
    security:
      acl: public-read
    website:
      code: ./dist
      index: index.html

2. Test Artifacts

  • tests/fixtures/artifacts/volcengine-function.zip - Test function code
  • Ensure test fixtures work with Volcengine runtimes

3. Unit Tests

3.1 Client Operations Tests

  • tests/common/volcengineClient/vefaasOperations.test.ts
  • tests/common/volcengineClient/tosOperations.test.ts
  • tests/common/volcengineClient/iamOperations.test.ts
  • tests/common/volcengineClient/apigwOperations.test.ts

3.2 Resource Tests

  • tests/stack/volcengineStack/vefaasResource.test.ts
  • tests/stack/volcengineStack/tosResource.test.ts
  • tests/stack/volcengineStack/apigwResource.test.ts

3.3 Planner Tests

  • tests/stack/volcengineStack/vefaasPlanner.test.ts
  • tests/stack/volcengineStack/tosPlanner.test.ts
  • tests/stack/volcengineStack/apigwPlanner.test.ts

3.4 Integration Tests

  • tests/stack/volcengineStack/deployer.test.ts
  • tests/stack/volcengineStack/destroyer.test.ts

4. Documentation

4.1 README Update

  • Update main README.md provider table
  • Add Volcengine to supported providers list
| Provider | Functions | API Gateway | Storage | Status |
|----------|-----------|-------------|---------|--------|
| **Volcengine** | ✅ veFaaS | ✅ API Gateway | ✅ TOS | Stable |

4.2 Provider Documentation

  • docs/providers/volcengine.md - Provider-specific documentation
# Volcengine Provider

## Configuration

### Credentials

Set environment variables:
\`\`\`bash
export VOLCSTACK_ACCESS_KEY_ID="your-access-key"
export VOLCSTACK_SECRET_ACCESS_KEY="your-secret-key"
\`\`\`

### Regions

| Region | Code |
|--------|------|
| 华北2(北京) | cn-beijing |
| 华东2(上海) | cn-shanghai |
| 华南1(广州) | cn-guangzhou |

### Supported Services

- **veFaaS** - Function Compute
- **TOS** - Object Storage
- **API Gateway** - HTTP API hosting

## Example

\`\`\`yaml
provider:
  name: volcengine
  region: cn-beijing
\`\`\`

4.3 Sample README

  • samples/README_VOLCENGINE.md - Sample documentation

5. CI/CD Updates

  • Update GitHub Actions workflows for Volcengine tests
  • Add Volcengine credentials to secrets (for integration tests)
  • Update codecov configuration

6. Changelog

  • Add Volcengine provider to CHANGELOG.md
## [Unreleased]

### Added
- Volcengine provider support
  - veFaaS Function Service
  - TOS Object Storage
  - API Gateway integration
  - IAM role management
  - VPC configuration

Test Coverage Requirements

Component Target Coverage
Client Operations ≥ 80%
Resource Lifecycle ≥ 85%
Planner Logic ≥ 90%
Executor ≥ 80%

Acceptance Criteria

Must Have

  • All sample configurations deploy successfully
  • All sample configurations destroy successfully
  • Unit test coverage ≥ 80% for new code
  • All tests pass: npm test
  • Lint passes: npm run lint:check
  • Build passes: npm run build
  • README.md updated with Volcengine support

Should Have

  • Integration tests with real Volcengine credentials
  • Documentation site updated
  • Migration guide from Aliyun/Tencent

Nice to Have

  • Video tutorial
  • Blog post announcement
  • Performance benchmarks

References

Estimated Effort

Medium (3-4 days)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions