ci(server): integration server increase shard#15228
Conversation
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR increases the integration test sharding in the CI pipeline from 4 to 5 parallel jobs. The change modifies the GitHub Actions workflow configuration to distribute the server integration tests across more runners, reducing overall test execution time. The matrix strategy in server-integration-test job now spawns 5 parallel shards instead of 4, with the SHARD_COUNTER environment variable updated accordingly to ensure the test runner correctly partitions the test suite. This optimization fits into the existing CI/CD infrastructure by leveraging GitHub Actions' matrix parallelization capabilities, which are already used throughout the workflow for distributing workloads. Minor whitespace cleanup was also performed to maintain code quality.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| .github/workflows/ci-server.yaml | 5/5 | Increased integration test sharding from 4 to 5 parallel jobs and updated SHARD_COUNTER environment variable to match |
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it only adjusts parallelization configuration without changing test logic or application code
- Score reflects the straightforward nature of the change with both matrix configuration and SHARD_COUNTER properly synchronized, plus successful CI validation
- No files require special attention; this is a simple CI optimization with matching configuration updates
Sequence Diagram
sequenceDiagram
participant User
participant GitHub
participant ChangedFiles as "changed-files-check"
participant ServerSetup as "server-setup"
participant Postgres
participant Redis
participant Worker
participant Server
participant ServerTest as "server-test"
participant IntegrationTest as "server-integration-test (x5 shards)"
participant ClickHouse
participant StatusCheck as "ci-server-status-check"
User->>GitHub: "Push to main / Create PR"
GitHub->>ChangedFiles: "Trigger workflow"
ChangedFiles->>ChangedFiles: "Check for changed files"
alt Files changed
ChangedFiles->>ServerSetup: "any_changed == true"
ServerSetup->>Postgres: "Start service (port 5432)"
ServerSetup->>Redis: "Start service (port 6379)"
ServerSetup->>ServerSetup: "Checkout code"
ServerSetup->>ServerSetup: "Install dependencies"
ServerSetup->>ServerSetup: "Restore cache"
ServerSetup->>ServerSetup: "Build twenty-shared"
ServerSetup->>ServerSetup: "Lint & typecheck"
ServerSetup->>ServerSetup: "Write .env"
ServerSetup->>ServerSetup: "Build twenty-server"
ServerSetup->>Postgres: "Create databases (default, test)"
ServerSetup->>Postgres: "Run migrations"
ServerSetup->>Worker: "Run worker (30s timeout)"
Worker-->>ServerSetup: "Complete/Timeout"
ServerSetup->>Server: "Start server"
ServerSetup->>Server: "Health check (10 retries)"
Server-->>ServerSetup: "Healthy"
ServerSetup->>ServerSetup: "Check pending migrations"
ServerSetup->>ServerSetup: "Check GraphQL schema generation"
ServerSetup->>ServerSetup: "Save cache"
par Parallel execution
ServerSetup->>ServerTest: "Trigger tests"
ServerTest->>ServerTest: "Checkout & install"
ServerTest->>ServerTest: "Restore cache"
ServerTest->>ServerTest: "Run backend tests"
ServerTest->>StatusCheck: "Complete"
and
ServerSetup->>IntegrationTest: "Trigger integration tests (5 shards)"
IntegrationTest->>Postgres: "Start service"
IntegrationTest->>Redis: "Start service"
IntegrationTest->>ClickHouse: "Start service (ports 8123, 9000)"
IntegrationTest->>IntegrationTest: "Checkout & install"
IntegrationTest->>IntegrationTest: "Update .env.test"
IntegrationTest->>IntegrationTest: "Restore cache"
IntegrationTest->>IntegrationTest: "Build twenty-server"
IntegrationTest->>Postgres: "Create test database"
IntegrationTest->>ClickHouse: "Run migrations"
IntegrationTest->>ClickHouse: "Run seeds"
IntegrationTest->>IntegrationTest: "Run integration tests (sharded)"
IntegrationTest->>StatusCheck: "Complete"
end
StatusCheck->>StatusCheck: "Check all job results"
alt Any job failed
StatusCheck->>GitHub: "Fail workflow"
GitHub->>User: "Workflow failed"
else All jobs passed
StatusCheck->>GitHub: "Pass workflow"
GitHub->>User: "Workflow passed"
end
else No files changed
ChangedFiles->>StatusCheck: "Skip jobs"
StatusCheck->>GitHub: "Pass workflow"
GitHub->>User: "Workflow passed (no changes)"
end
1 file reviewed, no comments
No description provided.