Conversation
WalkthroughThe pull request splits E2E integration tests into two parallel batches by introducing a configurable workflow input parameter, creating separate GitHub Actions jobs for each batch, adding corresponding Go test functions, and defining new Make targets to orchestrate the batch executions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/integration-tests.yaml:
- Line 153: The workflow runs user input unsafely via the line containing make
${{ inputs.e2e_target }}, so validate and quote the e2e_target input before
executing: constrain inputs.e2e_target to an allowlist or a strict regex (e.g.,
only letters/numbers/[-_]) and then invoke make with the validated, quoted value
(use the inputs.e2e_target identifier) so the shell executes a single safe token
instead of allowing command injection.
In @.github/workflows/tests.yaml:
- Around line 107-116: The reusable workflow hardcodes KIND_NAME causing
parallel batch collision; add a new input named kind_name to the reusable
workflow (default "kube") and update the crd-e2e job to use this input instead
of the hardcoded KIND_NAME, then pass unique values from the callers
(integration-tests-batch1 and integration-tests-batch2) via the with: block
(e.g., kind_name: kube-batch1 and kind_name: kube-batch2) so each batch uses a
distinct Kind cluster name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6bcd0b81-c830-4352-be1f-e3396f76e514
📒 Files selected for processing (4)
.github/workflows/integration-tests.yaml.github/workflows/tests.yamlintegration/e2e_test.gomake/test-integration.mk
| working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider | ||
| run: | | ||
| make test-e2e-integration | ||
| make ${{ inputs.e2e_target }} |
There was a problem hiding this comment.
Validate and quote e2e_target before shell execution.
Line [153] executes a raw workflow input in bash. That allows command injection if an unexpected value is passed via workflow_call.
🔒 Proposed fix
- - name: Run E2E Tests
- working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
- run: |
- make ${{ inputs.e2e_target }}
+ - name: Run E2E Tests
+ working-directory: ${{ env.GOPATH }}/src/github.com/akash-network/provider
+ run: |
+ target='${{ inputs.e2e_target }}'
+ case "$target" in
+ test-e2e-integration|test-e2e-integration-batch1|test-e2e-integration-batch2) ;;
+ *) echo "invalid e2e_target: $target" >&2; exit 1 ;;
+ esac
+ make "$target"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/integration-tests.yaml at line 153, The workflow runs user
input unsafely via the line containing make ${{ inputs.e2e_target }}, so
validate and quote the e2e_target input before executing: constrain
inputs.e2e_target to an allowlist or a strict regex (e.g., only
letters/numbers/[-_]) and then invoke make with the validated, quoted value (use
the inputs.e2e_target identifier) so the shell executes a single safe token
instead of allowing command injection.
| integration-tests-batch1: | ||
| uses: ./.github/workflows/integration-tests.yaml | ||
| with: | ||
| e2e_target: test-e2e-integration-batch1 | ||
|
|
||
| integration-tests-batch2: | ||
| uses: ./.github/workflows/integration-tests.yaml | ||
| with: | ||
| e2e_target: test-e2e-integration-batch2 | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Find and inspect the integration-tests.yaml workflow
find .github -name "*.yaml" -o -name "*.yml" | head -20Repository: akash-network/provider
Length of output: 314
🏁 Script executed:
# Check if integration-tests.yaml exists and read relevant sections
if [ -f ".github/workflows/integration-tests.yaml" ]; then
echo "=== integration-tests.yaml exists ==="
wc -l ".github/workflows/integration-tests.yaml"
echo ""
echo "=== Lines around 24 (KIND_NAME) ==="
sed -n '15,35p' ".github/workflows/integration-tests.yaml"
echo ""
echo "=== Inputs section ==="
rg -A 20 "^inputs:" ".github/workflows/integration-tests.yaml" | head -40
fiRepository: akash-network/provider
Length of output: 678
🏁 Script executed:
# Check the tests.yaml file for how it calls the reusable workflow
if [ -f ".github/workflows/tests.yaml" ]; then
echo "=== Lines 107-116 from tests.yaml ==="
sed -n '107,116p' ".github/workflows/tests.yaml"
echo ""
echo "=== Full context of integration-tests calls ==="
sed -n '100,140p' ".github/workflows/tests.yaml"
fiRepository: akash-network/provider
Length of output: 1395
🏁 Script executed:
# Search for any kind_name or KIND_NAME usage across workflows
echo "=== Searching for kind_name or KIND_NAME in workflows ==="
rg -i "kind.?name" .github/workflows/ -A 2 -B 2Repository: akash-network/provider
Length of output: 904
🏁 Script executed:
# Get full structure of integration-tests.yaml to understand jobs
echo "=== Full integration-tests.yaml with job names ==="
cat -n ".github/workflows/integration-tests.yaml" | grep -E "^\s*[0-9]+\s+(jobs:|[a-z-]+:)" | head -40Repository: akash-network/provider
Length of output: 1633
🏁 Script executed:
# Get the inputs section and full job list
echo "=== Integration-tests.yaml - inputs and jobs section ==="
sed -n '1,80p' ".github/workflows/integration-tests.yaml" | cat -nRepository: akash-network/provider
Length of output: 3486
🏁 Script executed:
# Search for all job definitions and their conditions in integration-tests.yaml
echo "=== All jobs in integration-tests.yaml ==="
rg "^ [a-z-]+:" ".github/workflows/integration-tests.yaml" -A 5 | head -80Repository: akash-network/provider
Length of output: 158
🏁 Script executed:
# Get complete job names from integration-tests.yaml
echo "=== All job definitions in integration-tests.yaml ==="
rg "^ [a-z0-9-]+:$" ".github/workflows/integration-tests.yaml"Repository: akash-network/provider
Length of output: 137
🏁 Script executed:
# Check the full file to see structure
echo "=== Line count and structure ==="
wc -l ".github/workflows/integration-tests.yaml"
echo ""
echo "=== Section headers (jobs, needs, etc) ==="
grep -n "^jobs:\|^ [a-z-]*:\|^ if:\|^ needs:" ".github/workflows/integration-tests.yaml" | head -50Repository: akash-network/provider
Length of output: 206
🏁 Script executed:
# Get the lines where e2e_target is used
echo "=== Where e2e_target is used in integration-tests.yaml ==="
rg -n "e2e_target" ".github/workflows/integration-tests.yaml" -B 2 -A 2Repository: akash-network/provider
Length of output: 481
🏁 Script executed:
# Check if kind_name input exists in integration-tests.yaml
echo "=== Check inputs section of integration-tests.yaml ==="
sed -n '5,15p' ".github/workflows/integration-tests.yaml"
echo ""
echo "=== Search for any kind_name or cluster isolation in integration-tests.yaml ==="
rg -i "kind.name|cluster.name" ".github/workflows/integration-tests.yaml" -B 3 -A 3Repository: akash-network/provider
Length of output: 934
🏁 Script executed:
# Check if there's any unique naming strategy or runner isolation config
echo "=== Check for runner labels or self-hosted config ==="
rg "runs-on:|self-hosted" ".github/workflows/" -B 2 -A 2 | head -60Repository: akash-network/provider
Length of output: 2545
🏁 Script executed:
# Check if github.run_id or other unique vars are used anywhere for isolation
echo "=== Check for unique run identifiers used in Kind setup ==="
rg "github\.(run_id|run_number|job)" ".github/workflows/integration-tests.yaml" -B 2 -A 2Repository: akash-network/provider
Length of output: 125
🏁 Script executed:
# Final confirmation: kind_name does not exist as input
echo "=== All inputs in integration-tests.yaml ==="
sed -n '5,13p' ".github/workflows/integration-tests.yaml"Repository: akash-network/provider
Length of output: 296
Parallel batches collide on hardcoded Kind cluster name.
Both batch jobs invoke crd-e2e from the same reusable workflow in parallel, and KIND_NAME: kube is hardcoded (.github/workflows/integration-tests.yaml, line 24). On core-e2e self-hosted runners sharing a Docker daemon, concurrent jobs will conflict on the same cluster name, causing flaky test failures.
Add a kind_name input to the reusable workflow and pass unique values per batch (e.g., kube-batch1, kube-batch2) to isolate cluster namespaces:
Suggested mitigation
In .github/workflows/integration-tests.yaml, add to inputs:
kind_name:
description: 'Kind cluster name'
required: false
default: 'kube'
type: stringThen update the crd-e2e job to use it instead of the hardcoded value, and in .github/workflows/tests.yaml, pass unique names:
integration-tests-batch1:
uses: ./.github/workflows/integration-tests.yaml
with:
e2e_target: test-e2e-integration-batch1
kind_name: kube-batch1
integration-tests-batch2:
uses: ./.github/workflows/integration-tests.yaml
with:
e2e_target: test-e2e-integration-batch2
kind_name: kube-batch2🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/tests.yaml around lines 107 - 116, The reusable workflow
hardcodes KIND_NAME causing parallel batch collision; add a new input named
kind_name to the reusable workflow (default "kube") and update the crd-e2e job
to use this input instead of the hardcoded KIND_NAME, then pass unique values
from the callers (integration-tests-batch1 and integration-tests-batch2) via the
with: block (e.g., kind_name: kube-batch1 and kind_name: kube-batch2) so each
batch uses a distinct Kind cluster name.
|
At this point, longest job ( Integration tests batch ) composed of 2 parts:
k8s configuration breakdown:
Total: 8m 34s. 71% of the time is spent on Go binary compilation and Docker image building, with the remaining 29% split across cluster setup, dependency downloads, and rollout waits. |
|
Other notes:
|
Summary
Split E2E integration tests into two parallel batches to reduce overall CI wall time.
Previously, all 12 test suites ran sequentially in a single
TestIntegrationTestSuitefunction. Each suite performs a full stack setup (in-process testnet, provider, operators) and teardown independently, with no ordering dependencies between suites — making them safe to split.Changes
integration/e2e_test.go— addedTestIntegrationBatch1andTestIntegrationBatch2alongside the existingTestIntegrationTestSuite; removed duplicateE2EPersistentStorageDefaultentry that was previously run twiceE2EContainerToContainerE2EAppNodePortE2EDeploymentUpdateE2EAppE2EMigrateHostnameE2EPersistentStorageDefaultE2EPersistentStorageBeta2E2EPersistentStorageDeploymentUpdateE2EStorageClassRamE2ECustomCurrencyE2EIPAddressmake/test-integration.mk— addedtest-e2e-integration-batch1andtest-e2e-integration-batch2targets.github/workflows/integration-tests.yaml— addede2e_targetinput (default:test-e2e-integration) to make the reusable workflow target-parametric.github/workflows/tests.yaml— replaced singleintegration-testsjob with two parallel jobs (integration-tests-batch1,integration-tests-batch2), each passing the respective make target; both are required fordispatch-releaseExpected impact
Each parallel job runs its own Kind cluster (full isolation, no shared k8s state). Aims to reduce overall integration tests CI time.