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

influx client needs more test coverage #2313

Closed
otoolep opened this issue Apr 16, 2015 · 9 comments
Closed

influx client needs more test coverage #2313

otoolep opened this issue Apr 16, 2015 · 9 comments

Comments

@otoolep
Copy link
Contributor

otoolep commented Apr 16, 2015

This issue was exposed by PR #2306. main_test.go in influx should not be importing main packages, as this is not a valid operation.

Relevant links:

#2306
golang/go#4210

@otoolep
Copy link
Contributor Author

otoolep commented Apr 16, 2015

@corylanou

@beckettsean beckettsean added this to the 0.9.0 milestone Apr 30, 2015
@toddboom toddboom modified the milestones: 0.9.0, 0.9.1 May 8, 2015
@toddboom toddboom modified the milestones: 0.9.1, 0.9.2 Jun 5, 2015
@beckettsean beckettsean modified the milestones: Next Point Release, 0.9.2 Jul 15, 2015
@beckettsean beckettsean modified the milestones: Next Point Release, Longer term Aug 6, 2015
@beckettsean
Copy link
Contributor

@otoolep @corylanou fix or close?

@corylanou
Copy link
Contributor

I think keep it open. The real fix is to move most of the actual "work" to another package (or sub package) and the main package becomes just a shell that basically calls into the sub package with a New and then Runs it, etc. This will allow us to test without a main package and put these tests back in place.

You can look at the cmd/influxd/run package to get an idea about how we are outside of main from cmd/influxd

I would say this is a beginner to medium task if the community wanted to take a pass at it.

@pires
Copy link
Contributor

pires commented Nov 9, 2015

I'm willing to own this after #4711 #4710 #4704 and #4702 are either merged or closed. I'd like to:

  • Refactor history
    • Don't write to file at all times but only when commands are valid ones
    • Don't read history from file but from memory (use WriteHistory(bytes.Buffer))
  • Improve command parsing including...
  • Use parser to validate (at least some) statements before sending to server

@corylanou
Copy link
Contributor

That sounds awesome! +1 from me on doing those things. I'll work on getting the rest of those PR's reviewed today as well so we can get them merged.

@pires
Copy link
Contributor

pires commented Nov 9, 2015

Attention: this issue is placeholder for ideas, suggestions or comments related to the aforementioned refactor. I will probably move it to the proper issue when #4711 #4710 #4704 and #4702 are reviewed.

As per @corylanou comments:

It would be nice in the test to understand if these commands selected the correct "code branch". I understand it isn't possible with the way the current method is written. I'm only bringing it up as it may be something to think about when you refactor the cli main package going forward.

@corylanou
Copy link
Contributor

@pires ok, I reviewed them. Notified the core team we need one more +1 from another core team member and then we will merge. Thanks for all the hard work!

@pires
Copy link
Contributor

pires commented Nov 9, 2015

Thank you @corylanou.

CrazyJvm pushed a commit to CrazyJvm/influxdb that referenced this issue Nov 17, 2015
@jsternberg
Copy link
Contributor

I'm closing this since it doesn't have any specific value such as "achieve 80% code coverage". I'm also closing all client related issues and taking those into account for a new client that will be at influxdata/influxdb-client when it's done.

mark-rushakoff pushed a commit that referenced this issue Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants