Tools - is an internal toolset of functions.
We perform tests on such functions:
- generateRandomString(),
- validateDeviceID(),
- validateSessionID().
Differential D3654
[services] Tunnelbroker - Tools tests • max on Apr 7 2022, 9:45 AM. Authored by Tags None Referenced Files
Details
Tools - is an internal toolset of functions. We perform tests on such functions:
Run yarn test-tunnelbroker-service all tests are run and succeed.
Diff Detail
Event Timeline
Comment Actions I'm not blanket opposed to tests that generate random data at runtime, but I do think it's always better (if you have time) to break it down into multiple tests that use a representative set of random data that was generated when the test was written. Overall I don't think this matters a whole lot, though – I worry about us spending too much time on tests as opposed to feature / product work.
Comment Actions It looks like there's a strong disagreement here. We can easily satisfy both approaches by adding some tests with static test data - hardcoded strings. Would you guys @geekbrother @karol-bisztyga agree with that?
Comment Actions Added tests with static variables along with generated ones. Switched from TEST_F to TEST, because we don't use fixtures here. Comment Actions Ok, let's be flexible on it!
Comment Actions In this diff naming scheme is really strange. This scheme made some sense in previous diffs, but here I can't find any. As an example of improved name, you can replace TestOperationsOnValidateSessionIDInvalid with ValidateSessionShouldReturnFalseForInvalidSession. We can also consider creating a separate test class ValidateSessionIDTests that has a test ShouldReturnFalseForInvalidSession. Comment Actions Some high-level feedback for the team here: we are spending a lot of time on tests. It's hard to justify this from a product priority perspective. I think we need to find a way to spend less time writing tests, or alternately to deprioritize automated testing entirely if we aren't able to more immediately reduce the cost of writing tests.
|