diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34e7a82b9f..4281855a74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,7 +117,7 @@ The required steps to start development on a pacakge are: - `npm ci` from root folder to install dependencies ([see npm-ci docs](https://docs.npmjs.com/cli/v10/commands/npm-ci)) - `cd` into the pacakge you want to apply changes. -- `npm run setup:dev` compiles the TypeScript files for this package and its dependencies within the repository. +- `npm run compile:with-dependencies` compiles the TypeScript files for this package and its dependencies within the repository. Then you can proceed to do apply the changes and use the scripts below for development workflow @@ -146,23 +146,21 @@ npm test However, some instrumentations require test-services to be running (e.g. the `instrumentation-mongodb` package requires a MongoDB server). Use the `test-services`-related npm scripts to start all required services in Docker and then run the tests with the appropriate configuration to use those services: ```sh -npm run test-services:start # starts services in Docker -npm run test:with-services-config # runs 'npm test' with envvars from test/test-services.env -npm run test-services:stop # stops services in Docker +npm run test-services:start # starts services in Docker +npm run test:with-services-env # runs 'npm test' with envvars from test/test-services.env +npm run test-services:stop # stops services in Docker ``` -If you only want to test a single package (e.g. the `instrumentation-mongodb`) you can `cd` into it and run the tests after you started the services. +If you only want to test a single package that dfepends on a service (e.g. the `instrumentation-mongodb`) you can `cd` into it and +use the same scripts for testing. In this case the script will only start the services needed to test the package. ```sh -npm run test-services:start # starts services in Docker -cd packages/instrumentation-mongodb # get into the instrumenation folder -RUN_MONGODB_TESTS=1 npm test # run the test with the proper config (check each package) -cd ../../.. # go back to root folder -npm run test-services:stop # stops services in Docker +cd packages/instrumentation-mongodb # get into the instrumenation folder +npm run test-services:start # start the MongoDB service in Docker +npm run test:with-services-env # runs 'npm test' with envvars from test/test-services.env +npm run test-services:stop # stop MongoDB service in Docker ``` -NOTE: scripts for each package will be added to avoid extra consumption of resources and improve the development experience. - ### Benchmarks When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm. diff --git a/incubator/opentelemetry-sampler-aws-xray/package.json b/incubator/opentelemetry-sampler-aws-xray/package.json index fb1d5a0f18..70b9409204 100644 --- a/incubator/opentelemetry-sampler-aws-xray/package.json +++ b/incubator/opentelemetry-sampler-aws-xray/package.json @@ -28,11 +28,11 @@ ], "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", diff --git a/package-lock.json b/package-lock.json index d09d991898..af13903f44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31954,6 +31954,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", @@ -32204,6 +32205,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", @@ -33400,6 +33402,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -33456,6 +33459,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", @@ -33516,6 +33520,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -33574,6 +33579,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -34375,6 +34381,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", @@ -42216,6 +42223,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", @@ -42406,6 +42414,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", @@ -43330,6 +43339,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -43371,6 +43381,7 @@ "@opentelemetry/semantic-conventions": "^1.27.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", @@ -43416,6 +43427,7 @@ "@types/mysql": "2.15.27", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -43459,6 +43471,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", @@ -44062,6 +44075,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/tedious": "^4.0.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", diff --git a/packages/auto-configuration-propagators/package.json b/packages/auto-configuration-propagators/package.json index 29da658e78..372c6b1f95 100644 --- a/packages/auto-configuration-propagators/package.json +++ b/packages/auto-configuration-propagators/package.json @@ -20,8 +20,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/auto-instrumentations-node/package.json b/packages/auto-instrumentations-node/package.json index e9fe0040f7..4bf2f3ff11 100644 --- a/packages/auto-instrumentations-node/package.json +++ b/packages/auto-instrumentations-node/package.json @@ -24,8 +24,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/auto-instrumentations-web/package.json b/packages/auto-instrumentations-web/package.json index 4f2c222667..85d84e1174 100644 --- a/packages/auto-instrumentations-web/package.json +++ b/packages/auto-instrumentations-web/package.json @@ -22,8 +22,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/baggage-log-record-processor/package.json b/packages/baggage-log-record-processor/package.json index e278975097..935a02f2b7 100644 --- a/packages/baggage-log-record-processor/package.json +++ b/packages/baggage-log-record-processor/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prewatch": "npm run precompile", diff --git a/packages/baggage-span-processor/package.json b/packages/baggage-span-processor/package.json index eb29241698..1185085b76 100644 --- a/packages/baggage-span-processor/package.json +++ b/packages/baggage-span-processor/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-span-processor", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/contrib-test-utils/package.json b/packages/contrib-test-utils/package.json index 9432b23d54..7bc829bbfe 100644 --- a/packages/contrib-test-utils/package.json +++ b/packages/contrib-test-utils/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/contrib-test-utils", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" }, diff --git a/packages/contrib-test-utils/src/index.ts b/packages/contrib-test-utils/src/index.ts index 6853e6970c..005d2c9f1a 100644 --- a/packages/contrib-test-utils/src/index.ts +++ b/packages/contrib-test-utils/src/index.ts @@ -34,10 +34,8 @@ export type { TestSpan, RunTestFixtureOptions } from './test-fixtures'; export { assertPropagation, assertSpan, - cleanUpDocker, getPackageVersion, initMeterProvider, - startDocker, TestMetricReader, } from './test-utils'; export type { TimedEvent } from './test-utils'; diff --git a/packages/contrib-test-utils/src/test-utils.ts b/packages/contrib-test-utils/src/test-utils.ts index fdcc0b6e4a..56a9bafbe5 100644 --- a/packages/contrib-test-utils/src/test-utils.ts +++ b/packages/contrib-test-utils/src/test-utils.ts @@ -14,7 +14,6 @@ * limitations under the License. */ -import * as childProcess from 'child_process'; import { HrTime, Span, @@ -33,62 +32,6 @@ import * as path from 'path'; import * as fs from 'fs'; import { InstrumentationBase } from '@opentelemetry/instrumentation'; -const dockerRunCmds = { - cassandra: - 'docker run --rm -d --name otel-cassandra -p 9042:9042 bitnami/cassandra:3', - memcached: - 'docker run --rm -d --name otel-memcached -p 11211:11211 memcached:1.6.9-alpine', - mssql: - 'docker run --rm -d --name otel-mssql -p 1433:1433 -e MSSQL_SA_PASSWORD=mssql_passw0rd -e ACCEPT_EULA=Y mcr.microsoft.com/mssql/server:2022-latest', - mysql: - 'docker run --rm -d --name otel-mysql -p 33306:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=test_db -e MYSQL_USER=otel -e MYSQL_PASSWORD=secret mysql:5.7 --log_output=TABLE --general_log=ON', - oracledb: - 'docker run --rm -d --name otel-oracledb -p 1521:1521 -e ORACLE_PASSWORD=oracle -e APP_USER=otel -e APP_USER_PASSWORD=secret gvenzl/oracle-free:slim', - postgres: - 'docker run --rm -d --name otel-postgres -p 54320:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=otel_pg_database postgres:16-alpine', - redis: 'docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine', -}; - -export function startDocker(db: keyof typeof dockerRunCmds) { - const tasks = [run(dockerRunCmds[db])]; - - for (let i = 0; i < tasks.length; i++) { - const task = tasks[i]; - if (task && task.code !== 0) { - console.error('Failed to start container!'); - console.error(task.output); - return false; - } - } - return true; -} - -export function cleanUpDocker(db: keyof typeof dockerRunCmds) { - run(`docker stop otel-${db}`); -} - -function run(cmd: string) { - try { - const proc = childProcess.spawnSync(cmd, { - shell: true, - }); - const output = Buffer.concat( - proc.output.filter(c => c) as Buffer[] - ).toString('utf8'); - if (proc.status !== 0) { - console.error('Failed run command:', cmd); - console.error(output); - } - return { - code: proc.status, - output, - }; - } catch (e) { - console.log(e); - return; - } -} - export const assertSpan = ( span: ReadableSpan, kind: SpanKind, diff --git a/packages/host-metrics/package.json b/packages/host-metrics/package.json index 1d93e5723b..b09d9ab39b 100644 --- a/packages/host-metrics/package.json +++ b/packages/host-metrics/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/host-metrics", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/host-metrics", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/id-generator-aws-xray/package.json b/packages/id-generator-aws-xray/package.json index 0b8aac94ab..2da29b740c 100644 --- a/packages/id-generator-aws-xray/package.json +++ b/packages/id-generator-aws-xray/package.json @@ -19,9 +19,9 @@ "directory": "packages/id-generator-aws-xray" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/id-generator-aws-xray", "test": "nyc mocha test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-amqplib/package.json b/packages/instrumentation-amqplib/package.json index 9553ae6be0..9d4394fa9a 100644 --- a/packages/instrumentation-amqplib/package.json +++ b/packages/instrumentation-amqplib/package.json @@ -31,18 +31,21 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-amqplib", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start rabbitmq", + "test-services:stop": "cd ../.. && npm run test-services:stop rabbitmq", "version:update": "node ../../scripts/version-update.js", - "watch": "tsc -w", - "test:docker:run": "docker run -d --hostname demo-amqplib-rabbit --name amqplib-unittests -p 22221:5672 --env RABBITMQ_DEFAULT_USER=username --env RABBITMQ_DEFAULT_PASS=password rabbitmq:3" + "watch": "tsc -w" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" @@ -61,6 +64,7 @@ "@types/node": "18.18.14", "@types/sinon": "17.0.4", "amqplib": "0.8.0", + "cross-env": "7.0.3", "expect": "29.2.0", "lodash": "4.17.21", "nyc": "17.1.0", diff --git a/packages/instrumentation-aws-lambda/package.json b/packages/instrumentation-aws-lambda/package.json index 20234eaf65..908e795aae 100644 --- a/packages/instrumentation-aws-lambda/package.json +++ b/packages/instrumentation-aws-lambda/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-lambda", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-lambda", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-aws-sdk/package.json b/packages/instrumentation-aws-sdk/package.json index f5d5623fe0..c296ffe911 100644 --- a/packages/instrumentation-aws-sdk/package.json +++ b/packages/instrumentation-aws-sdk/package.json @@ -32,7 +32,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-sdk", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-aws-sdk", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-bunyan/package.json b/packages/instrumentation-bunyan/package.json index 80fa7f9ded..286f536493 100644 --- a/packages/instrumentation-bunyan/package.json +++ b/packages/instrumentation-bunyan/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-bunyan", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-cassandra-driver/package.json b/packages/instrumentation-cassandra-driver/package.json index 9fe7522baf..38b0325d4f 100644 --- a/packages/instrumentation-cassandra-driver/package.json +++ b/packages/instrumentation-cassandra-driver/package.json @@ -10,16 +10,20 @@ "directory": "packages/instrumentation-cassandra-driver" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-cassandra-driver", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo \"add test-all-versions\"", + "test-services:start": "cd ../.. && npm run test-services:start cassandra", + "test-services:stop": "cd ../.. && npm run test-services:stop cassandra", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "cassandra-driver", @@ -57,6 +61,7 @@ "@types/semver": "7.5.8", "@types/sinon": "17.0.4", "cassandra-driver": "4.6.4", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "sinon": "15.2.0", diff --git a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts index 728458f493..cba1436637 100644 --- a/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts +++ b/packages/instrumentation-cassandra-driver/test/cassandra-driver.test.ts @@ -56,13 +56,10 @@ const provider = new NodeTracerProvider({ context.setGlobalContextManager(new AsyncLocalStorageContextManager()); const testCassandra = process.env.RUN_CASSANDRA_TESTS; -const testCassandraLocally = process.env.RUN_CASSANDRA_TESTS_LOCAL; -const shouldTest = testCassandra || testCassandraLocally; -const cassandraTimeoutMs = 60000; -const cassandraContactPoint = - process.env.CASSANDRA_HOST ?? testCassandraLocally - ? '127.0.0.1' - : 'cassandra'; +const shouldTest = testCassandra; +const cassandraContactPoint = process.env.CASSANDRA_HOST + ? '127.0.0.1' + : 'cassandra'; function assertSpan( span: ReadableSpan, @@ -155,15 +152,7 @@ describe('CassandraDriverInstrumentation', () => { this.skip(); } - // Cassandra takes a long time to boot up - 20 seconds easily. - this.timeout(cassandraTimeoutMs); - - if (testCassandraLocally) { - testUtils.startDocker('cassandra'); - } - instrumentation = new CassandraDriverInstrumentation(); - instrumentation.setTracerProvider(provider); const cassandra = require('cassandra-driver'); @@ -193,11 +182,7 @@ describe('CassandraDriverInstrumentation', () => { }); after(async function () { - this.timeout(60000); await client?.shutdown?.(); - if (testCassandraLocally) { - testUtils.cleanUpDocker('cassandra'); - } }); describe('execute', () => { diff --git a/packages/instrumentation-connect/package.json b/packages/instrumentation-connect/package.json index ee5c7f2b04..5ac4985ac8 100644 --- a/packages/instrumentation-connect/package.json +++ b/packages/instrumentation-connect/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-connect", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-connect", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-cucumber/package.json b/packages/instrumentation-cucumber/package.json index e59149a84c..2a44a03741 100644 --- a/packages/instrumentation-cucumber/package.json +++ b/packages/instrumentation-cucumber/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-cucumber", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-cucumber", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-dataloader/package.json b/packages/instrumentation-dataloader/package.json index 9646ffa75f..e134de1937 100644 --- a/packages/instrumentation-dataloader/package.json +++ b/packages/instrumentation-dataloader/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-dataloader", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-dataloader", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-dns/package.json b/packages/instrumentation-dns/package.json index dce6c242dc..6d523d5298 100644 --- a/packages/instrumentation-dns/package.json +++ b/packages/instrumentation-dns/package.json @@ -18,7 +18,7 @@ "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-dns", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-dns", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-document-load/package.json b/packages/instrumentation-document-load/package.json index ba9dc43ee4..881de34469 100644 --- a/packages/instrumentation-document-load/package.json +++ b/packages/instrumentation-document-load/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-document-load", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-document-load", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "wtr --watch", diff --git a/packages/instrumentation-express/package.json b/packages/instrumentation-express/package.json index 052bb2403b..a87a98d046 100644 --- a/packages/instrumentation-express/package.json +++ b/packages/instrumentation-express/package.json @@ -18,7 +18,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-express", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-express", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-fastify/package.json b/packages/instrumentation-fastify/package.json index ab320beaf4..86a5150fc5 100644 --- a/packages/instrumentation-fastify/package.json +++ b/packages/instrumentation-fastify/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-fastify", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-fastify", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-fs/package.json b/packages/instrumentation-fs/package.json index 09be93205c..a7bb853e3e 100644 --- a/packages/instrumentation-fs/package.json +++ b/packages/instrumentation-fs/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-fs", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-fs", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-generic-pool/package.json b/packages/instrumentation-generic-pool/package.json index e55b72c5dc..ad5790ec33 100644 --- a/packages/instrumentation-generic-pool/package.json +++ b/packages/instrumentation-generic-pool/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-generic-pool", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-generic-pool", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-graphql/package.json b/packages/instrumentation-graphql/package.json index 283acdad42..ac801514ef 100644 --- a/packages/instrumentation-graphql/package.json +++ b/packages/instrumentation-graphql/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-hapi/package.json b/packages/instrumentation-hapi/package.json index f26251fd1e..6552191482 100644 --- a/packages/instrumentation-hapi/package.json +++ b/packages/instrumentation-hapi/package.json @@ -18,7 +18,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-hapi", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-hapi", "compile": "tsc -p .", "prepublishOnly": "npm run compile" }, diff --git a/packages/instrumentation-ioredis/package.json b/packages/instrumentation-ioredis/package.json index 5b05dc523c..0cfe63e1eb 100644 --- a/packages/instrumentation-ioredis/package.json +++ b/packages/instrumentation-ioredis/package.json @@ -10,20 +10,22 @@ "directory": "packages/instrumentation-ioredis" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "test:debug": "cross-env RUN_REDIS_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-ioredis", - "compile": "tsc -p .", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start redis", + "test-services:stop": "cd ../.. && npm run test-services:stop redis", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/instrumentation-ioredis/test/ioredis.test.ts b/packages/instrumentation-ioredis/test/ioredis.test.ts index cd164c3232..39472b858f 100644 --- a/packages/instrumentation-ioredis/test/ioredis.test.ts +++ b/packages/instrumentation-ioredis/test/ioredis.test.ts @@ -91,8 +91,7 @@ describe('ioredis', () => { }); let ioredis: typeof ioredisTypes.default; let instrumentation: IORedisInstrumentation; - const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; - const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; + const shouldTest = process.env.RUN_REDIS_TESTS; let contextManager: AsyncLocalStorageContextManager; beforeEach(() => { @@ -113,21 +112,11 @@ describe('ioredis', () => { this.skip(); } - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - instrumentation = new IORedisInstrumentation(); instrumentation.setTracerProvider(provider); ioredis = require('ioredis'); }); - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } - }); - it('should have correct module name', () => { assert.strictEqual( instrumentation.instrumentationName, diff --git a/packages/instrumentation-kafkajs/package.json b/packages/instrumentation-kafkajs/package.json index 6a207f79ef..a113a24031 100644 --- a/packages/instrumentation-kafkajs/package.json +++ b/packages/instrumentation-kafkajs/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-kafkajs", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-kafkajs", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-knex/package.json b/packages/instrumentation-knex/package.json index 86d6f2cfb0..206f6ebc1a 100644 --- a/packages/instrumentation-knex/package.json +++ b/packages/instrumentation-knex/package.json @@ -10,16 +10,17 @@ "directory": "packages/instrumentation-knex" }, "scripts": { - "test": "nyc mocha 'test/**/*.ts'", - "tdd": "yarn test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "version:update": "node ../../scripts/version-update.js", "lint:readme": "node ../../scripts/lint-readme", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-knex", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.ts'", + "//todo": "echo \"add test-all-versions\"", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-koa/package.json b/packages/instrumentation-koa/package.json index 1b2c8d19f0..c160c42c5b 100644 --- a/packages/instrumentation-koa/package.json +++ b/packages/instrumentation-koa/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-koa" }, "scripts": { - "test": "nyc mocha 'test/**/*.ts'", - "test-all-versions": "tav", - "tdd": "yarn test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-koa", - "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, "keywords": [ diff --git a/packages/instrumentation-long-task/package.json b/packages/instrumentation-long-task/package.json index 8ad64115f3..f422d4dbd3 100644 --- a/packages/instrumentation-long-task/package.json +++ b/packages/instrumentation-long-task/package.json @@ -12,16 +12,16 @@ "directory": "packages/instrumentation-long-task" }, "scripts": { + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-long-task", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/instrumentation-lru-memoizer/package.json b/packages/instrumentation-lru-memoizer/package.json index 870a0125b7..d2a81ca88f 100644 --- a/packages/instrumentation-lru-memoizer/package.json +++ b/packages/instrumentation-lru-memoizer/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-lru-memoizer" }, "scripts": { - "test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-lru-memoizer", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "mocha --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "lru-memoizer", diff --git a/packages/instrumentation-memcached/package.json b/packages/instrumentation-memcached/package.json index 709f9c3917..ed631d6dc5 100644 --- a/packages/instrumentation-memcached/package.json +++ b/packages/instrumentation-memcached/package.json @@ -11,15 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-memcached", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test:debug": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true npm run test", + "test:debug": "cross-env RUN_MEMCACHED_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo \"add test-all-versions\"", + "test-services:start": "cd ../.. && npm run test-services:start memcached", + "test-services:stop": "cd ../.. && npm run test-services:stop memcached", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ diff --git a/packages/instrumentation-memcached/test/index.test.ts b/packages/instrumentation-memcached/test/index.test.ts index b07beb9333..d898990502 100644 --- a/packages/instrumentation-memcached/test/index.test.ts +++ b/packages/instrumentation-memcached/test/index.test.ts @@ -23,7 +23,6 @@ import { } from '@opentelemetry/api'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; -import * as testUtils from '@opentelemetry/contrib-test-utils'; import { InMemorySpanExporter, SimpleSpanProcessor, @@ -71,8 +70,7 @@ const getClient = (...args: any[]): ExtendedMemcached => { }; const KEY = 'foo'; const VALUE = '_test_value_'; -const shouldTestLocal = process.env.RUN_MEMCACHED_TESTS_LOCAL; -const shouldTest = process.env.RUN_MEMCACHED_TESTS || shouldTestLocal; +const shouldTest = process.env.RUN_MEMCACHED_TESTS; describe('memcached@2.x', () => { const provider = new NodeTracerProvider({ @@ -103,16 +101,6 @@ describe('memcached@2.x', () => { this.test!.parent!.pending = true; this.skip(); } - - if (shouldTestLocal) { - testUtils.startDocker('memcached'); - } - }); - - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('memcached'); - } }); describe('default config', () => { diff --git a/packages/instrumentation-mongodb/package.json b/packages/instrumentation-mongodb/package.json index 3d9dd280f2..843588c417 100644 --- a/packages/instrumentation-mongodb/package.json +++ b/packages/instrumentation-mongodb/package.json @@ -10,24 +10,24 @@ "directory": "packages/instrumentation-mongodb" }, "scripts": { - "docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo", - "test": "npm run test-v4 && npm run test-v5-v6", - "test-v3": "tav mongodb 3.7.4 npm run test-v3-run", - "test-v4": "tav mongodb 4.17.0 npm run test-v4-run", - "test-v5-v6": "npm run test-v5-v6-run", - "test-v3-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'", - "test-v4-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'", - "test-v5-v6-run": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v5-v6.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch", "clean": "rimraf build/*", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongodb", "compile": "tsc -p .", "prepublishOnly": "npm run compile", + "tdd": "npm run test-v5-v6-run -- --watch-extensions ts --watch", + "test": "npm run test-v5-v6", + "test-v3": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'", + "test-v4": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'", + "test-v5-v6": "nyc --no-clean mocha --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v5-v6.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start mongodb", + "test-services:stop": "cd ../.. && npm run test-services:stop mongodb", "watch": "tsc -w" }, "keywords": [ @@ -64,6 +64,7 @@ "@types/bson": "4.0.5", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "mongodb": "6.15.0", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-mongoose/package.json b/packages/instrumentation-mongoose/package.json index 9039a88a4d..5e4608dfab 100644 --- a/packages/instrumentation-mongoose/package.json +++ b/packages/instrumentation-mongoose/package.json @@ -10,20 +10,23 @@ "directory": "packages/instrumentation-mongoose" }, "scripts": { - "docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo", - "test": "npm run test-v5-v6", - "test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'", - "test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mongoose", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "npm run test-v5-v6", + "test-v5-v6": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v5-v6.test.ts'", + "test-v7-v8": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/mongoose-common.test.ts' 'test/**/mongoose-v7-v8.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start mongodb", + "test-services:stop": "cd ../.. && npm run test-services:stop mongodb", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "mongodb", @@ -56,6 +59,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "expect": "29.2.0", "mongoose": "6.13.8", "nyc": "17.1.0", diff --git a/packages/instrumentation-mongoose/test/mongoose-common.test.ts b/packages/instrumentation-mongoose/test/mongoose-common.test.ts index ed954b8b54..77e581e46c 100644 --- a/packages/instrumentation-mongoose/test/mongoose-common.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-common.test.ts @@ -38,7 +38,7 @@ import User, { IUser, loadUsers } from './user'; import { assertSpan, getStatement } from './asserts'; import { DB_NAME, MONGO_URI } from './config'; -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [common]', () => { before(async () => { try { diff --git a/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts b/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts index be6f5fc5ed..782038f339 100644 --- a/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-v5-v6.test.ts @@ -35,7 +35,7 @@ import { DB_NAME, MONGO_URI } from './config'; // We can't use @ts-expect-error because it will fail depending on the used mongoose version on tests /* eslint-disable @typescript-eslint/ban-ts-comment */ -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [v5/v6]', () => { before(async () => { try { diff --git a/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts b/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts index 2ef423f47f..efaa236d37 100644 --- a/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts +++ b/packages/instrumentation-mongoose/test/mongoose-v7-v8.test.ts @@ -32,7 +32,7 @@ import User, { loadUsers } from './user'; import { assertSpan, getStatement } from './asserts'; import { DB_NAME, MONGO_URI } from './config'; -// Please run mongodb in the background: docker run -d -p 27017:27017 -v ~/data:/data/db mongo +// Please run `npm run test-services:start` before describe('mongoose instrumentation [v7/v8]', () => { before(async () => { try { diff --git a/packages/instrumentation-mysql/package.json b/packages/instrumentation-mysql/package.json index 02fe201664..cf50683cb2 100644 --- a/packages/instrumentation-mysql/package.json +++ b/packages/instrumentation-mysql/package.json @@ -11,13 +11,17 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "//todo": "echo \"add test-all-versions\"", + "test-services:start": "cd ../.. && npm run test-services:start mysql", + "test-services:stop": "cd ../.. && npm run test-services:stop mysql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ @@ -53,6 +57,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/sinon": "17.0.4", + "cross-env": "7.0.3", "mysql": "2.18.1", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-mysql/test/index.metrics.test.ts b/packages/instrumentation-mysql/test/index.metrics.test.ts index 89c40c891b..b2e11e5a8a 100644 --- a/packages/instrumentation-mysql/test/index.metrics.test.ts +++ b/packages/instrumentation-mysql/test/index.metrics.test.ts @@ -62,7 +62,7 @@ describe('mysql@2.x-Metrics', () => { let otelTestingMeterProvider; let inMemoryMetricsExporter: InMemoryMetricExporter; // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; function initMeterProvider() { diff --git a/packages/instrumentation-mysql/test/index.test.ts b/packages/instrumentation-mysql/test/index.test.ts index cd0ccc6e7f..4cb6f17259 100644 --- a/packages/instrumentation-mysql/test/index.test.ts +++ b/packages/instrumentation-mysql/test/index.test.ts @@ -54,7 +54,7 @@ describe('mysql@2.x-Tracing', () => { let pool: mysqlTypes.Pool; let poolCluster: mysqlTypes.PoolCluster; // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; const memoryExporter = new InMemorySpanExporter(); const provider = new BasicTracerProvider({ diff --git a/packages/instrumentation-mysql2/env b/packages/instrumentation-mysql2/env deleted file mode 100644 index 5c3993ada9..0000000000 --- a/packages/instrumentation-mysql2/env +++ /dev/null @@ -1,5 +0,0 @@ -export MYSQL_DATABASE=otel_mysql_database -export MYSQL_HOST=mysql -export MYSQL_PASSWORD=secret -export MYSQL_PORT=3306 -export MYSQL_USER=otel \ No newline at end of file diff --git a/packages/instrumentation-mysql2/package.json b/packages/instrumentation-mysql2/package.json index 0aada209d2..b4f430f3d0 100644 --- a/packages/instrumentation-mysql2/package.json +++ b/packages/instrumentation-mysql2/package.json @@ -11,14 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-mysql2", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start mysql", + "test-services:stop": "cd ../.. && npm run test-services:stop mysql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ @@ -54,6 +58,7 @@ "@types/mocha": "10.0.10", "@types/node": "18.18.14", "@types/semver": "7.5.8", + "cross-env": "7.0.3", "mysql2": "3.11.5", "nyc": "17.1.0", "rimraf": "5.0.10", diff --git a/packages/instrumentation-mysql2/test/mysql.test.ts b/packages/instrumentation-mysql2/test/mysql.test.ts index bfa1a112a6..756934f6e9 100644 --- a/packages/instrumentation-mysql2/test/mysql.test.ts +++ b/packages/instrumentation-mysql2/test/mysql.test.ts @@ -76,7 +76,7 @@ const execPromise = (conn: Connection, command: string) => { describe('mysql2', () => { // assumes local mysql db is already available in CI or - // using `npm run test-services:start` script at the root folder + // using `npm run test-services:start` script const shouldTest = process.env.RUN_MYSQL_TESTS; before(async function () { diff --git a/packages/instrumentation-nestjs-core/package.json b/packages/instrumentation-nestjs-core/package.json index f0e5c80d8b..05c9cb36a5 100644 --- a/packages/instrumentation-nestjs-core/package.json +++ b/packages/instrumentation-nestjs-core/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-nestjs-core", "compile": "tsc -p .", "compile:watch": "tsc -w", "lint": "eslint . --ext .ts", diff --git a/packages/instrumentation-net/package.json b/packages/instrumentation-net/package.json index 81a685a586..8012941ad5 100644 --- a/packages/instrumentation-net/package.json +++ b/packages/instrumentation-net/package.json @@ -18,7 +18,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-net", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-net", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-oracledb/package.json b/packages/instrumentation-oracledb/package.json index afa79b275b..4576a38720 100644 --- a/packages/instrumentation-oracledb/package.json +++ b/packages/instrumentation-oracledb/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-oracledb", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", @@ -20,10 +20,12 @@ "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_ORACLEDB_TESTS_LOCAL=true npm run test-all-versions", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_ORACLEDB_TESTS_LOCAL=true npm run test", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start oracledb", + "test-services:stop": "cd ../.. && npm run test-services:stop oracledb", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, diff --git a/packages/instrumentation-oracledb/test/oracle.test.ts b/packages/instrumentation-oracledb/test/oracle.test.ts index c8857eed25..0eec83b0ac 100644 --- a/packages/instrumentation-oracledb/test/oracle.test.ts +++ b/packages/instrumentation-oracledb/test/oracle.test.ts @@ -395,8 +395,7 @@ describe('oracledb', () => { let connection: oracledb.Connection; const testOracleDB = process.env.RUN_ORACLEDB_TESTS; // For CI: assumes local oracledb is already available - const testOracleDBLocally = process.env.RUN_ORACLEDB_TESTS_LOCAL; // For local: spins up local oracledb via docker - const shouldTest = testOracleDB || testOracleDBLocally; // Skips these tests if false (default) + const shouldTest = testOracleDB; // Skips these tests if false (default) const sql = 'select 1 from dual'; const sqlWithBinds = 'select :1 from dual'; const sqlWithBindsByName = 'select :name from dual'; @@ -483,29 +482,7 @@ describe('oracledb', () => { skip(); } - if (testOracleDBLocally) { - testUtils.startDocker('oracledb'); - - // increase test time - this.timeout(50000); - - // check if docker container is up - let retries = 6; - while (retries-- > 0) { - try { - connection = await oracledb.getConnection(CONFIG); - break; - } catch (err) { - console.log('retry count %d failed waiting for DB', retries); - await new Promise(r => setTimeout(r, 10000)); - } - } - if (retries < 0) { - throw new Error('docker setup Failed'); - } - } else { - connection = await oracledb.getConnection(CONFIG); - } + connection = await oracledb.getConnection(CONFIG); await doSetup(); updateAttrSpanList(connection); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -520,10 +497,6 @@ describe('oracledb', () => { await connection.close(); } instrumentation.disable(); - if (testOracleDBLocally) { - this.timeout(5000); - testUtils.cleanUpDocker('oracledb'); - } }); beforeEach(() => { diff --git a/packages/instrumentation-pg/package.json b/packages/instrumentation-pg/package.json index 5519f576e2..b84e9fbd0b 100644 --- a/packages/instrumentation-pg/package.json +++ b/packages/instrumentation-pg/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-pg", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-pg", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", @@ -19,10 +19,12 @@ "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test-all-versions", "test:debug": "mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_POSTGRES_TESTS_LOCAL=true npm run test", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start postgres", + "test-services:stop": "cd ../.. && npm run test-services:stop postgres", "version:update": "node ../../scripts/version-update.js", "watch": "tsc -w" }, diff --git a/packages/instrumentation-pg/test/pg-pool.test.ts b/packages/instrumentation-pg/test/pg-pool.test.ts index 9c2fb05f82..5c78ec4332 100644 --- a/packages/instrumentation-pg/test/pg-pool.test.ts +++ b/packages/instrumentation-pg/test/pg-pool.test.ts @@ -141,9 +141,8 @@ describe('pg-pool', () => { spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Skips these tests if false (default) before(function () { const skip = () => { @@ -157,10 +156,6 @@ describe('pg-pool', () => { skip(); } - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } - instrumentation = new PgInstrumentation(); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -172,10 +167,6 @@ describe('pg-pool', () => { }); after(done => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - pool.end(() => { done(); }); @@ -991,9 +982,8 @@ describe('pg semantic conventions env variable', () => { const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Here we are `require`ing *before* the instrumentation is created below. // In *general* this is a potential instrumentation issue, but this works for // `pg-pool` instrumentation because it patches the `pgPool.prototype` @@ -1012,10 +1002,6 @@ describe('pg semantic conventions env variable', () => { if (!shouldTest) { skip(); } - - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } }); beforeEach(() => { @@ -1023,12 +1009,6 @@ describe('pg semantic conventions env variable', () => { context.setGlobalContextManager(contextManager); }); - after(() => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - }); - afterEach(() => { delete process.env.OTEL_SEMCONV_STABILITY_OPT_IN; memoryExporter.reset(); diff --git a/packages/instrumentation-pg/test/pg.test.ts b/packages/instrumentation-pg/test/pg.test.ts index 02dccd665d..eaab21b0c3 100644 --- a/packages/instrumentation-pg/test/pg.test.ts +++ b/packages/instrumentation-pg/test/pg.test.ts @@ -123,9 +123,8 @@ describe('pg', () => { }); const tracer = provider.getTracer('external'); - const testPostgres = process.env.RUN_POSTGRES_TESTS; // For CI: assumes local postgres db is already available - const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker - const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + const testPostgres = process.env.RUN_POSTGRES_TESTS; + const shouldTest = testPostgres; // Skips these tests if false (default) function getExecutedQueries() { return (client as any).queryQueue.push.args.flat() as (pg.Query & { @@ -145,10 +144,6 @@ describe('pg', () => { skip(); } - if (testPostgresLocally) { - testUtils.startDocker('postgres'); - } - instrumentation = new PgInstrumentation(); contextManager = new AsyncLocalStorageContextManager().enable(); @@ -162,10 +157,6 @@ describe('pg', () => { }); after(async () => { - if (testPostgresLocally) { - testUtils.cleanUpDocker('postgres'); - } - await client.end(); }); diff --git a/packages/instrumentation-pino/package.json b/packages/instrumentation-pino/package.json index 48160c01ad..17f98f43f7 100644 --- a/packages/instrumentation-pino/package.json +++ b/packages/instrumentation-pino/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-pino", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-pino", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-redis/package.json b/packages/instrumentation-redis/package.json index 9ec891b691..63b02835e8 100644 --- a/packages/instrumentation-redis/package.json +++ b/packages/instrumentation-redis/package.json @@ -10,23 +10,23 @@ "directory": "packages/instrumentation-redis" }, "scripts": { - "test-v2-v3": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v2-v3/*.test.ts'", - "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v4/*.test.ts'", - "test:debug": "cross-env RUN_REDIS_TESTS_LOCAL=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", - "test:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test", - "test:docker:run": "docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine", - "test:docker:stop": "docker stop otel-redis", - "test-all-versions": "tav", - "test-all-versions:local": "cross-env RUN_REDIS_TESTS_LOCAL=true npm run test-all-versions", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-redis", - "compile": "tsc -p .", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test-v2-v3": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v2-v3/*.test.ts'", + "test": "nyc mocha --require '@opentelemetry/contrib-test-utils' 'test/v4/*.test.ts'", + "test:debug": "cross-env RUN_REDIS_TESTS=true mocha --inspect-brk --no-timeouts 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", + "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start redis", + "test-services:stop": "cd ../.. && npm run test-services:stop redis", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/instrumentation-redis/test/v2-v3/redis.test.ts b/packages/instrumentation-redis/test/v2-v3/redis.test.ts index 529399823f..62d996cdba 100644 --- a/packages/instrumentation-redis/test/v2-v3/redis.test.ts +++ b/packages/instrumentation-redis/test/v2-v3/redis.test.ts @@ -62,8 +62,7 @@ const unsetStatus: SpanStatus = { describe('redis v2-v3', () => { let redis: any; - const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; - const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; + const shouldTest = process.env.RUN_REDIS_TESTS; const tracer = trace.getTracer('external'); before(function () { @@ -75,19 +74,9 @@ describe('redis v2-v3', () => { this.skip(); } - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - redis = require('redis'); }); - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } - }); - describe('#createClient()', () => { it('should propagate the current span to event handlers', done => { const span = tracer.startSpan('test span'); diff --git a/packages/instrumentation-redis/test/v4/redis.test.ts b/packages/instrumentation-redis/test/v4/redis.test.ts index 01927c1df5..9b92d52f75 100644 --- a/packages/instrumentation-redis/test/v4/redis.test.ts +++ b/packages/instrumentation-redis/test/v4/redis.test.ts @@ -23,13 +23,7 @@ import { RedisInstrumentation } from '../../src'; import type { MultiErrorReply } from '../../src/v4/internal-types'; import * as assert from 'assert'; -import { - redisTestConfig, - redisTestUrl, - shouldTest, - shouldTestLocal, -} from './utils'; -import * as testUtils from '@opentelemetry/contrib-test-utils'; +import { redisTestConfig, redisTestUrl, shouldTest } from './utils'; const instrumentation = registerInstrumentationTesting( new RedisInstrumentation() @@ -64,16 +58,6 @@ describe('redis v4', () => { this.test!.parent!.pending = true; this.skip(); } - - if (shouldTestLocal) { - testUtils.startDocker('redis'); - } - }); - - after(() => { - if (shouldTestLocal) { - testUtils.cleanUpDocker('redis'); - } }); let client: RedisClientType; diff --git a/packages/instrumentation-redis/test/v4/utils.ts b/packages/instrumentation-redis/test/v4/utils.ts index cc0e0a6609..b9c2e7705e 100644 --- a/packages/instrumentation-redis/test/v4/utils.ts +++ b/packages/instrumentation-redis/test/v4/utils.ts @@ -20,5 +20,4 @@ export const redisTestConfig = { export const redisTestUrl = `redis://${redisTestConfig.host}:${redisTestConfig.port}`; -export const shouldTestLocal = process.env.RUN_REDIS_TESTS_LOCAL; -export const shouldTest = process.env.RUN_REDIS_TESTS || shouldTestLocal; +export const shouldTest = process.env.RUN_REDIS_TESTS; diff --git a/packages/instrumentation-restify/package.json b/packages/instrumentation-restify/package.json index 480f61a6e7..8e4217de21 100644 --- a/packages/instrumentation-restify/package.json +++ b/packages/instrumentation-restify/package.json @@ -11,7 +11,7 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-restify", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-router/package.json b/packages/instrumentation-router/package.json index 69274a2ae6..71200635f7 100644 --- a/packages/instrumentation-router/package.json +++ b/packages/instrumentation-router/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-router", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-router", "compile": "tsc -p .", "prepublishOnly": "npm run compile", "watch": "tsc -w" diff --git a/packages/instrumentation-runtime-node/package.json b/packages/instrumentation-runtime-node/package.json index e489dc7dac..ddfe1261ed 100644 --- a/packages/instrumentation-runtime-node/package.json +++ b/packages/instrumentation-runtime-node/package.json @@ -12,7 +12,7 @@ "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-runtime-node#readme", "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-runtime-node", "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", diff --git a/packages/instrumentation-socket.io/package.json b/packages/instrumentation-socket.io/package.json index 832c982450..a9eaf9fe67 100644 --- a/packages/instrumentation-socket.io/package.json +++ b/packages/instrumentation-socket.io/package.json @@ -19,7 +19,7 @@ "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-socket.io", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-socket.io", "compile": "tsc -p ." }, "keywords": [ diff --git a/packages/instrumentation-tedious/package.json b/packages/instrumentation-tedious/package.json index 3466793b46..500ab8e30b 100644 --- a/packages/instrumentation-tedious/package.json +++ b/packages/instrumentation-tedious/package.json @@ -11,14 +11,18 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-tedious", "lint:fix": "eslint . --ext .ts --fix", "lint": "eslint . --ext .ts", "prepublishOnly": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc mocha 'test/**/*.test.ts'", + "test:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm test", "test-all-versions": "tav", + "test-all-versions:with-services-env": "cross-env NODE_OPTIONS='-r dotenv/config' DOTENV_CONFIG_PATH=../../test/test-services.env npm run test-all-versions", + "test-services:start": "cd ../.. && npm run test-services:start mssql", + "test-services:stop": "cd ../.. && npm run test-services:stop mssql", "version:update": "node ../../scripts/version-update.js" }, "keywords": [ @@ -56,6 +60,7 @@ "@opentelemetry/sdk-trace-base": "^2.0.0", "@types/mocha": "10.0.10", "@types/node": "18.18.14", + "cross-env": "7.0.3", "nyc": "17.1.0", "rimraf": "5.0.10", "semver": "7.7.2", diff --git a/packages/instrumentation-tedious/test/instrumentation.test.ts b/packages/instrumentation-tedious/test/instrumentation.test.ts index 4c8c27e76b..46eed76563 100644 --- a/packages/instrumentation-tedious/test/instrumentation.test.ts +++ b/packages/instrumentation-tedious/test/instrumentation.test.ts @@ -93,31 +93,16 @@ describe('tedious', () => { const provider = new BasicTracerProvider({ spanProcessors: [new SimpleSpanProcessor(memoryExporter)], }); - const shouldTest = process.env.RUN_MSSQL_TESTS; // For CI: assumes local db is already available - const shouldTestLocally = process.env.RUN_MSSQL_TESTS_LOCAL; // For local: spins up local db via docker + const shouldTest = process.env.RUN_MSSQL_TESTS; before(function (done) { - if (!(shouldTest || shouldTestLocally) || incompatVersions) { + if (!shouldTest || incompatVersions) { // this.skip() workaround // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901 this.test!.parent!.pending = true; this.skip(); } - if (shouldTestLocally) { - testUtils.startDocker('mssql'); - // wait 15 seconds for docker container to start - this.timeout(20000); - setTimeout(done, 15000); - } else { - done(); - } - }); - - after(function () { - if (shouldTestLocally) { - this.timeout(15000); - testUtils.cleanUpDocker('mssql'); - } + done(); }); beforeEach(async function () { diff --git a/packages/instrumentation-typeorm/package.json b/packages/instrumentation-typeorm/package.json index 3f0ee2045b..68cc669b1c 100644 --- a/packages/instrumentation-typeorm/package.json +++ b/packages/instrumentation-typeorm/package.json @@ -11,8 +11,8 @@ }, "scripts": { "clean": "rimraf build/*", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-typeorm", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", diff --git a/packages/instrumentation-undici/package.json b/packages/instrumentation-undici/package.json index 2069b893f1..fa219a7f0f 100644 --- a/packages/instrumentation-undici/package.json +++ b/packages/instrumentation-undici/package.json @@ -10,17 +10,17 @@ "directory": "packages/instrumentation-undici" }, "scripts": { - "prepublishOnly": "npm run compile", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", - "compile": "tsc -p .", - "test": "nyc mocha test/**/*.test.ts", - "test-all-versions": "tav", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-undici", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc -w", - "version:update": "node ../../scripts/version-update.js" + "prepublishOnly": "npm run compile", + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha test/**/*.test.ts", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js", + "watch": "tsc -w" }, "keywords": [ "opentelemetry", diff --git a/packages/instrumentation-user-interaction/package.json b/packages/instrumentation-user-interaction/package.json index 805e4bb2aa..5a00ea3cd4 100644 --- a/packages/instrumentation-user-interaction/package.json +++ b/packages/instrumentation-user-interaction/package.json @@ -12,16 +12,16 @@ "directory": "packages/instrumentation-user-interaction" }, "scripts": { + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-user-interaction", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/instrumentation-winston/package.json b/packages/instrumentation-winston/package.json index b1674b5221..71d179b048 100644 --- a/packages/instrumentation-winston/package.json +++ b/packages/instrumentation-winston/package.json @@ -10,17 +10,16 @@ "directory": "packages/instrumentation-winston" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "test-all-versions": "tav", - "tdd": "npm run test-run -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/instrumentation-winston", - "compile": "tsc -p ." + "test": "nyc mocha 'test/**/*.test.ts'", + "test-all-versions": "tav", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "instrumentation", diff --git a/packages/plugin-react-load/package.json b/packages/plugin-react-load/package.json index c2da7b8a0c..3fb70fdc8b 100644 --- a/packages/plugin-react-load/package.json +++ b/packages/plugin-react-load/package.json @@ -13,15 +13,15 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/plugin-react-load", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "lint:readme": "node ../../scripts/lint-readme.js", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/plugin-react-load", - "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", + "version:update": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, "keywords": [ diff --git a/packages/propagation-utils/package.json b/packages/propagation-utils/package.json index 0107581eb6..42ca81e8a2 100644 --- a/packages/propagation-utils/package.json +++ b/packages/propagation-utils/package.json @@ -9,8 +9,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagation-utils", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagation-utils", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/propagator-aws-xray-lambda/package.json b/packages/propagator-aws-xray-lambda/package.json index c9a5b7cc7d..e01c8e2d56 100644 --- a/packages/propagator-aws-xray-lambda/package.json +++ b/packages/propagator-aws-xray-lambda/package.json @@ -11,14 +11,14 @@ "directory": "packages/propagator-aws-xray-lambda" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray-lambda", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/propagator-aws-xray/package.json b/packages/propagator-aws-xray/package.json index 6fd169cd57..2171b19ea6 100644 --- a/packages/propagator-aws-xray/package.json +++ b/packages/propagator-aws-xray/package.json @@ -11,17 +11,17 @@ "directory": "packages/propagator-aws-xray" }, "scripts": { - "prepublishOnly": "npm run compile", - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-aws-xray", "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "prepublishOnly": "npm run compile", "test": "nyc mocha test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "tdd": "npm run tdd:node", "tdd:node": "npm run test -- --watch-extensions ts --watch", "tdd:browser": "karma start", - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "lint": "eslint . --ext .ts", - "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json" }, diff --git a/packages/propagator-instana/package.json b/packages/propagator-instana/package.json index b8fc731d4c..47d8de0018 100644 --- a/packages/propagator-instana/package.json +++ b/packages/propagator-instana/package.json @@ -11,15 +11,15 @@ "directory": "packages/propagator-instana" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-instana", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", - "test:browser": "nyc karma start --single-run", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-instana", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "test:browser": "nyc karma start --single-run", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/propagator-ot-trace/package.json b/packages/propagator-ot-trace/package.json index 32feece7bc..93bebe1cf8 100644 --- a/packages/propagator-ot-trace/package.json +++ b/packages/propagator-ot-trace/package.json @@ -11,15 +11,15 @@ "directory": "packages/propagator-ot-trace" }, "scripts": { - "setup:dev": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", - "compile": "tsc --build tsconfig.json tsconfig.esm.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "test": "nyc mocha test/**/*.test.ts", - "test:browser": "nyc karma start --single-run", + "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/propagator-ot-trace", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepublishOnly": "npm run compile" + "prepublishOnly": "npm run compile", + "test": "nyc mocha test/**/*.test.ts", + "test:browser": "nyc karma start --single-run", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/redis-common/package.json b/packages/redis-common/package.json index f4a41cbcfa..687a6d34c0 100644 --- a/packages/redis-common/package.json +++ b/packages/redis-common/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { + "compile": "tsc --build tsconfig.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/redis-common", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/redis-common", - "compile": "tsc --build tsconfig.json", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", "watch": "tsc -w" diff --git a/packages/resource-detector-alibaba-cloud/package.json b/packages/resource-detector-alibaba-cloud/package.json index f940151960..04260f5ac2 100644 --- a/packages/resource-detector-alibaba-cloud/package.json +++ b/packages/resource-detector-alibaba-cloud/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-alibaba-cloud", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-aws/package.json b/packages/resource-detector-aws/package.json index 4a9fa21ce6..fe61013519 100644 --- a/packages/resource-detector-aws/package.json +++ b/packages/resource-detector-aws/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-aws", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-azure/package.json b/packages/resource-detector-azure/package.json index 1cdafa97ab..d36b32579f 100644 --- a/packages/resource-detector-azure/package.json +++ b/packages/resource-detector-azure/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-azure", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-container/package.json b/packages/resource-detector-container/package.json index b78c7a77a2..58e8077ea5 100644 --- a/packages/resource-detector-container/package.json +++ b/packages/resource-detector-container/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-container", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-container", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-gcp/package.json b/packages/resource-detector-gcp/package.json index b33a9feae6..fa58ce221e 100644 --- a/packages/resource-detector-gcp/package.json +++ b/packages/resource-detector-gcp/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-gcp", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-github/package.json b/packages/resource-detector-github/package.json index 761e9ec10c..e34e89ea5b 100644 --- a/packages/resource-detector-github/package.json +++ b/packages/resource-detector-github/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-github", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-github", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/resource-detector-instana/package.json b/packages/resource-detector-instana/package.json index f838da1b28..72eae077f7 100644 --- a/packages/resource-detector-instana/package.json +++ b/packages/resource-detector-instana/package.json @@ -12,8 +12,8 @@ }, "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "setup:dev": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", "compile": "tsc --build tsconfig.json tsconfig.esm.json", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/resource-detector-instana", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", diff --git a/packages/sql-common/package.json b/packages/sql-common/package.json index 1ec2097b6d..43f53d1a37 100644 --- a/packages/sql-common/package.json +++ b/packages/sql-common/package.json @@ -8,10 +8,10 @@ "access": "public" }, "scripts": { + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sql-common", + "compile": "tsc --build tsconfig.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "setup:dev": "nx run-many -t compile -p @opentelemetry/sql-common", - "compile": "tsc --build tsconfig.json", "prepublishOnly": "npm run compile", "test": "nyc mocha 'test/**/*.test.ts'", "watch": "tsc -w" diff --git a/packages/winston-transport/package.json b/packages/winston-transport/package.json index 0ca3242bdc..6ad62d2731 100644 --- a/packages/winston-transport/package.json +++ b/packages/winston-transport/package.json @@ -10,15 +10,15 @@ "directory": "packages/winston-transport" }, "scripts": { - "test": "nyc mocha 'test/**/*.test.ts'", - "tdd": "npm run test -- --watch-extensions ts --watch", "clean": "rimraf build/*", + "compile": "tsc -p .", + "compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/winston-transport", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "prepublishOnly": "npm run compile", - "version:update": "node ../../scripts/version-update.js", - "setup:dev": "nx run-many -t compile -p @opentelemetry/winston-transport", - "compile": "tsc -p ." + "tdd": "npm run test -- --watch-extensions ts --watch", + "test": "nyc mocha 'test/**/*.test.ts'", + "version:update": "node ../../scripts/version-update.js" }, "keywords": [ "transport", diff --git a/test/test-services.env b/test/test-services.env index 4f8a62f10b..16300608bf 100644 --- a/test/test-services.env +++ b/test/test-services.env @@ -1,5 +1,5 @@ RUN_CASSANDRA_TESTS=1 -CASSANDRA_HOST=localhostç +CASSANDRA_HOST=localhost RUN_MEMCACHED_TESTS=1 OPENTELEMETRY_MEMCACHED_HOST=localhost