Skip to content

Factor BSD class out#13314

Merged
hithwen merged 6 commits into
masterfrom
js/refactor-network-bsd
Nov 15, 2022
Merged

Factor BSD class out#13314
hithwen merged 6 commits into
masterfrom
js/refactor-network-bsd

Conversation

@hithwen

@hithwen hithwen commented Nov 15, 2022

Copy link
Copy Markdown
Contributor

Continue network check refactor:

  • Move BSD related code to a separate class
  • Added minimal test as all this code was mostly uncovered (the unit test added increases coverage from 19.67% to 96.67% of the check_bsd class)

Out of the scope of this PR: refactor the code itself, it has been copied verbatim

Split of #13102

@ghost ghost added the integration/network label Nov 15, 2022
@codecov

codecov Bot commented Nov 15, 2022

Copy link
Copy Markdown

Codecov Report

Merging #13314 (32c707e) into master (fc5870f) will increase coverage by 0.05%.
The diff coverage is 82.20%.

Flag Coverage Δ
network 91.59% <82.20%> (+4.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

return 0

def _submit_regexed_values(self, output, regex_list, tags):
def submit_regexed_values(self, output, regex_list, tags):

@hithwen hithwen Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed since it is called from bsd (it's also used for solaris)

check_instance = LinuxNetwork('network', {}, [instance])
with mock.patch('datadog_checks.network.check_linux.get_subprocess_output') as out:
out.side_effect = ss_subprocess_mock
check_instance._get_linux_sys_net = lambda x: True

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this method does not exist

@hithwen
hithwen marked this pull request as ready for review November 15, 2022 13:49
@hithwen
hithwen requested review from a team as code owners November 15, 2022 13:49

@iliakur iliakur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hurray for more test coverage 💪

@hithwen
hithwen merged commit aeae7e3 into master Nov 15, 2022
@hithwen
hithwen deleted the js/refactor-network-bsd branch November 15, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants