Skip to content

Commit

Permalink
fix up aerospike
Browse files Browse the repository at this point in the history
  • Loading branch information
bengl committed Aug 30, 2024
1 parent 291a074 commit 1a43398
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 58 deletions.
62 changes: 8 additions & 54 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,23 @@ concurrency:


jobs:
aerospike-node-16:
aerospike:
strategy:
matrix:
node-version: [16]
range: ['>=4.0.0 <5.2.0']
runs-on: ubuntu-latest
services:
aerospike:
image: aerospike:ce-5.7.0.15
ports:
- "127.0.0.1:3000-3002:3000-3002"
env:
PLUGINS: aerospike
SERVICES: aerospike
PACKAGE_VERSION_RANGE: '${{ matrix.range }}'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- id: extract
run: |
version="${{fromJson(steps.pkg.outputs.json).version}}"
majorVersion=$(echo "$version" | cut -d '.' -f 1)
echo "Major Version: $majorVersion"
echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV
- uses: ./.github/actions/node/oldest
- name: Install dependencies
if: env.MAJOR_VERSION == '4'
uses: ./.github/actions/install
- name: Run tests
if: env.MAJOR_VERSION == '4'
run: yarn test:plugins:ci
- if: always()
uses: ./.github/actions/testagent/logs
- uses: codecov/codecov-action@v3

aerospike-node-18-20:
strategy:
matrix:
node-version: [18]
range: ['5.2.0 - 5.7.0']
aerospike-image: [ce-5.7.0.15]
include:
- node-version: 18
range: '5.2.0 - 5.7.0'
aerospike-image: ce-6.4.0.3
- node-version: 20
range: '>=5.8.0'
aerospike-image: ce-6.4.0.3
runs-on: ubuntu-latest
services:
aerospike:
image: aerospike:ce-6.4.0.3
image: aerospike:${{ matrix.aerospike-image }}
ports:
- "127.0.0.1:3000-3002:3000-3002"
env:
Expand All @@ -77,24 +42,13 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/testagent/start
- uses: ./.github/actions/node/setup
- id: pkg
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- id: extract
run: |
version="${{fromJson(steps.pkg.outputs.json).version}}"
majorVersion=$(echo "$version" | cut -d '.' -f 1)
echo "Major Version: $majorVersion"
echo "MAJOR_VERSION=$majorVersion" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn config set ignore-engines true
- name: Install dependencies
if: env.MAJOR_VERSION == '5'
uses: ./.github/actions/install
- name: Run tests
if: env.MAJOR_VERSION == '5'
run: yarn test:plugins:ci
- if: always()
uses: ./.github/actions/testagent/logs
Expand Down
9 changes: 5 additions & 4 deletions packages/datadog-instrumentations/src/aerospike.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
addHook
} = require('./helpers/instrument')
const shimmer = require('../../datadog-shimmer')
const { NODE_MAJOR } = require('../../../version')

const tracingChannel = require('dc-polyfill').tracingChannel
const ch = tracingChannel('apm:aerospike:command')
Expand Down Expand Up @@ -38,12 +39,12 @@ function wrapProcess (process) {
}

const versions = (() => {
switch (process.versions.node.split('.')[0]) {
case '16':
switch (NODE_MAJOR) {
case 16:
return ['>=4 <5.2.0']
case '18':
case 18:
return ['5.2.0 - 5.7.0']
case '20':
case 20:
return ['>=5.8.0']
default:
return []
Expand Down

0 comments on commit 1a43398

Please sign in to comment.