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

Rewrite upload using download code #148

Merged
merged 7 commits into from
Jul 25, 2019
Merged

Rewrite upload using download code #148

merged 7 commits into from
Jul 25, 2019

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Jul 9, 2019

This diff is yak shaving functional to implement #70. Another improvement in sight that this PR will facilitate is writing unit tests, since the code has been unified and there's less to test.


This change is Reviewable

This diff is yak shaving functional to implement #70.
@coveralls
Copy link
Collaborator

coveralls commented Jul 9, 2019

Pull Request Test Coverage Report for Build 859

  • 52 of 61 (85.25%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 74.043%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ndt7/closer/closer.go 7 10 70.0%
ndt7/receiver/receiver.go 14 17 82.35%
ndt7/upload/sender/sender.go 22 25 88.0%
Totals Coverage Status
Change from base Build 852: 0.4%
Covered Lines: 1412
Relevant Lines: 1907

💛 - Coveralls

Copy link
Contributor Author

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

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

Added some comments explaining the diff better

@@ -24,7 +24,7 @@ docker build . -t ndt-server
prepare the runtime environment

```bash
install -d certs data
install -d certs datadir
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the name because data now contains Go code. It may be bad to suggest storing data with a default command line in a place where there is also Go code, because one may be tempted to rm -rf it.

@@ -0,0 +1,23 @@
// Package closer implements the WebSocket closer.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Factored out code to allow sharing it.

@@ -1,63 +0,0 @@
// Package receiver implements the counter-flow messages receiver.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed (unclear to me why it's not shown as a renamed and slightly changed file)

@bassosimone bassosimone marked this pull request as ready for review July 9, 2019 18:27
Conflicts:
	ndt7/upload/upload.go
Copy link
Contributor

@pboothe pboothe left a comment

Choose a reason for hiding this comment

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

:LGTM: with some commenting and format questions.

Reviewed 5 of 9 files at r1, 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @bassosimone and @pboothe)


ndt7/receiver/receiver.go, line 69 at r2 (raw file):

}

func start(

Weird formatting. Is this how go fmt did it after you put it all on one line? Because the rule is: do it the way go fmt does it.


ndt7/receiver/receiver.go, line 93 at r2 (raw file):

// StartUploadReceiver is like StartDownloadReceiver except that it
// tolerates incoming binary messages, which are indeeed sent to cause

remove 'indeed'


ndt7/measurer/measurer.go, line 1 at r2 (raw file):

// Package measurer contains the measurer. Its job is to collect metrics
// from a socket connection and return them for consumption.

// Package measurer collects metrics from a socket connection and returns them for consumption.

Copy link
Contributor Author

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @pboothe)


ndt7/receiver/receiver.go, line 69 at r2 (raw file):

Previously, pboothe (Peter Boothe) wrote…

Weird formatting. Is this how go fmt did it after you put it all on one line? Because the rule is: do it the way go fmt does it.

As discussed in another PR, go fmt accepts this format. I'm going to apply the 100 chars-ish rule to decide whether to keep it wrapped or unwrap it.


ndt7/receiver/receiver.go, line 93 at r2 (raw file):

Previously, pboothe (Peter Boothe) wrote…

remove 'indeed'

Done.


ndt7/measurer/measurer.go, line 1 at r2 (raw file):

Previously, pboothe (Peter Boothe) wrote…
// Package measurer contains the measurer. Its job is to collect metrics
// from a socket connection and return them for consumption.

// Package measurer collects metrics from a socket connection and returns them for consumption.

Done.

@bassosimone bassosimone merged commit 089623f into master Jul 25, 2019
@bassosimone bassosimone deleted the issue/70 branch July 25, 2019 14:51
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.

3 participants