Pyomo / PyomoGallery

A collection of Pyomo examples
Other
287 stars 160 forks source link

Add a test script #7

Closed ghackebeil closed 7 years ago

ghackebeil commented 7 years ago

I think we should add a simple test script that executes each of the examples and makes sure that no error occurs during execution. IMO, attempting to test anything beyond this (e.g., an output baseline) would require too much work on the part of contributors.

There are two issues that I can think of that complicate this:

  1. How do we execute an example?

    I think the answer is that for each example, we convert the .ipynb file into a temporary script using the the commnd: jupyter nbconvert --to script [filename].ipynb. As long is we can install jupyter on Travis, this seems like a straightforward thing to do.

  2. When do these tests get executed?

    Obviously, when someone pushes a new example to this repo. However, we really want to be testing after pushes to the Pyomo/pyomo master branch, just like we should be testing Pyomo/pyomo after pushes to Pyutilib/pyutilib master. It looks like we are currently not doing this (with Travis / Appveyor at least), so it makes me think it is not currently possible. @whart222, @jsiirola : Do either of you know if this is possible?

    I suppose it's also reasonable that we only test examples against the latest Pyomo release. Thoughts?

whart222 commented 7 years ago

I've setup tests for the jupyter notebooks. But these tests will not be run when Pyomo gets updated. The only way that I know to do that is to move the notebooks into the Pyomo repos. So, perhaps we should integrate this repos into the main Pyomo repos?

whart222 commented 7 years ago

OK. I figured out how to trigger the test after a successful build on Pyomo's master branch. I'm closing this ticket.