From dc94696d5a564e92a75899059f0804c280151106 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 28 Mar 2023 08:01:33 +0200 Subject: [PATCH] chore: remove handling of node versions 8, 9 and 10 in tests (#3696) Co-authored-by: Chengzhong Wu Co-authored-by: Marc Pichler --- .../test/functionals/https-enable.test.ts | 11 +---------- .../test/AsyncHooksContextManager.test.ts | 10 ---------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation-http/test/functionals/https-enable.test.ts b/experimental/packages/opentelemetry-instrumentation-http/test/functionals/https-enable.test.ts index 63a0ec00f5..9da1c115b4 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/test/functionals/https-enable.test.ts +++ b/experimental/packages/opentelemetry-instrumentation-http/test/functionals/https-enable.test.ts @@ -35,7 +35,6 @@ import { } from '@opentelemetry/semantic-conventions'; import * as assert from 'assert'; import * as fs from 'fs'; -import * as semver from 'semver'; import * as nock from 'nock'; import * as path from 'path'; import { HttpInstrumentation } from '../../src/http'; @@ -548,15 +547,7 @@ describe('HttpsInstrumentation', () => { assert.fail(); } catch (error) { const spans = memoryExporter.getFinishedSpans(); - /** - * There is an edge case with node 8 because the https module - * just call the http one, resulting in 2 span. The fix only works - * if the protocol is 'https:' resulting in 2 span only for this test. - */ - assert.strictEqual( - spans.length, - semver.gt(process.version, '9.0.0') ? 1 : 2 - ); + assert.strictEqual(spans.length, 1); } }); diff --git a/packages/opentelemetry-context-async-hooks/test/AsyncHooksContextManager.test.ts b/packages/opentelemetry-context-async-hooks/test/AsyncHooksContextManager.test.ts index da30470406..4829bb8975 100644 --- a/packages/opentelemetry-context-async-hooks/test/AsyncHooksContextManager.test.ts +++ b/packages/opentelemetry-context-async-hooks/test/AsyncHooksContextManager.test.ts @@ -35,16 +35,6 @@ for (const contextManagerClass of [ | AsyncHooksContextManager | AsyncLocalStorageContextManager; - before(function () { - if ( - contextManagerClass.name === 'AsyncLocalStorageContextManager' && - (process.version.startsWith('v8.') || - process.version.startsWith('v10.')) - ) { - this.skip(); - } - }); - beforeEach(() => { contextManager = new contextManagerClass(); contextManager.enable();