opencog / rocca

Rational OpenCog Controlled Agent (ROCCA). Use OpenCog to control a rational agent in OpenAI Gym and Malmo environments.
GNU Affero General Public License v3.0
30 stars 18 forks source link

Add unit and integration tests #25

Open ngeiswei opened 3 years ago

ngeiswei commented 3 years ago

As more people are getting involved it is of paramount importance that we add a test suite.

All working examples (such as https://github.com/opencog/rocca/blob/master/examples/chase.py) should probably be turned into tests (not sure if the example code should be reused or copied). And important methods and utils functions associated to the OpencogAgent class should be tested.

It's unclear to me what test framework we want to use. I suppose

https://pypi.org/project/nose/

is an obvious candidate, but other suggestions are welcome.

ntoxeg commented 3 years ago

One note in regards to nose - there is a new, maintained project that is the successor, nose2. I don’t have a personal preference but there is also pytest, which is more popular, so it has more plugins but this might not be relevant.

Another thing is that nbdev can use notebooks as tests - automatically running them to see if they all pass through.

Finally, is there going to be a CI setup? We could just use Github Actions for it, I can figure out a config for it if you want.

ngeiswei commented 3 years ago

Thanks for your input, @ntoxeg.

Yeah, totally up for a CI setup. Most opencog repos are using circleci which, beside the fact that it is very slow, is working quite well. For instance the branch of a given PR can be checked before merging, etc.

github-actions[bot] commented 2 years ago

Detected no activity for this issue in the last 60 days. The issue will be closed in 7 days if no further activity occurs.

ntoxeg commented 2 years ago

Current progress is that #32 adds a CartPole test. I am not sure how to test AtomSpace-interacting code though as it does not return anything useful (as it does its job by manipulating the AtomSpace).

github-actions[bot] commented 2 years ago

Detected no activity for this issue in the last 60 days. The issue will be closed in 7 days if no further activity occurs.