Files
kubevela/.github/actions/env-setup
Ayush KumarandGitHub ea409c7437 Refactor: controller setup and improve server tests (#6958)
* Feat: Add integration test setup and cleanup scripts, enhance server testing capabilities

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Rename variables for clarity and consistency in core command handling

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Remove redundant server test targets and enhance logging in core command execution

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor server tests and enhance E2E testing setup

- Updated server_test.go to improve test organization and clarity, including the addition of BeforeSuite and AfterSuite for environment setup and teardown.
- Enhanced the waitWebhookSecretVolume tests to cover various scenarios including empty directories and files.
- Added new tests for syncConfigurations and logging setup functions to ensure proper configuration handling.
- Introduced a new E2E test for the main function in main_e2e_test.go to validate the core functionality of the application.
- Improved the e2e.mk file to set up a k3d cluster for running main_e2e_test with embedded test binaries and added cleanup steps.
- Removed the setup-integration-tests.sh script as its functionality is now integrated into the Makefile.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor:  improve multicluster test timeouts

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-11-05 10:23:24 +00:00
..

Kubevela Test Environment Setup Action

A GitHub Actions composite action that sets up a complete testing environment for Kubevela projects with Go, Kubernetes tools, and the Ginkgo testing framework.

Features

  • 🛠️ System Dependencies: Installs essential build tools (make, gcc, jq, curl, etc.)
  • ☸️ Kubernetes Tools: Sets up kubectl and Helm for cluster operations
  • 🐹 Go Environment: Configurable Go version with module caching
  • 📦 Dependency Management: Downloads and verifies Go module dependencies
  • 🧪 Testing Framework: Installs Ginkgo v2 for BDD-style testing

Usage

- name: Setup Kubevela Test Environment
  uses: ./path/to/this/action
  with:
    go-version: '1.23.8'      # Optional: Go version (default: 1.23.8)

Example Workflow

name: Kubevela Tests
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Test Environment
        uses: ./path/to/this/action
        with:
          go-version: '1.21'
          
      - name: Run Tests
        run: |
          ginkgo -r ./tests/e2e/

Inputs

Input Description Required Default Usage
go-version Go version to install and use No 1.23.8 Specify Go version for your project

What This Action Installs

System Tools

  • make: Build automation tool
  • gcc: GNU Compiler Collection
  • jq: JSON processor for shell scripts
  • ca-certificates: SSL/TLS certificates
  • curl: HTTP client for downloads
  • gnupg: GNU Privacy Guard for security

Kubernetes Ecosystem

  • kubectl: Kubernetes command-line tool (latest stable)
  • helm: Kubernetes package manager (latest stable)

Go Development

  • Go Runtime: Specified version with module caching enabled
  • Go Modules: Downloaded and verified dependencies
  • Ginkgo v2.14.0: BDD testing framework for Go