-
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
CLIENT-3852 tests against multi node cluster #536
Conversation
mirzakaracic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR but we should think about how we can tie CI flows with reusable actions and workflows in the future. It is also worth checking in with julien since he is working devops folks on runnable aerospike server action standard.
|
None of the actions runs show these changes as valid. Do you have a run that shows
Checkin in this PR are all against single node instance. |
|
Successful run: https://github.com/aerospike/aerospike-client-go/actions/runs/19178189525 |
|
Some manually triggered runs: https://github.com/aerospike/aerospike-client-go/actions/workflows/build-multi-node.yml |
|
When you run tests against a containerized cluster you need to set go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" -- -p=3100 See
|
| 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: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 23 hours ago
To fix the problem, we should set a minimal explicit permissions block 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:
permissions:
contents: readjust 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: read is sufficient. No additional code, imports, or dependencies are needed—this is a standard configuration for GitHub workflows.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Build and test against multi-node cluster | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: |
| 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 \ | ||
| -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... \ | ||
| -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" \ | ||
| -- -p=3100 -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 No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 23 hours ago
To fix this problem, a permissions block should be added to the workflow YAML file, either at the global level (just after the workflow name: and on: keys, before the jobs: block) or at each job, specifying the minimal set of permissions needed. Generally, for CI builds and tests where no repository contents are being modified, the minimal permissions should be set—usually contents: read. If jobs require higher permissions, those can be set at the job level. In the provided workflow, it appears only code is checked out and tested, so contents: read suffices. The best fix is to add:
permissions:
contents: readat the root of the YAML file, after the on: block and before env: or jobs:. No changes to imports, definitions, or other code are needed.
-
Copy modified lines R25-R26
| @@ -22,6 +22,8 @@ | ||
| schedule: | ||
| - cron: "0 2 * * *" # Nightly at 02:00 UTC | ||
|
|
||
| permissions: | ||
| contents: read | ||
| env: | ||
| # defaults to use against workflow triggered through cron | ||
| AEROSPIKE_VERSION: 8.1.0.1c |
12f7b03 to
954c8ba
Compare
|
Successful run against a multi node cluster: https://github.com/aerospike/aerospike-client-go/actions/runs/19357434983 |
| 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
mirzakaracic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Tested here: https://github.com/aerospike/aerospike-client-go/actions/runs/19178189525