opencog / unity3d-opencog-game

A Unity3D game world for OpenCog-controlled agents
http://wiki.opencog.org/w/Setting_up_the_Unity3D_world
GNU Affero General Public License v3.0
55 stars 40 forks source link

[Doc] Running Unit Tests #61

Open Spydrouge opened 9 years ago

Spydrouge commented 9 years ago

To run unit tests, we must specify the following command line arguments:

Understanding Running the Unit Tests SNAFU

There may have been some misunderstanding in how we believed Unity would handle unit-tests. Until we can do a little more fishing around, the following text is being kept as notes.

Certainty If one runs the unity game with these commands:

UNITTEST_ALL:true

Or:

UNITTEST_EMBODIMENT:true
UNITTEST_BATTERY:true
UNITTEST_PLAN:true

And quit on finishing the tests:

UNITTEST_EXIT:true

Uncertainty 1.

Originally we believed we would be able to run the executables from the command line with no graphics to test the unit tests. This is complicated by the fact that the batchmode, quit, and nographics arguments appear to be intended for use when creating builds; not testing them.

I had some permissions trouble on windows while research/testing/lookingAround and have not fully explored this information. Anyone who researches to the contrary, please update.

In any event, if this is the case, having buildbot run with -batchmode and -nographics and something like -args="The Unit Test Args" should allow us to test if the game works (-quit would terminate the game immediately after compilation, and we need the game to run in order to perform our unit tests)

Uncertainty 2.

One can currently witness unit tests run. However at present we are unable to capture or assess return codes. Lake is looking ito this.

Uncertainty 3.

It is possible we could create our unit tests by simply running the game and, upon its execution, check the log for ERROR statements.

Nemquae commented 9 years ago

Is it a colon or an equal sign? I may have changed it because I noticed that the command line arguments were preparsed.

On Tue, Dec 9, 2014 at 12:41 PM, Spydrouge notifications@github.com wrote:

To run unit tests, we must specify the following command line arguments:

To run in batch mode:

-batchmode -nographics

To run the tests:

UNITTEST_EMBODIMENT:true UNITTEST_BLOCK:true UNITTEST_PLAN:true

Together:

-batchmode -nographics UNITTEST_EMBODIMENT:true UNITTEST_BLOCK:true UNITTEST_PLAN:true

— Reply to this email directly or view it on GitHub https://github.com/opencog/unity3d-opencog-game/issues/61.

Spydrouge commented 9 years ago

ROUTER_IP worked with a colon when I just checked it. I just started testing to make sure these work (I'm using this as a place to document what I'll be using and editing it as I go) and what I've found is the first test runs and the others do not.

We also have another problem. The game starts on the main menu. Which means if you run in batch mode with the graphics off... you're just hanging at the main menu XD

Spydrouge commented 9 years ago

Looks like the config file wasn't updated in a push; so it says UNITTEST_BLOCK when the unit test code is looking for UNITTEST_BATTERY. I'll see if it still works with UNITTEST_BATTERY or if I need a new build.

Nemquae commented 9 years ago

When you build the player, you need to make sure only the game scene is loaded. I'll look for the full command, 1 sec...

On Tue, Dec 9, 2014 at 12:47 PM, Spydrouge notifications@github.com wrote:

ROUTER_IP worked with a colon when I just checked it. I just started testing to make sure these work (I'm using this as a place to document what I'll be using and editing it as I go) and what I've found is the first test runs and the others do not.

We also have another problem. The game starts on the main menu. Which means if you run in batch mode with the graphics off... you're just hanging at the main menu XD

— Reply to this email directly or view it on GitHub https://github.com/opencog/unity3d-opencog-game/issues/61#issuecomment-66234360 .

Nemquae commented 9 years ago

"-batchmode", "test:internal_XGA", "quit", "UNITTEST_WORLD:true", "UNITTEST_EMBODIMENT:true", "UNITTEST_BLOCK:true", "UNITTEST_PLAN:true", "UNITTEST_SECONDPLAN:true"

On Tue, Dec 9, 2014 at 12:48 PM, Lake Watkins nemquae@gmail.com wrote:

When you build the player, you need to make sure only the game scene is loaded. I'll look for the full command, 1 sec...

On Tue, Dec 9, 2014 at 12:47 PM, Spydrouge notifications@github.com wrote:

ROUTER_IP worked with a colon when I just checked it. I just started testing to make sure these work (I'm using this as a place to document what I'll be using and editing it as I go) and what I've found is the first test runs and the others do not.

We also have another problem. The game starts on the main menu. Which means if you run in batch mode with the graphics off... you're just hanging at the main menu XD

— Reply to this email directly or view it on GitHub https://github.com/opencog/unity3d-opencog-game/issues/61#issuecomment-66234360 .

Spydrouge commented 9 years ago

@Nemquae I've altered the issue to reflect some of our new information.