orbitdeterminator icon indicating copy to clipboard operation
orbitdeterminator copied to clipboard

Code Unit Testing Philosophy

Open hornig opened this issue 4 years ago • 8 comments

Hi,

I would like to start a discussion how we do unit testing. I just saw now to testing approaches. One is with unittest[0] and one with pytest[1]

[0] https://github.com/aerospaceresearch/orbitdeterminator/blob/master/orbitdeterminator/doppler/tests/test_utils.py#L1 [1] https://github.com/aerospaceresearch/orbitdeterminator/blob/master/orbitdeterminator/tests/test_check_keplerian.py#L6

I would like to discuss two things: which lib shall we take? I would like only to have one approach. that would make it easiert to understand and code for and secondly, I would like to have only one central test folder. currently the gsoc structure has one of its own tests. shall me move it to the main one and re-name the test for "test_doppler_method"?

please discuss.

hornig avatar Oct 20 '20 19:10 hornig

I'd personally prefer pytest over unittest, but I'm not sure if there's a reason why some tests use one or the other. I would also be in favor of having all tests in a single place, so moving the doppler tests to orbitdeterminator/tests/ seems to me like a good thing to do

PerezHz avatar Oct 22 '20 05:10 PerezHz

@apak-00 do you think we could re-code your test and use pytest?

hornig avatar Oct 24 '20 22:10 hornig

I will like to work on this issue. Can you assign it to me?

spursbyte avatar Jan 17 '21 16:01 spursbyte

I will like to work on this issue. Can you assign it to me?

just start :). Me and @PerezHz will help. Either ask here or come to our Zulip chat :).

hornig avatar Mar 13 '21 19:03 hornig

Hello @hornig I am a GSoC'21 aspirant. Here are some points that I feel could help-

  • Pytest has all the baseline features of unittest library. So pytest is always a plus thing for us.
  • Pytest can help us to integrate much more modules with it, like xdist(multiple cpu distribution library).
  • Pytest has some great integration with coverage libraries, which can help in near future when in need for analysing code coverage.

As for the central test folder is considered, I think it would be a good plan of action. Also if we want to (in near future) need to segregate type of tests and then run them according to our needs, with marks feature of pytest.

These are just some of my observations. Please do correct me if I am wrong anywhere. Thank you!

shubhank-saxena avatar Mar 14 '21 11:03 shubhank-saxena

Ok shubhank, thx. And now? :)

hornig avatar Mar 15 '21 05:03 hornig

Ok shubhank, thx. And now? :)

I am on it!

shubhank-saxena avatar Mar 15 '21 07:03 shubhank-saxena

Ok shubhank, thx. And now? :)

I am on it!

works?

hornig avatar Mar 26 '21 23:03 hornig