From 23d98b1807b3900b9ec8524373b8b68d37317659 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Fri, 10 Jun 2022 17:38:48 +0300 Subject: [PATCH] test(hapi): consolidate how hapi ignores old node versions in test (#1041) --- .github/workflows/test-all-versions.yml | 2 ++ .github/workflows/unit-test.yml | 2 ++ .../opentelemetry-instrumentation-hapi/.mocharc.js | 12 ------------ .../opentelemetry-instrumentation-hapi/package.json | 3 +-- 4 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 plugins/node/opentelemetry-instrumentation-hapi/.mocharc.js diff --git a/.github/workflows/test-all-versions.yml b/.github/workflows/test-all-versions.yml index b97006a8f1..a76af8e18f 100644 --- a/.github/workflows/test-all-versions.yml +++ b/.github/workflows/test-all-versions.yml @@ -25,12 +25,14 @@ jobs: --ignore @opentelemetry/instrumentation-amqplib --ignore @opentelemetry/instrumentation-mongodb --ignore @opentelemetry/instrumentation-redis-4 + --ignore @opentelemetry/instrumentation-hapi - node: "10" lerna-extra-args: >- --ignore @opentelemetry/instrumentation-aws-sdk --ignore @opentelemetry/instrumentation-pino --ignore @opentelemetry/instrumentation-mongodb --ignore @opentelemetry/instrumentation-redis-4 + --ignore @opentelemetry/instrumentation-hapi runs-on: ubuntu-latest services: memcached: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 689a0f3f65..edb8cb92fd 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -18,11 +18,13 @@ jobs: --ignore @opentelemetry/instrumentation-tedious --ignore @opentelemetry/instrumentation-amqplib --ignore @opentelemetry/instrumentation-redis-4 + --ignore @opentelemetry/instrumentation-hapi - node: "10" lerna-extra-args: >- --ignore @opentelemetry/instrumentation-aws-sdk --ignore @opentelemetry/instrumentation-pino --ignore @opentelemetry/instrumentation-redis-4 + --ignore @opentelemetry/instrumentation-hapi - node: "12" lerna-extra-args: >- --ignore @opentelemetry/instrumentation-redis-4 diff --git a/plugins/node/opentelemetry-instrumentation-hapi/.mocharc.js b/plugins/node/opentelemetry-instrumentation-hapi/.mocharc.js deleted file mode 100644 index 802a8a3ed7..0000000000 --- a/plugins/node/opentelemetry-instrumentation-hapi/.mocharc.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const semver = require('semver'); - -if (semver.satisfies(process.version, '>=12.0.0')) { - module.exports = { - spec: 'test/**/*.ts', - }; -} else { - console.log(`Hapi instrumentation tests skipped for Node.js ${process.version} - unsupported by Hapi`); - module.exports = {}; -} diff --git a/plugins/node/opentelemetry-instrumentation-hapi/package.json b/plugins/node/opentelemetry-instrumentation-hapi/package.json index 621814064e..68c76d8f60 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/package.json +++ b/plugins/node/opentelemetry-instrumentation-hapi/package.json @@ -6,7 +6,7 @@ "types": "build/src/index.d.ts", "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { - "test": "nyc ts-mocha -p tsconfig.json --config .mocharc.js", + "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "yarn test -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext .ts", @@ -56,7 +56,6 @@ "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "3.0.2", - "semver": "7.3.5", "ts-mocha": "8.0.0", "typescript": "4.3.5" },