-
Notifications
You must be signed in to change notification settings - Fork 212
CLIENT-3852 tests against multi node cluster #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mirzakaracic
merged 15 commits into
stage
from
CLIENT-3852-tests-against-multi-node-cluster
Nov 14, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
46ccd39
wip: add build for multi node
gagan405 1ff7514
fix debug print
gagan405 208945d
force run workflow on this branch
gagan405 4553ca7
add aerolab action
gagan405 c8bfd64
add nightly runs
gagan405 eba5fc8
pin runner version and add aerolab version to inputs
gagan405 3c3fd81
enable use-services-alternate
gagan405 b489f89
enable use service alternate in build script
gagan405 0294da0
updated build script to remove hardcode
gagan405 82a0f84
fixed build script
gagan405 721daa1
fix run command
gagan405 8c31f58
fix tests
gagan405 bcc59c7
use community edition
gagan405 ff98d7b
update coverprofile
gagan405 954c8ba
updated build workflow to remove feature branch
gagan405 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: "Deploy Aerospike Cluster using Aerolab" | ||
| description: "Creates an Aerospike cluster using Aerolab on the current runner" | ||
|
|
||
| inputs: | ||
| aerospike_version: | ||
| description: "Aerospike version for cluster creation" | ||
| required: false | ||
| default: "8.1.0.1c" | ||
| nodes: | ||
| description: "Number of cluster nodes" | ||
| required: false | ||
| default: "3" | ||
| cluster_name: | ||
| description: "Cluster name" | ||
| required: false | ||
| default: "ce" | ||
| aerolab_version: | ||
| # https://github.com/aerospike/aerolab/releases/ | ||
| description: "Aerolab version to run." | ||
| required: false | ||
| default: "7.9.0" | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y curl | ||
|
|
||
| - name: Download Aerolab .deb | ||
| shell: bash | ||
| run: | | ||
| echo "Downloading Aerolab ${{ inputs.aerolab_version }} (amd64)" | ||
| curl -L -o aerolab.deb https://github.com/aerospike/aerolab/releases/download/${{ inputs.aerolab_version }}/aerolab-linux-amd64-${{ inputs.aerolab_version }}.deb | ||
|
|
||
| - name: Install Aerolab | ||
| shell: bash | ||
| run: | | ||
| sudo dpkg -i aerolab.deb | ||
| sudo apt-get install -f -y | ||
|
|
||
| - name: Prepare Aerolab home | ||
| shell: bash | ||
| run: | | ||
| mkdir -p /tmp/aerolab-home | ||
| echo "AEROLAB_HOME=/tmp/aerolab-home" >> $GITHUB_ENV | ||
|
|
||
| - name: Configure Aerolab backend | ||
| shell: bash | ||
| run: | | ||
| aerolab config backend -t docker | ||
|
|
||
| - name: Create Aerospike cluster | ||
| shell: bash | ||
| run: | | ||
| aerolab cluster create \ | ||
| -v "${{ inputs.aerospike_version }}" \ | ||
| -c "${{ inputs.nodes }}" \ | ||
| -n "${{ inputs.cluster_name }}" | ||
|
|
||
| - name: Validate cluster list | ||
| shell: bash | ||
| run: | | ||
| echo "Listing clusters..." | ||
| aerolab cluster list | tee cluster-list.txt | ||
|
|
||
| - name: Show cluster list output as job summary | ||
| shell: bash | ||
| run: | | ||
| echo "## Aerolab Cluster Created" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo '````' >> $GITHUB_STEP_SUMMARY | ||
| cat cluster-list.txt >> $GITHUB_STEP_SUMMARY | ||
| echo '````' >> $GITHUB_STEP_SUMMARY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: Build and test against multi-node cluster | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| aerospike_version: | ||
| description: "Aerolab/Aerospike version" | ||
| required: false | ||
| default: "8.1.0.1c" | ||
| nodes: | ||
| description: "Number of cluster nodes" | ||
| required: false | ||
| default: "3" | ||
| cluster_name: | ||
| description: "Cluster name" | ||
| required: false | ||
| default: "ce" | ||
| runner_version: | ||
| description: "Ubuntu runner version" | ||
| required: false | ||
| default: "ubuntu-24.04" # https://github.com/actions/runner-images/blob/main/README.md | ||
| schedule: | ||
| - cron: "0 2 * * *" # Nightly at 02:00 UTC | ||
|
|
||
| env: | ||
| # defaults to use against workflow triggered through cron | ||
| AEROSPIKE_VERSION: 8.1.0.1c | ||
| NODES: 3 | ||
| CLUSTER_NAME: ce | ||
| RUNNER_VERSION: ubuntu-24.04 | ||
|
|
||
| jobs: | ||
| make-matrix: | ||
| runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner_version || 'ubuntu-24.04' }} | ||
| outputs: | ||
| input-matrix: ${{ steps.create-server-matrix.outputs.matrix }} | ||
| go-version: ${{ steps.get-go-version.outputs.go-version }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Get Go version | ||
| id: get-go-version | ||
| run: | | ||
| echo "go-version=$(grep '^go [0-9]' go.mod | awk '{print $2}')" >> $GITHUB_OUTPUT | ||
|
|
||
| - id: create-server-matrix | ||
| uses: ./.github/actions/make-matrix | ||
| with: | ||
| default_json: | | ||
| { | ||
| "stable": { "version": "${{ github.event_name == 'workflow_dispatch' && inputs.aerospike_version || env.AEROSPIKE_VERSION }}" } | ||
| } | ||
| go_version: ${{ steps.get-go-version.outputs.go-version }} | ||
|
|
||
| - name: debug - print input variables | ||
| run: | | ||
| echo "Aerospike version: ${{ github.event_name == 'workflow_dispatch' && inputs.aerospike_version || env.AEROSPIKE_VERSION }}" | ||
| echo "Nodes: ${{ github.event_name == 'workflow_dispatch' && inputs.nodes || env.NODES }}" | ||
| echo "Cluster name: ${{ github.event_name == 'workflow_dispatch' && inputs.cluster_name || env.CLUSTER_NAME }}" | ||
| echo "Go version: ${{ steps.get-go-version.outputs.go-version }}" | ||
| echo 'Matrix output:' | ||
| echo '${{ steps.create-server-matrix.outputs.matrix }}' | jq . | ||
|
|
||
| build: | ||
| timeout-minutes: 30 | ||
| needs: make-matrix | ||
| runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner_version || 'ubuntu-24.04' }} | ||
| strategy: | ||
| matrix: | ||
| include: ${{ fromJson(needs.make-matrix.outputs.input-matrix) }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Deploy Aerolab Cluster | ||
| uses: ./.github/actions/deploy-aerolab | ||
| with: | ||
| aerospike_version: ${{ github.event_name == 'workflow_dispatch' && inputs.aerospike_version || env.AEROSPIKE_VERSION }} | ||
| nodes: ${{ github.event_name == 'workflow_dispatch' && inputs.nodes || env.NODES }} | ||
| cluster_name: ${{ github.event_name == 'workflow_dispatch' && inputs.cluster_name || env.CLUSTER_NAME }} | ||
|
|
||
| - name: "Setup Go ${{ needs.make-matrix.outputs.go-version }}" | ||
| uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: "${{ needs.make-matrix.outputs.go-version }}" | ||
| cache: true | ||
| - name: Fetch dependencies | ||
| env: | ||
| GODEBUG: fips140=on | ||
| run: | | ||
| # Install all dependencies | ||
| go mod download | ||
|
|
||
| # Install ginkgo CLI and gocovmerge for testing | ||
| go install github.com/onsi/ginkgo/v2/[email protected] | ||
| go mod download github.com/wadey/gocovmerge | ||
|
|
||
| # Vendor the dependencies | ||
| go mod vendor | ||
|
|
||
| - name: Display Go version | ||
| run: | | ||
| echo "Go version: ${{ needs.make-matrix.outputs.go-version }}" | ||
| - name: Run the tests | ||
| env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor} | ||
| run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -output-dir=./ -coverprofile=cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" -- -hosts=127.0.0.1:3100,127.0.0.1:3101,127.0.0.1:3102 -use-services-alternate=true | ||
| - name: Combine Cover Profiles | ||
| env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor} | ||
| run: go run -mod=vendor github.com/wadey/gocovmerge cover_*.out > cover_all.out | ||
| - name: Check Code Coverage | ||
| uses: vladopajic/go-test-coverage@v2 | ||
| with: | ||
| # Configure action using config file (option 1) | ||
| config: ./.testcoverage.yml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ var _ = gg.Describe("Connection Test", func() { | |
| gm.Expect(conn).ToNot(gm.BeNil()) | ||
| }) | ||
|
|
||
| gg.It("Dealines should be calculated correctly", func() { | ||
| gg.It("Deadlines should be calculated correctly", func() { | ||
| deadline := func(timeout time.Duration) (res time.Time) { | ||
| if timeout > 0 { | ||
| res = time.Now().Add(timeout) | ||
|
|
@@ -67,9 +67,9 @@ var _ = gg.Describe("Connection Test", func() { | |
|
|
||
| gg.By(fmt.Sprintf("expTotalDeadline: %v, expSocketDeadline: %v, expSocketTimeout: %v", matrix.expTotalDeadline, matrix.expSocketDeadline, matrix.expSocketTimeout)) | ||
|
|
||
| gm.Expect(expTotalDeadline).To(gm.BeTemporally("~", matrix.expTotalDeadline, time.Millisecond)) | ||
| gm.Expect(expSocketDeadline).To(gm.BeTemporally("~", matrix.expSocketDeadline, time.Millisecond)) | ||
| gm.Expect(expSocketTimeout).To(gm.BeNumerically("~", matrix.expSocketTimeout, time.Millisecond)) | ||
| gm.Expect(expTotalDeadline).To(gm.BeTemporally("~", matrix.expTotalDeadline, 2*time.Millisecond)) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was occasionally failing. Increased it to 2ms to give it some space. |
||
| gm.Expect(expSocketDeadline).To(gm.BeTemporally("~", matrix.expSocketDeadline, 2*time.Millisecond)) | ||
| gm.Expect(expSocketTimeout).To(gm.BeNumerically("~", matrix.expSocketTimeout, 2*time.Millisecond)) | ||
| } | ||
| }) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 1 day ago
To fix the problem, we should set a minimal explicit
permissionsblock in the workflow’s root section, granting only read access to repository contents, unless other permissions are also needed. The best change is to add:just below the workflow name, i.e., between lines 1 and 2. If later jobs require additional permissions (e.g., to write status or manipulate issues/PRs), these can be added, but for the current workflow (checkout, build, test)
contents: readis sufficient. No additional code, imports, or dependencies are needed—this is a standard configuration for GitHub workflows.