Some improvements to the test suite

This commit is contained in:
nsubiron 2017-09-15 15:45:05 +02:00
parent 46b026eac9
commit 3b225abb79
3 changed files with 15 additions and 7 deletions

View File

@ -125,7 +125,7 @@ class TestCarlaClientBase(object):
if autopilot is None:
autopilot = random.choice([True, False])
reverse = random.choice([True, False])
reverse = (random.random() < 0.2)
logging.info('running episode with %d iterations', iterations)

View File

@ -10,15 +10,15 @@ class UseCase(test.CarlaServerTest):
with make_client(TestCarlaClientBase, self.args) as client:
for x in xrange(0, 5):
client.start_episode()
client.loop_on_agent_client(iterations=100)
client.loop_on_agent_client(iterations=200)
class SynchronousMode(test.CarlaServerTest):
def run(self):
with make_client(TestCarlaClientBase, self.args) as client:
for x in xrange(0, 5):
for x in xrange(0, 3):
client.start_episode(SynchronousMode=True)
client.loop_on_agent_client(iterations=100)
client.loop_on_agent_client(iterations=200)
class GetAgentsInfo(test.CarlaServerTest):
@ -30,4 +30,11 @@ class GetAgentsInfo(test.CarlaServerTest):
SendNonPlayerAgentsInfo=True,
NumberOfVehicles=60,
NumberOfPedestrians=90)
client.loop_on_agent_client(iterations=50)
client.loop_on_agent_client(iterations=100)
class LongEpisode(test.CarlaServerTest):
def run(self):
with make_client(TestCarlaClientBase, self.args) as client:
client.start_episode()
client.loop_on_agent_client(iterations=2000)

View File

@ -7,13 +7,13 @@
import argparse
import datetime
import time
import glob
import imp
import inspect
import logging
import os
import random
import time
from lib.carla_util import TestCarlaClientBase
@ -108,6 +108,7 @@ def run_test(test, args):
def do_the_tests(args):
tests = [t for t in iterate_tests()]
random.shuffle(tests)
succeeded = []
failed = []
log_test(SEP0, 'Running %d tests.', len(tests))