-
Notifications
You must be signed in to change notification settings - Fork 34
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
Branch for functional testing design #1280
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1280 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 84 84
Lines 8823 8823
=========================================
Hits 8823 8823 Continue to review full report at Codecov.
|
Not sure on a few points:
Sorry @MichaelClerx I think I might be not on the same wavelength about this! |
Hi @fcooper8472 ! I was imaging it would work just like the unit tests frameworks in Python. For example In In In both examples, the github action would:
When developing a new method a dev would
Finally, unlike the unit tests, I imagine the functional tests won't be part of the |
Slightly frustrating, because I don't think that's what we discussed, and I think this new design certainly warrants discussion. I'm probably not understanding something, but why do we need a whole functional testing module just to find and run tests? What's wrong with: from pints.functional import test_haario_bardenet_mcmc_banana
results = []
for i in range(10):
results.append(test_haario_bardenet_mcmc_banana()) Just completely cuts out the complexity. Then the functional testing repo itself just imports everything from Why would a PINTS user want a tool just to run a function? |
I thought that was exactly what we discussed :D In the minimal case you could run without having the tool installed, sure. But otherwise it becomes a dev tool just like the ones we already use (e.g. flake8). All I'm saying is that we have PINTS know how to use |
Thanks @MichaelClerx Yes, I was sort of thinking it would work as Fergus envisioned (perhaps even running the loop)... |
I'm really puzzled now! This PR is a draft / proposal for the code that goes in PINTS, that describes a test in terms that functional testing can understand. What Fergus suggested a while ago (pints-team/change-point-testing#38) was to
👆🏻👆🏻👆🏻 This, is an example of what would go inside (In my proposal the first line would be a clever bit of re-usable code that scans a directory, exactly the way unit tests currently work, but we can add that later once we think about making it re-usable.) The only slight difference I can see is this:
|
I stand by my original statement, but your suggestion that therefore To clarify, the part I am not understanding is why Hence from pints.functional import test_haario_bardenet_mcmc_banana
results = []
for i in range(10):
results.append(test_haario_bardenet_mcmc_banana()) would be user code for interacting with the functional test, which I think should just be an importable function in a directory of pints. |
Fair enough. The only reason you'd do that is to implement an interface defined in the functional testing code. An alternative popular testing framework is pytest, in which tests don't implement an interface, so you don't need the import The pytest setup is most similar to what we discussed (just a method). But as we use unittest for unit tests already I included an example of both.
100% agreed. That's why this PR has the functional tests outside of the main pints module. But the github action that calls all this stuff lives in the
that's exactly what the |
Could we just have a new directory alongside That way if a user wants to run them, maybe because one day we want to tweak the hyperparameters, they can just The GitHub action would do the following steps:
|
Yeah I'm OK with that 👍🏻 I was thinking the directory with the functional tests would double up as the results directory, so maybe be a submodule, but that's all dependent on future decisions on how we store and such 😄 |
Yeah, I think the easiest/quickest/dirtiest way to get started will be to dump some csv files in the functional testing repo. But I've been looking at using something like Azure Cosmos-DB which has a free tier that seems to be WELL within our usage requirements. |
See #1295 |
Something like this?