feat: unified integration matrix with gated CI signaling#241
feat: unified integration matrix with gated CI signaling#241FNGarvin wants to merge 1 commit intorunpod:mainfrom
Conversation
Reviewer's GuideIntroduces a unified CI integration test matrix that validates runpodctl installation and full API lifecycle under both root and non-root contexts, while enhancing the installer for non-root installs, architecture detection, and robust binary download behavior. Sequence diagram for integration_suite.sh lifecycle and EXPECTED_FAIL handlingsequenceDiagram
actor Dev
participant GA as GitHubActions
participant Job as Integration_job
participant Suite as integration_suite_sh
participant RP as Runpod_API
Dev->>GA: Open or update PR
GA->>Job: Trigger integration tier job (root or non root)
Job->>Suite: Execute tests/integration_suite.sh
Suite->>Suite: Check RUNPOD_API_KEY and fork status
alt Missing key or unapproved fork
Suite-->>Job: Mark result EXPECTED_FAIL
Suite-->>RP: Skip API calls
Job-->>GA: Report EXPECTED_FAIL status
else Authorized with key
Suite->>RP: Create Pod
RP-->>Suite: Pod identifier
Suite->>RP: List Pods
RP-->>Suite: Pod list
Suite->>RP: Get Pod details
RP-->>Suite: Pod spec
Suite->>RP: Update Pod configuration
RP-->>Suite: Updated spec
Suite->>RP: Stop Pod
RP-->>Suite: Stopped state
Suite->>RP: Start Pod
RP-->>Suite: Running state
Suite->>RP: Send workload or message
RP-->>Suite: Receive result or response
Suite->>RP: Delete Pod and related resources
RP-->>Suite: Deletion confirmed
Suite->>Suite: Fail safe kill switch
Suite->>RP: Cleanup any leaked Pods or Serverless
alt Any lifecycle step fails or hangs
Suite-->>Job: Mark result FAILED
else All lifecycle steps succeed
Suite-->>Job: Mark result PASSED
end
Job-->>GA: Report PASSED or FAILED status
end
Flow diagram for enhanced install.sh logicflowchart TD
A[Start install.sh] --> B[Print Installing runpodctl]
B --> C{OS is macOS?}
C -->|Yes| D[try_brew_install]
D --> E{brew installed and runpodctl tap install succeeds?}
E -->|Yes| F[Exit success]
E -->|No| G[Fall back to binary install]
C -->|No| G
G --> H[detect_install_dir]
H --> I{EUID == 0?}
I -->|Yes| J[Set INSTALL_DIR to /usr/local/bin]
I -->|No| K[Search preferred user dirs in PATH and writable]
K --> L{Found suitable dir?}
L -->|Yes| M[Set INSTALL_DIR to found dir]
L -->|No| N[Create $HOME/.local/bin and set as INSTALL_DIR]
J --> O[check_root]
M --> O
N --> O
O --> P[Print non-root note if EUID != 0]
P --> Q[check_system_requirements]
Q --> R{All of wget tar grep sed present?}
R -->|No| S[Print error Missing required commands and exit]
R -->|Yes| T[fetch_latest_version]
T --> U[Call GitHub releases latest API with wget]
U --> V[Parse tag_name using grep and sed into VERSION]
V --> W{VERSION empty?}
W -->|Yes| X[Print failure to fetch version and exit]
W -->|No| Y[download_url_constructor]
Y --> Z[Detect os_type and arch_type]
Z --> ZA{darwin linux or unsupported?}
ZA -->|Unsupported| ZB[Print unsupported OS and exit]
ZA -->|darwin| ZC[Set os_type darwin and arch_type all]
ZA -->|linux| ZD[Map uname -m to amd64 or arm64 or exit]
ZC --> ZE[Build URL1 and URL2 naming patterns]
ZD --> ZE
ZE --> ZF[download_and_install_cli]
ZF --> ZG[Set cli_archive_file_name runpodctl.tar.gz]
ZG --> ZH[Loop over DOWNLOAD_URLS]
ZH --> ZI{wget succeeds for url?}
ZI -->|Yes| ZJ[Set success true and break loop]
ZI -->|No| ZH
ZH -->|After loop| ZK{success == true?}
ZK -->|No| ZL[Print failed to download from any URLs and exit]
ZK -->|Yes| ZM[Extract runpodctl with tar]
ZM --> ZN{tar extraction failed?}
ZN -->|Yes| ZO[Print extract failure and exit]
ZN -->|No| ZP[Remove archive file]
ZP --> ZQ[chmod +x runpodctl]
ZQ --> ZR{INSTALL_DIR writable?}
ZR -->|No| ZS[Print INSTALL_DIR not writable, remove binary, exit]
ZR -->|Yes| ZT[Move runpodctl into INSTALL_DIR]
ZT --> ZU{mv succeeded?}
ZU -->|No| ZV[Print failure to move binary and exit]
ZU -->|Yes| ZW[Print runpodctl installed successfully to INSTALL_DIR]
ZW --> ZX[End]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
hey, thanks for this — having proper integration test coverage is something we've been wanting. the test suite design covering the full pod and serverless lifecycle is thorough and well thought out! a few things we'd need addressed before this can be merged:
we've created tracking issues for both features:
if you'd like to keep working on this, we'd suggest splitting the installer refactor and the test suite into separate PRs rebased on current main — it'll be easier to review and merge incrementally. but totally fine if you'd rather leave it to us. really appreciate you taking the time on this — great work! 🙏 |
|
Merged into #249 |
PR: Feature: CI Testing
Description
This PR implements a tiered testing strategy designed to independently test validation and integration.
Key Changes
tests/integration_suite.shto report results asPASSED,FAILED, orEXPECTED_FAIL. This ensures that maintainers see clear "Feature Unavailable" signals for missing keys or root privileges instead of generic failures.tests/integration_suite.shwith separate root and non-root jobs. Should the parallel non-root PR be accepted, builds will be tested for fitness in both root and non-root contexts.Integration Notes
Cost & Privacy
RUNPOD_API_KEYis protected against abuse by automatically reportingEXPECTED_FAILon unapproved external forks.There are Sourcery reviews and diagrams etc here that you can review if you like.
Thanks,
FNG