-
Notifications
You must be signed in to change notification settings - Fork 584
chore: add test-services scripts per package #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: add test-services scripts per package #2932
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to reviewer: this was a typo from #2886
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for reviewer: script name has changed to be more explicit about what it does. you will see this change on each package.json
that has it
"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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for reviewer: scripts with docker commands have been deleted because now the service is controlled via test-services:start
and test-services:stop
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2932 +/- ##
==========================================
- Coverage 89.05% 88.95% -0.10%
==========================================
Files 188 188
Lines 9189 9189
Branches 1891 1891
==========================================
- Hits 8183 8174 -9
- Misses 1006 1015 +9 🚀 New features to boost your workflow:
|
@@ -33,62 +32,6 @@ import * as path from 'path'; | |||
import * as fs from 'fs'; | |||
import { InstrumentationBase } from '@opentelemetry/instrumentation'; | |||
|
|||
const dockerRunCmds = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for reviewer: not needed anymore
"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\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for reviewer: this is a reminder to configure test all versions in order to get the coverage reports. There is a follow up PR which will take care of it
This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature. |
Which problem is this PR solving?
This PR is a follow-up of #2886 which aims to provide all the necessary tools/scripts in each package to work independently from others. As described in
CONTRIBUTING.md
with the added scripts a developer could start and stop the necessary services to test an instrumentation.Supersedes: #2214
Short description of the changes
test-services:start
andtest-services:stop
script in each package that requires services to run the tests. These scripts start/stop only the necessary services instead of all the ones defined in/test/docker-compose.yml
.test:with-services-env
where applies. The script sets the necessary environment variables for testing and runs the teststest-all-versions:with-services-env
script where applies. The script does liketes:with-services-env
but runstav
instead.Other changes
The scripts section of each package has been reordered to be grouped by topic: compilation, linting, test, ...
All packages no have s structure similar to this