Skip to content
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

Commit defs #758

Merged
merged 2 commits into from
Nov 18, 2024
Merged

Commit defs #758

merged 2 commits into from
Nov 18, 2024

Conversation

cressie176
Copy link
Collaborator

There are some good arguments for committing the generated lib/defs.js file

  1. the github actions will run from the same lib/defs.js that the maintainers use, and that will be published
  2. it will be easier for users to contribute
  3. amqplib can be depended on using a github url from package.json, making it easier to test forks/branches

I've also decided to include the amqp-rabbit-0.9.1.json specification. It's not necessary, but only a small increase to the overall package size and might prove useful for someone trying to understand why an operation is missing


all: lib/defs.js
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the default "all" target with an "error" target because we don't want people running make and unintentionally generating new lib/defs.js

coverage: $(NYC) lib/defs.js
$(NYC) --reporter=lcov --reporter=text $(_MOCHA) -u tdd -R progress test/
coverage: $(NYC)
$(NYC) --clean --reporter=lcov --reporter=text $(_MOCHA) -u tdd --exit -R progress test/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the clean target deleting the .coverage directory, I thought it better to have nyc do it.

Mocha was hanging so I added the --exit argument

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is causing Mocha to hang? It's generally a good idea to avoid --exit, because otherwise we can miss problems with resource disposal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see if I can work it out. Most likely a connection to the broker not being closed in one of the tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are loads of test where the connection isn't being closed. Really this should be done on both success and failure, so it will take a while to fix them all. I'll create a separate issue for it and leave the --exit for now.

@echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html"

lib/defs.js: clean bin/generate-defs test
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to be sure the new lib/defs.js were tested post generation

@cressie176 cressie176 requested a review from kibertoad April 11, 2024 20:13
@cressie176 cressie176 merged commit 0a87ee4 into main Nov 18, 2024
6 checks passed
@cressie176 cressie176 deleted the commit-defs branch November 18, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants