Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ad2db85
chore(tests): e2e-next framework init
adriankabala Oct 31, 2025
83dd331
chore(tests): use cluster instead of envfuncs
adriankabala Nov 3, 2025
d6feac1
chore(tests): vcluster setup upgrade to use ctx
adriankabala Nov 3, 2025
becc30e
chore(test): upgrade test_k8sdefaultendpoint
adriankabala Nov 3, 2025
6905936
chore(test): upgrade test_helm_charts
adriankabala Nov 3, 2025
096dbc3
chore(test): rewrite test_init_manifests to new framework
adriankabala Nov 3, 2025
ed3012e
chore(test): lint fixes
adriankabala Nov 3, 2025
995145a
chore(tests): fix after test execution
adriankabala Nov 3, 2025
f94ffba
chore(test): cleanup
adriankabala Nov 3, 2025
6171dc9
chore(tests): Add e2e-labels command to Justfile
adriankabala Nov 4, 2025
dfe0043
chore(test): e2e-next rename host clusterName
adriankabala Nov 4, 2025
9e7df3b
chore: skip e2e-next linter errors and from unit tests
sydorovdmytro Nov 4, 2025
a2f3581
chore(tests): fix after CR, update framework version
adriankabala Nov 6, 2025
81ea70c
chore(test): lint fixes
adriankabala Nov 6, 2025
996a07b
chore(tests): Added WithGeneratedName
adriankabala Nov 7, 2025
3cc7c31
chore(test): framework upgrade
adriankabala Nov 7, 2025
f63722c
chore(test): framework upgrade
adriankabala Nov 7, 2025
8506594
chore(test): removed generated name
adriankabala Nov 7, 2025
12db86c
chore(tests): rename deploy to install
adriankabala Nov 7, 2025
0c96650
chore(test): cleanup
adriankabala Nov 7, 2025
c4fce2b
chore(tests): move vcluster conf to files
adriankabala Nov 7, 2025
9874d59
chore(tests): cleanup
adriankabala Nov 7, 2025
06ddca6
chore(tests): fixes after CR
adriankabala Nov 12, 2025
4d06d16
chore(tests): Fix AfterAll removing vcluster check
adriankabala Nov 12, 2025
2cab3b1
chore(tests): fixes after CR
adriankabala Nov 12, 2025
5d5c2e5
feat(ci): add ginkgo e2e pipeline for PRs (#3350)
sydorovdmytro Nov 20, 2025
dbe2f21
chore(test): fixes and workflow updates
adriankabala Nov 20, 2025
333496f
chore(test): change vcluster provider to internal
adriankabala Nov 21, 2025
86a6d3f
chore(test): add debug
adriankabala Nov 21, 2025
24c5996
chore(test): debug
adriankabala Nov 21, 2025
f0e7845
Update e2e-ginkgo.yaml
adriankabala Nov 21, 2025
a07c999
chore(test): debug
adriankabala Nov 21, 2025
bbd5844
chore(tests): debug
adriankabala Nov 21, 2025
18ed0dd
chore(test): debug
adriankabala Nov 21, 2025
d319da9
chore(test): add vcluster cli os.Getenv
adriankabala Nov 21, 2025
60ff5da
chore(tests): Changed withversion to withpath
adriankabala Nov 21, 2025
b37e413
chore(test): try static vcluster path
adriankabala Nov 21, 2025
23ac6ab
test: refactor suite to use suite dependencies and concurrent setup /…
lizardruss Dec 5, 2025
ff35907
test: run tests concurrently
lizardruss Dec 5, 2025
55f6f2d
test: run CI tests concurrently
lizardruss Dec 8, 2025
a9f1682
test: set CI ginkgo e2e permissions
lizardruss Dec 8, 2025
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
204 changes: 204 additions & 0 deletions .github/actions/run-ginkgo-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: "Run vCluster Ginkgo E2E Tests"
description: "Execute Ginkgo-based e2e tests with support for both directory-based and label-based filtering"
inputs:
image:
description: "Docker image to use for testing"
required: true
timeout:
description: "Test timeout"
required: false
default: "40m"
# Test selection strategy - mutually exclusive
test-dir:
description: "Directory containing tests relative to e2e-next/ (for directory-based testing)"
required: false
default: ""
ginkgo-label:
description: "Ginkgo label to filter tests (for label-based testing)"
required: false
default: ""
e2e-dir:
description: "E2E directory containing all test suites"
required: false
default: "e2e-next"

outputs:
failure-summary:
description: "Summary of test failures (if any)"
value: ${{ steps.generate-summary.outputs.failure-summary }}

runs:
using: "composite"
steps:
- name: Validate inputs
shell: bash
run: |
if [[ -z "${{ inputs.test-dir }}" && -z "${{ inputs.ginkgo-label }}" ]]; then
echo "Error: Either test-dir or ginkgo-label must be provided"
exit 1
fi

if [[ -n "${{ inputs.test-dir }}" && -n "${{ inputs.ginkgo-label }}" ]]; then
echo "Error: test-dir and ginkgo-label are mutually exclusive"
exit 1
fi

- name: Download vcluster cli
uses: actions/download-artifact@v6
with:
name: vcluster

- name: Download syncer image
uses: actions/download-artifact@v6
with:
name: vcluster_syncer

- name: Install Ginkgo CLI
shell: bash
run: |
cd "${{ inputs.e2e-dir }}"
go install github.com/onsi/ginkgo/v2/ginkgo

- name: Clean up docker images
shell: bash
run: |
# Clean up docker images to free space
docker image prune --all --force --filter="label!=PRUNE=false"

- name: Load syncer image
shell: bash
run: |
docker load --input vcluster_syncer
chmod +x vcluster && sudo mv vcluster /usr/bin
docker image ls --all

- name: Execute Ginkgo tests
shell: bash
run: |
set -x
# Get absolute workspace path
WORKSPACE_ROOT="$(pwd)"
echo "Workspace root: ${WORKSPACE_ROOT}"

REPORTS_DIR="${WORKSPACE_ROOT}/test-reports"
mkdir -p "${REPORTS_DIR}"

# Export for use in subsequent steps
echo "REPORTS_DIR=${REPORTS_DIR}" >> $GITHUB_ENV
echo "Report directory set to: ${REPORTS_DIR}"

if [[ -n "${{ inputs.test-dir }}" ]]; then
echo "Running directory-based tests in: ${{ inputs.test-dir }}"
TEST_STRATEGY="directory"
WORKING_DIR="${{ inputs.e2e-dir }}/${{ inputs.test-dir }}"
# Relative path from test-dir to workspace root
REPORT_PATH="../../test-reports/report.json"
else
echo "Running label-based tests with filter: ${{ inputs.ginkgo-label }}"
TEST_STRATEGY="label"
WORKING_DIR="${{ inputs.e2e-dir }}"
# Relative path from e2e-dir to workspace root
REPORT_PATH="../test-reports/report.json"
fi

# Trim whitespaces and newlines from label filter
LABEL_FILTER=$(echo "${{ inputs.ginkgo-label }}" | awk '{$1=$1; print}')

# Build ginkgo command - temporarily disable json-report due to nil pointer issue
# TODO: Investigate why --json-report causes panic with custom e2e framework
GINKGO_ARGS=(
"run"
"--timeout=${{ inputs.timeout }}"
"--procs=4"
"--show-node-events"
"--poll-progress-after=20s"
"--poll-progress-interval=10s"
"--github-output"
"--json-report=${REPORT_PATH}"
"-v"
)

# Add strategy-specific flags
if [[ "$TEST_STRATEGY" == "label" ]]; then
GINKGO_ARGS+=("--label-filter=${LABEL_FILTER} || pr")
GINKGO_ARGS+=("-r")
fi

echo "Working directory: ${WORKING_DIR}"
echo "Test strategy: ${TEST_STRATEGY}"
echo "Report path: ${REPORT_PATH}"
echo "Command: ginkgo ${GINKGO_ARGS[*]} ."

# Run tests
cd "${WORKING_DIR}"
echo "Running tests from: $(pwd)"

ginkgo "${GINKGO_ARGS[@]}" . -- --vcluster-image="${{ inputs.image }}" --teardown=false

- name: Generate failure summary
id: generate-summary
if: always() # Run even if tests failed
shell: bash
run: |
# Generate failure summary if JSON report exists
if [[ -f "test-reports/report.json" ]]; then
echo "Generating failure summary from JSON report..."

# Extract test statistics and failures
STATS=$(jq -r '
{
failed: ([.[].SpecReports[] | select(.State == "failed")] | length),
passed: ([.[].SpecReports[] | select(.State == "passed")] | length),
skipped: ([.[].SpecReports[] | select(.State == "skipped")] | length),
total_specs: (.[0].PreRunStats.TotalSpecs // 0),
specs_to_run: (.[0].PreRunStats.SpecsThatWillRun // 0),
runtime: ((.[0].RunTime // 0) / 1000000000 | floor)
}
' test-reports/report.json)

FAILED_COUNT=$(echo "$STATS" | jq -r '.failed')
PASSED_COUNT=$(echo "$STATS" | jq -r '.passed')
SKIPPED_COUNT=$(echo "$STATS" | jq -r '.skipped')
TOTAL_SPECS=$(echo "$STATS" | jq -r '.total_specs')
SPECS_TO_RUN=$(echo "$STATS" | jq -r '.specs_to_run')
RUNTIME=$(echo "$STATS" | jq -r '.runtime')

echo "failure-summary<<EOF" >> $GITHUB_OUTPUT

if [[ "$FAILED_COUNT" -gt 0 ]]; then
echo "*Test Results Summary:*" >> $GITHUB_OUTPUT
echo "📊 Executed: $SPECS_TO_RUN/$TOTAL_SPECS tests" >> $GITHUB_OUTPUT
echo "❌ Failed: $FAILED_COUNT" >> $GITHUB_OUTPUT
echo "✅ Passed: $PASSED_COUNT" >> $GITHUB_OUTPUT
if [[ "$SKIPPED_COUNT" -gt 0 ]]; then
echo "⏭️ Skipped: $SKIPPED_COUNT" >> $GITHUB_OUTPUT
fi
echo "⏱️ Duration: ${RUNTIME}s" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "*Failed Tests:*" >> $GITHUB_OUTPUT

# Extract failed test details
jq -r '[.[].SpecReports[] | select(.State == "failed")] |
.[] |
"❌ [FAIL] [\(.LeafNodeType)]" +
(if .ContainerHierarchyTexts then " " + (.ContainerHierarchyTexts | join(" ")) else "" end) +
(if .LeafNodeText != "" then " " + .LeafNodeText else "" end) +
"\n 📍 " + .LeafNodeLocation.FileName + ":" + (.LeafNodeLocation.LineNumber | tostring)' \
test-reports/report.json >> $GITHUB_OUTPUT
else
echo "*Test Results Summary:*" >> $GITHUB_OUTPUT
echo "📊 Executed: $SPECS_TO_RUN/$TOTAL_SPECS tests" >> $GITHUB_OUTPUT
echo "✅ All tests passed! ($PASSED_COUNT/$SPECS_TO_RUN)" >> $GITHUB_OUTPUT
if [[ "$SKIPPED_COUNT" -gt 0 ]]; then
echo "⏭️ Skipped: $SKIPPED_COUNT" >> $GITHUB_OUTPUT
fi
echo "⏱️ Duration: ${RUNTIME}s" >> $GITHUB_OUTPUT
fi

echo "EOF" >> $GITHUB_OUTPUT

echo "✅ Failure summary generated (Failed: $FAILED_COUNT, Passed: $PASSED_COUNT)"
else
echo "ℹ️ JSON report not found (currently disabled due to compatibility issues)"
echo "failure-summary=JSON reporting temporarily disabled - tests ran successfully, check output above for results" >> $GITHUB_OUTPUT
fi
Loading
Loading