mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 20:17:04 +00:00
* 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>
71 lines
2.4 KiB
YAML
71 lines
2.4 KiB
YAML
name: 'Kubevela K8s Upgrade Unit Test'
|
|
description: 'Runs Kubevela K8s upgrade unit tests, uploads coverage, and collects diagnostics on failure.'
|
|
|
|
inputs:
|
|
codecov-token:
|
|
description: 'Codecov token for uploading coverage reports'
|
|
required: false
|
|
default: ''
|
|
codecov-enable:
|
|
description: 'Enable codecov coverage upload'
|
|
required: false
|
|
default: 'false'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
# ========================================================================
|
|
# Environment Setup
|
|
# ========================================================================
|
|
- name: Configure environment setup
|
|
uses: ./.github/actions/env-setup
|
|
with:
|
|
install-ginkgo: 'true'
|
|
install-setup-envtest: 'true'
|
|
install-kustomize: 'true'
|
|
|
|
# ========================================================================
|
|
# Unit Test Execution
|
|
# ========================================================================
|
|
- name: Run unit tests
|
|
shell: bash
|
|
run: |
|
|
echo "Running unit tests..."
|
|
make test
|
|
|
|
- name: Upload coverage report
|
|
if: ${{ inputs.codecov-enable == 'true' }}
|
|
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
|
|
with:
|
|
token: ${{ inputs.codecov-token }}
|
|
files: ./coverage.txt
|
|
flags: core-unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
# ========================================================================
|
|
# Failure Diagnostics
|
|
# ========================================================================
|
|
- name: Collect failure diagnostics
|
|
if: failure()
|
|
shell: bash
|
|
run: |
|
|
echo "=== FAILURE DIAGNOSTICS ==="
|
|
echo "Collecting diagnostic information for debugging..."
|
|
|
|
echo "--- Go Environment ---"
|
|
go version || true
|
|
go env || true
|
|
|
|
echo "--- Cluster Status ---"
|
|
kubectl get nodes -o wide || true
|
|
kubectl get pods -A || true
|
|
|
|
echo "--- KubeVela System Logs ---"
|
|
kubectl logs -n vela-system -l app.kubernetes.io/name=vela-core --tail=100 || true
|
|
|
|
echo "--- Recent Events ---"
|
|
kubectl get events -A --sort-by='.lastTimestamp' --field-selector type!=Normal || true
|
|
|
|
echo "--- Test Artifacts ---"
|
|
find . -name "*.log" -o -name "*test*.xml" -o -name "coverage.*" | head -20 || true |