[tor-bugs] #21171 [Metrics/Onionoo]: write a test for NodeDetailsStatusUpdater

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jun 20 22:02:37 UTC 2017


#21171: write a test for NodeDetailsStatusUpdater
-----------------------------+------------------------------
 Reporter:  iwakeh           |          Owner:  metrics-team
     Type:  enhancement      |         Status:  new
 Priority:  Medium           |      Milestone:
Component:  Metrics/Onionoo  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:  metrics-help     |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:                   |        Sponsor:
-----------------------------+------------------------------

Comment (by kiki201):

 Replying to [comment:4 iwakeh]:
 > Replying to [comment:3 kiki201]:
 > > Do I need to create mock objects for ReverseDomainNameResolver,
 LookupService, Descriptor and other classes?
 >
 > Only, if you need these to test the fix supplied in #20994.
 >
 > >
 > > Do I need to use reflection to test private methods and do I even need
 to test private methods?
 >
 > Same here, if it provides a shortcut and turns out to be easier you can
 use reflection, no must.
 >
 > As the description of this ticket is quite terse, I try to give some
 more details:
 >
 > Ticket #20994#comment:5 explains the bug, its fix, and supplies the
 fixed code, but no test.
 > So, the aim is to device a test that fails on code before
 [https://gitweb.torproject.org/onionoo.git/commit/?id=f737faa109ab527a5bfa2ded72bffd1d3063f2fc
 this commit] (and because of the reason described in #20994#comment:5).
 > There are no requirements of having to use mock objects or reflection,
 but they are fine to use for making the test code simpler.
 > This might turn out tricky, just feel free to experiment.

 I didn't understand completely what the test is supposed to do. I am
 supposed to write a test that fails on the code before the given commit.
 Does the test checks if the first_seen timestamp on bridges is not
 "1970-01-01 00:00:00" ? Or does the test have more to do with the lines
 that were commented out in #20994? Also, since this is on an old version
 of the code, I'm going to have to checkout in this branch. Is this
 correct?

 Thank you

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21171#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list