Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8fb95f7
chore(tests): e2e-next framework init
adriankabala Oct 31, 2025
b71a654
chore(tests): use cluster instead of envfuncs
adriankabala Nov 3, 2025
8bd6c77
chore(tests): vcluster setup upgrade to use ctx
adriankabala Nov 3, 2025
cf13d02
chore(test): upgrade test_k8sdefaultendpoint
adriankabala Nov 3, 2025
f75aedb
chore(test): upgrade test_helm_charts
adriankabala Nov 3, 2025
fb78a4f
chore(test): rewrite test_init_manifests to new framework
adriankabala Nov 3, 2025
1bc082c
chore(test): lint fixes
adriankabala Nov 3, 2025
4f14a2e
chore(tests): fix after test execution
adriankabala Nov 3, 2025
aec3615
chore(test): cleanup
adriankabala Nov 3, 2025
ade742d
chore(tests): Add e2e-labels command to Justfile
adriankabala Nov 4, 2025
1ed6d05
chore(test): e2e-next rename host clusterName
adriankabala Nov 4, 2025
dcc262e
chore: skip e2e-next linter errors and from unit tests
sydorovdmytro Nov 4, 2025
3328794
chore(tests): fix after CR, update framework version
adriankabala Nov 6, 2025
6f04a5c
Merge branch 'main' into ak_e2e-next-framework
adriankabala Nov 6, 2025
f23da70
chore(test): lint fixes
adriankabala Nov 6, 2025
8b15a3e
chore(tests): Added WithGeneratedName
adriankabala Nov 7, 2025
38e3203
chore(test): framework upgrade
adriankabala Nov 7, 2025
0bb30b6
chore(test): framework upgrade
adriankabala Nov 7, 2025
ef50fd3
chore(test): removed generated name
adriankabala Nov 7, 2025
cca7bd6
chore(tests): rename deploy to install
adriankabala Nov 7, 2025
2833dfa
chore(test): cleanup
adriankabala Nov 7, 2025
a6ce879
Merge remote-tracking branch 'origin/main' into ak_e2e-next-framework
adriankabala Nov 7, 2025
2cc99ce
chore(tests): move vcluster conf to files
adriankabala Nov 7, 2025
78dfafa
chore(tests): cleanup
adriankabala Nov 7, 2025
197589e
chore(tests): fixes after CR
adriankabala Nov 12, 2025
82ea5bf
chore(tests): Fix AfterAll removing vcluster check
adriankabala Nov 12, 2025
ba3ccdf
chore(tests): fixes after CR
adriankabala Nov 12, 2025
87a7f67
feat(ci): add ginkgo e2e pipeline for PRs (#3350)
sydorovdmytro Nov 20, 2025
2b8e2c3
chore(test): fixes and workflow updates
adriankabala Nov 20, 2025
bb11201
chore(test): change vcluster provider to internal
adriankabala Nov 21, 2025
fb1b5a3
chore(test): add debug
adriankabala Nov 21, 2025
53d313f
chore(test): debug
adriankabala Nov 21, 2025
a3080f8
Update e2e-ginkgo.yaml
adriankabala Nov 21, 2025
6808b31
chore(test): debug
adriankabala Nov 21, 2025
e8e165a
chore(tests): debug
adriankabala Nov 21, 2025
aae65b2
chore(test): debug
adriankabala Nov 21, 2025
fe72dd3
chore(test): add vcluster cli os.Getenv
adriankabala Nov 21, 2025
8223384
chore(tests): Changed withversion to withpath
adriankabala Nov 21, 2025
b2f29fa
chore(test): try static vcluster path
adriankabala Nov 21, 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 }}"
"--fail-fast"
"--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