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

refactor: Update nock version and migrate broken tests #1504

Closed

Conversation

sergioregueira
Copy link
Contributor

@sergioregueira sergioregueira commented Sep 6, 2020

Which problem is this PR solving?

This pull request closes issue #1303.

Short description of the changes

  1. Move nock from dependencies to devDependencies in @opentelemetry/sdk-node (it is a test dependency).
  2. Update nock version from 12.0.3 to 13.0.4 (latest version) in 9 packages.
  3. Migrate tests following Migration guide:
    1. Replace nock.Interceptor.socketDelay() with nock.Interceptor.delayConnection().
    2. nock no longer emits a socket hang up error on request abort and it closes connection inmediately after writing the response, so I had to replace a nock with a manual mock (built with http.createServer [1]) to simulate aborted event.

[1] A server was already running on serverPort because of previous tests (See http-enable.test.ts > HttpPlugin > enable > with good plugin options > before), so I chose to start a new server instead of rewriting all the previous tests.

@sergioregueira sergioregueira changed the title refactor: Update nock and migrate tests refactor: Update nock version and migrate broken tests Sep 6, 2020
@codecov
Copy link

codecov bot commented Sep 6, 2020

Codecov Report

Merging #1504 into master will increase coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1504      +/-   ##
==========================================
+ Coverage   93.82%   93.84%   +0.02%     
==========================================
  Files         154      154              
  Lines        4762     4762              
  Branches      951      951              
==========================================
+ Hits         4468     4469       +1     
+ Misses        294      293       -1     
Impacted Files Coverage Δ
packages/opentelemetry-plugin-http/src/http.ts 98.42% <0.00%> (+0.52%) ⬆️

@obecny
Copy link
Member

obecny commented Sep 8, 2020

@sergioregueira build is failing, seems like valid failure, please have a look

@sergioregueira sergioregueira marked this pull request as draft September 11, 2020 08:44
Base automatically changed from master to main January 25, 2021 19:26
@pichlermarc
Copy link
Member

Closing this as it has been fixed by #2652 🙂

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.

None yet

3 participants