def generate(request) : configs = Configs() if (configs.is_empty()) : return render_to_response('analyse/hint.html', Context({}), context_instance = RequestContext(request)) config = configs.find(request.POST['id']) over_all_result = {} Builds.create_builds(config, None, config.builds()) Build.analyse_all(config.id, over_all_result) Builds.create_csv(config.id) return redirect('index.html')
def testGenerateTotalPassRate(self): builds = Builds.create_builds(TestUtils().connectfour_config(), None,SuccessfulRateChartTests.PATTERN); ndaysStat = TopNStatistics('connectfour4', builds) json_str = ndaysStat.successful_rate() json_obj = cjson.decode(json_str) self.assertEqual(2, len(json_obj['elements'][0]['values']));
def testGenerateTotalBuilds(self): Builds.create_builds(TestUtils().connectfour_config(), None, BuildTotalPassPercentageTest.PATTERN); self.assertEqual(2, Build.total('connectfour4'));
def testShouldOnlyParseThe5Builds(self) : configs = Configs() builds = Builds.create_builds(TestUtils().cclive_config(), None,2) self.assertEquals(2, len(builds)) self.assertEquals(datetime(2008, 9, 24, 5, 25, 6), builds[0].start_time) self.assertEquals(datetime(2008, 9, 24, 6, 29, 41), builds[1].start_time)
def testShouldNotThrowExceptionWhenProcessingXmlFile(self): try: builds = Builds.create_builds(TestUtils().cclive_config(), "log20080624064201Lbuild.70.xml", 2) except Exception, e: self.fail('should not throw any exception at all')
def testShouldParseAndPersit(self): self.assertEqual(0, len(Build.objects.all())) builds = Builds.create_builds(TestUtils().connectfour_config(), BuildFactoryTest.PATTERN, 2); self.assertEqual(2, len(Build.objects.all()))
def testToParseTheInformationCorrectly(self): builds = Builds.create_builds(TestUtils().connectfour_config(), BuildFactoryTest.PATTERN, 2); self.assertEqual('connectfour4', builds[0].name)
def testToParseAllTheLogs(self): self.assertEqual(2, len(Builds.create_builds(TestUtils().connectfour_config(), BuildFactoryTest.PATTERN, 2)))