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

test: Basic unit testing of node package #503

Merged
merged 5 commits into from
Jun 7, 2022

Conversation

orpheuslummis
Copy link
Contributor

@orpheuslummis orpheuslummis commented Jun 6, 2022

RELEVANT ISSUE(S)

Resolves #502

DESCRIPTION

Provide basic unit tests for the node package.

HOW HAS THIS BEEN TESTED?

These are unit tests.

CHECKLIST:

  • I have commented the code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the repo-held documentation.
  • I have made sure that the PR title adheres to the conventional commit style (subset of the ones we use can be found under: tools/configs/chglog/config.yml

ENVIRONMENT / OS THIS WAS TESTED ON?

Please specify which of the following was this tested on (remove or add your own):

  • Arch Linux
  • Debian Linux
  • MacOS
  • Windows

@orpheuslummis orpheuslummis added area/testing Related to any test or testing suite area/network Related to internal/external network components action/no-benchmark Skips the action that runs the benchmark. labels Jun 6, 2022
@orpheuslummis orpheuslummis added this to the DefraDB v0.3 milestone Jun 6, 2022
@orpheuslummis orpheuslummis self-assigned this Jun 6, 2022
@orpheuslummis
Copy link
Contributor Author

You're invited to suggest further unit tests. Some of it isn't tested because it is expected to change relatively soon, such as key management, and others because I've found them difficult to test and just wanted a quick PR... e.g. validity of pubsub or Node.Boostrap or Node.Close .

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #503 (2462418) into develop (45978e0) will decrease coverage by 12.62%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop     #503       +/-   ##
============================================
- Coverage    65.09%   52.46%   -12.63%     
============================================
  Files           87       97       +10     
  Lines        10242    13144     +2902     
============================================
+ Hits          6667     6896      +229     
- Misses        2927     5574     +2647     
- Partials       648      674       +26     
Impacted Files Coverage Δ
net/pb/net.pb.go 0.81% <0.00%> (ø)
net/server.go 13.98% <0.00%> (ø)
net/dialer.go 3.12% <0.00%> (ø)
net/client.go 0.00% <0.00%> (ø)
node/options.go 52.83% <0.00%> (ø)
net/dag.go 5.33% <0.00%> (ø)
net/pb/custom.go 0.00% <0.00%> (ø)
net/process.go 0.00% <0.00%> (ø)
net/peer.go 12.54% <0.00%> (ø)
node/node.go 66.12% <0.00%> (ø)
... and 3 more

@orpheuslummis orpheuslummis requested a review from a team June 6, 2022 22:52
Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

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

Looking great

node/node_test.go Outdated Show resolved Hide resolved
node/node_test.go Outdated Show resolved Hide resolved
node/node_test.go Show resolved Hide resolved
@orpheuslummis orpheuslummis requested a review from jsimnz June 7, 2022 20:29
Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

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

Last two items. LGTM

node/node_test.go Outdated Show resolved Hide resolved
node/node_test.go Outdated Show resolved Hide resolved
@orpheuslummis orpheuslummis requested a review from jsimnz June 7, 2022 21:01
@orpheuslummis orpheuslummis merged commit 707c124 into develop Jun 7, 2022
@orpheuslummis orpheuslummis deleted the orpheus/test/introduce-node-pkg-testing branch June 7, 2022 21:07
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/network Related to internal/external network components area/testing Related to any test or testing suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit testing of node package
2 participants