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

Improve tests of simulation object #474

Closed
yeganer opened this issue Feb 2, 2016 · 3 comments
Closed

Improve tests of simulation object #474

yeganer opened this issue Feb 2, 2016 · 3 comments

Comments

@yeganer
Copy link
Contributor

yeganer commented Feb 2, 2016

As i wrote in PR #471 test_simulation.py is doomed to fail on any modification that changes the input for the montecarlo runner. To solve this i propose two solutions:

  1. delete test_simulation.py and add it's logic (checking nubar etc.) to test_tardis_full.py when doing this, be careful to test each variable in their own function to see which values differ and which ones do not.
  2. Construct meaningful unittests for the Simulation class. This means loading a known model with a defined plasma stat and working on that model. This way the test will be independent of the rest of the codebase and only changes to the logic of the Simulator will cause the tests to fail.

I think we should do 1. anyway. ( This might end up in the slow tests )
With the current code it's not possible to do 2. but i think adding the functionality to save and restore models might come in handy in the future.

What do you think, how should we handle this?

yeganer pushed a commit to yeganer/tardis that referenced this issue Feb 3, 2016
The comments were describing the problem with the tests in this file.
An issue has been created regarding this problem rendering the comments
obsolete.

Related Issue: tardis-sn#474
@AMAN3003
Copy link

AMAN3003 commented Feb 7, 2016

@yeganer I would like to work on this we should do 1st

@yeganer
Copy link
Contributor Author

yeganer commented Feb 7, 2016

@AMAN3003 Thanks for the request but I think we should wait with implementing. The proposal 1 will most likely something that will be added to all the slow tests so writing an implementation for the current master is wasted time.

The idea of writing a proper unit_test has to wait until we have the tools required for that (or an idea how to design thuse tests to be independent of other code). The tools we'd need would be the ability to store and restore a complete model and resume calculation. This isn't available yet but a planned feature.

@unoebauer unoebauer changed the title test_simulation.py obsolete? Improve tests of simulation object Nov 18, 2016
@unoebauer
Copy link
Contributor

@wkerzendorf - what to do with this one? 2.0 stuff?

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

4 participants