def setUp(self): AwsyTestCase.setUp(self) self.logger.info("setting up") self._webroot_dir = self.testvars["webRootDir"] self._urls = [] urls = None default_tp5n_manifest = os.path.join(self._webroot_dir, 'page_load_test', 'tp5n', 'tp5n.manifest') tp5n_manifest = self.testvars.get("pageManifest", default_tp5n_manifest) with open(tp5n_manifest) as fp: urls = fp.readlines() urls = map(lambda x:x.replace('localhost', 'localhost:{}'), urls) # We haven't set self._urls yet, so this value might be zero if # 'entities' wasn't specified. to_load = self.pages_to_load() if not to_load: to_load = len(urls) self._webservers = webservers.WebServers("localhost", 8001, self._webroot_dir, to_load) self._webservers.start() for url, server in zip(urls, self._webservers.servers): self._urls.append(url.strip().format(server.port)) self.logger.info("areweslimyet run by %d pages, %d iterations, %d perTabPause, %d settleWaitTime" % (self._pages_to_load, self._iterations, self._perTabPause, self._settleWaitTime)) self.logger.info("done setting up!")
def setUp(self): MarionetteTestCase.setUp(self) self.logger = mozlog.structured.structuredlog.get_default_logger() self.logger.info("setting up!") self.marionette.set_context('chrome') self._webroot_dir = self.testvars["webRootDir"] self._resultsDir = self.testvars["resultsDir"] # Be conservative in what we delete automatically. for f in glob.glob( os.path.join(self._resultsDir, 'memory-report-*.json.gz')): os.unlink(f) for f in glob.glob( os.path.join(self._resultsDir, 'perfherder_data.json')): os.unlink(f) for f in glob.glob(os.path.join(self._resultsDir, 'dmd-*.json.gz')): os.unlink(f) self._urls = [] urls = None default_tp5n_manifest = os.path.join(self._webroot_dir, 'page_load_test', 'tp5n', 'tp5n.manifest') tp5n_manifest = self.testvars.get("pageManifest", default_tp5n_manifest) with open(tp5n_manifest) as fp: urls = fp.readlines() urls = map(lambda x: x.replace('localhost', 'localhost:{}'), urls) # Optional testvars. self._pages_to_load = self.testvars.get("entities", len(urls)) self._iterations = self.testvars.get("iterations", ITERATIONS) self._perTabPause = self.testvars.get("perTabPause", PER_TAB_PAUSE) self._settleWaitTime = self.testvars.get("settleWaitTime", SETTLE_WAIT_TIME) self._maxTabs = self.testvars.get("maxTabs", MAX_TABS) self._dmd = self.testvars.get("dmd", False) self._webservers = webservers.WebServers("localhost", 8001, self._webroot_dir, self._pages_to_load) self._webservers.start() for url, server in zip(urls, self._webservers.servers): self._urls.append(url.strip().format(server.port)) self.logger.info( "areweslimyet run by %d pages, %d iterations, %d perTabPause, %d settleWaitTime" % (self._pages_to_load, self._iterations, self._perTabPause, self._settleWaitTime)) self.reset_state() self.logger.info("done setting up!")
def setUp(self): MarionetteTestCase.setUp(self) self.logger = mozlog.structured.structuredlog.get_default_logger() self.logger.info("setting up!") self.marionette.set_context('chrome') self._webroot_dir = os.path.join(os.getcwd(), 'page_load_test') if not os.path.exists(self._webroot_dir): os.mkdir(self._webroot_dir) self._webservers = webservers.WebServers("localhost", 8001, os.getcwd(), 100) self._webservers.start() test_sites = [] with open(os.path.join(self._webroot_dir, 'tp5n', 'tp5n.manifest')) as fp: urls = fp.readlines() if urls: urls = map(lambda x: x.replace('localhost', 'localhost:{}'), urls) self._urls = urls else: urls = TEST_SITES_TEMPLATES for url, server in zip(urls, self._webservers.servers): test_sites.append(url.format(server.port)) self._urls = self.testvars.get("urls", test_sites) self._pages_to_load = self.testvars.get("entities", len(self._urls)) self._iterations = self.testvars.get("iterations", ITERATIONS) self._perTabPause = self.testvars.get("perTabPause", PER_TAB_PAUSE) self._settleWaitTime = self.testvars.get("settleWaitTime", SETTLE_WAIT_TIME) self._maxTabs = self.testvars.get("maxTabs", MAX_TABS) self._resultsDir = os.path.join(os.getcwd(), "tests", "results") self.logger.info( "areweslimyet run by %d pages, %d iterations, %d perTabPause,%d settleWaitTime" % (self._pages_to_load, self._iterations, self._perTabPause, self._settleWaitTime)) self.reset_state() self.logger.info("done setting up!")
def setupTp5(self): urls = None default_tp5n_manifest = os.path.join(self._webroot_dir, 'page_load_test', 'tp5n', 'tp5n.manifest') tp5n_manifest = self.testvars.get("pageManifest", default_tp5n_manifest) with open(tp5n_manifest) as fp: urls = fp.readlines() urls = map(lambda x: x.replace('localhost', 'localhost:{}'), urls) # We haven't set self._urls yet, so this value might be zero if # 'entities' wasn't specified. to_load = self.pages_to_load() if not to_load: to_load = len(urls) self._webservers = webservers.WebServers("localhost", 8001, self._webroot_dir, to_load) self._webservers.start() for url, server in zip(urls, self._webservers.servers): self._urls.append(url.strip().format(server.port))