<< Back to Programming Forum   Search

Posts 1 - 7 of 7   
Dumb question about testing.: 8/7/2013 01:25:26


Frankdeslimste • apex 
Level 58
Report
I want to try my hand with CLOT, but I can't seem to figure out how to test the code. I'm using Google App Engine Launcher like advised on the wiki. I've changed the debug field to true, but when I press browse on GAE I get the website and that's it. How do I get it to create (test)games to see if the changes I made work?

I was able to put some fake players in the database by using the SDK console, but using the SDK console to create games doesn't work. It returns "The kind Game doesn't exist in the <Empty> namespace".
Dumb question about testing.: 8/7/2013 01:38:09

Fizzer 
Level 64

Warzone Creator
Report
There's two ways of testing. One is to use the TestMode = True system. In TestMode, the app won't hit warlight.net APIs at all, and instead when the code tries to call an API, it will return fake data. This is useful while building your app since you can easily simulate players signing up and see how games get created with them. You can do things like simulate 500 players signing up to your tournament, which would be very time consuming to do without test mode.

The other way is to set TestMode to false, and create real games. When you test this way, you'll likely need to involve actual people from WarLight to help you (or create a bunch of test WarLight accounts, but that's time-consuming.)

I recommend you use TestMode when starting out, and graduate to real-site testing once everything looks good in TestMode.

Here's an overview of how to use test mode:

If you look in api.py, there's a line that says TestMode = False. By changing this to True, you'll enable test mode which allows you to test your app offline using fake data.

After enabling TestMode and adding a LOT object (which you've probably already done), you can get to the test page by hitting /test/<lotid> (just go to the lot page and change the word "lot" to "test" in the url)

Then you'll see the ladder or tournament along with some test buttons. Click "Add Players" to add 16 players, and then click the "Run Cron" a bunch of times to watch games play out. With a ladder you'll see the games list grow and the ranks change accordingly. If you made a tournament you'd see the bracket fill out here as games complete.

Now you can make changes to the cron script and re-test to see how they affected the code.
Dumb question about testing.: 8/7/2013 20:44:49


Frankdeslimste • apex 
Level 58
Report
I haven't added a LOT object yet, and I'm not quite sure what it entails. I should probably change the thread title to dumb questions.

When I am using the SDK console I can choose between 5 enitity kinds; ClotConfig, Game, GamePlayer, Player and _AhAdminXsrfToken_. I've added a ClotConfig in the datastore, but using it's id doesn't get me to a test page but an error page. (http://postimg.org/image/m3r0m373t/)

Using /test I do get to a testing page though, but it says:
"This page is just for testing. Nothing in the app redirects here.

foo"
Dumb question about testing.: 8/8/2013 00:47:07

Fizzer 
Level 64

Warzone Creator
Report
Sounds like you're looking at old code. Do you have the latest from github?
Dumb question about testing.: 8/8/2013 01:48:16


Frankdeslimste • apex 
Level 58
Report
I downloaded it from here: https://github.com/FizzerWL/CLOT as linked on your July 26th blog post.
Dumb question about testing.: 8/8/2013 02:03:47


Frankdeslimste • apex 
Level 58
Report
I downloaded it again and I'm pretty sure I have a newer version now, I'll go mess around with it and probably ask some more (dumb) questions in the near future.

Thanks for helping BTW.
Dumb question about testing.: 8/8/2013 19:52:43


ChrisCMU 
Level 61
Report
I get an error when trying to join my own CLOT:

http://s10.postimg.org/6ym1hr44p/Error.png
Posts 1 - 7 of 7