Closed kdhira closed 2 years ago
@kobik can you take a look at this?
Hi @kdhira , thanks for the PR!
I'll have a look tomorrow.
Thanks @kobik
Let me know if there's any questions or anything you're unsure about. Like I mentioned before, the fix minimally circumvents the NPE which gets the route label working with just 'N/A' for my usecase.
Also I'm hoping that these changes can be released to NPM as a version of prometheus-api-metrics, probably something like 3.2.1 of the package. Is there anything extra I need to do (ie version bumping etc) or is that all handled by you?
Hi @kobik,
I added a unit test for this scenario. Please let me know if anything is wrong. I also have a commit for updating dependencies from npm audit fix
.
Thanks @kobik,
I've seen your comment regarding the package version, and have reverted it. I had this as a separate commit so it was simple for me to just rebase it out.
Let me know if there's anything else I should change :)
@kdhira, can you also revert the package-lock.json changes?
I'd like to handle them in a separate PR.
@kobik, I have dropped my commit that updated dependencies (and doing so reverted the package-lock.json changes I made). Hope this helps!
Sure, thanks again @kdhira !
@kdhira it seems like the new test didn't cover our case.
see https://coveralls.io/builds/47157280/source?filename=src%2Fkoa-middleware.js#L99
Hmm I'll have to look at the test again, but I'm pretty confident that line gets run as the test I made has to resolve the route to use in the metric as 'N/A' somehow (through the || 'N/A'
in _handleResponse
) ...
Does the coveralls tool run the unit-tests or the integration tests (or both) to detect coverage?
Hey @kobik,
I think I have done what I need to ensure coverage. I added an integration test, and updated the test koa-server implementation so that the wildcard endpoint case could be correctly tested.
I also ran npm run integration-tests
and after this addition it no longer shows line 99 as being an Uncovered Line.
Should be ready to run the Github workflows again
you're correct, for some reason it's only collected from integration tests.
you can update the workflow to run nyc npm test
instead of running unit and integration separately, which should collect the coverage of both of them.
but also what you did should be fine 👍
:tada: This PR is included in version 3.2.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
In the cases where the request route is not matched to any Koa route, bail out before trying to format the path string.
Issue: #59