def setUp(self): self.testutils = TestUtils() self.root = settings.PROJECT_DIR self.failed = Build.from_file(self.testutils.write_to_temp('FAILED_LOG.xml', BuildBreakerTests.FAILED_LOG_AT_OCT_11)) self.did_not_fix = Build.from_file(self.testutils.write_to_temp('PASSED_LOG_AT_OCT_11.xml', BuildBreakerTests.DID_NOT_FIX_IT_LOG)) self.fixed_it = Build.from_file(self.testutils.write_to_temp('ANOTHER_PASSED_LOG_AT_OCT_11.xml', BuildBreakerTests.FIXED_IT_LOG)) self.another_pass = Build.from_file(self.testutils.write_to_temp('FAILED_LOG_AT_OCT_11.xml', BuildBreakerTests.ANOTHER_PASS))
def setUp(self): self.testutils = TestUtils() self.root = settings.PROJECT_DIR self.failed = Build.from_file(self.testutils.write_to_temp('FAILED_LOG.xml', BuildsTest.FAILED_LOG)) self.passed_at_oct_11 = Build.from_file(self.testutils.write_to_temp('PASSED_LOG_AT_OCT_11.xml', BuildsTest.PASSED_LOG_AT_OCT_11)) self.another_passed_at_oct_11 = Build.from_file(self.testutils.write_to_temp('ANOTHER_PASSED_LOG_AT_OCT_11.xml', BuildsTest.ANOTHER_PASSED_LOG_AT_OCT_11)) self.failed_at_oct_11 = Build.from_file(self.testutils.write_to_temp('FAILED_LOG_AT_OCT_11.xml', BuildsTest.FAILED_LOG_AT_OCT_11))
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 show(request): configs = Configs() if (configs.is_empty()) : return render_to_response('analyse/hint.html', Context({}), context_instance = RequestContext(request)) project_id = request.GET['id'] config = configs.find(project_id) if not config.has_result() : return redirect('setup.html?id=' + urlquote(project_id)) over_all_result = { "project_id" : project_id, } Build.view_all(project_id, over_all_result) return render_to_response('analyse/show.html', Context(over_all_result), context_instance = RequestContext(request))
def testToSelectValuesAsArrayByApplyingXPath(self): file = self.ccroot + '/log20091011173922Lbuild.1.xml' config = Configs().find('connectfour4') values = Build.select_values(file, config.csv_settings()) self.assertEquals('connectfour4', values[0]) self.assertEquals('1 minute(s) 0 second(s)', values[2]) self.assertEquals('build.1', values[1]) self.assertEquals(None, values[3])
def testGenerateTotalBuilds(self): Builds.create_builds(TestUtils().connectfour_config(), None, BuildTotalPassPercentageTest.PATTERN); self.assertEqual(2, Build.total('connectfour4'));
def testToParseTheFailedLogForBuildDate(self): expecteddate = datetime(2009, 10, 11, 17, 39, 22); build = Build.from_file(self.ccroot + '/log20091011173922Lbuild.1.xml') self.assertEqual(expecteddate, build.start_time)
def testToParseTheFailedLogForBuildDate(self): expecteddate = datetime(2009, 10, 11, 20, 11, 49); build = Build.from_file(self.ccroot + '/log20091013220324.xml') self.assertEqual(expecteddate, build.last_pass)
def testToParseThePassPassedLogForResult(self): build = Build.from_file(self.ccroot + '/log20091011173922Lbuild.1.xml') self.assertEqual(True, build.is_passed)
def testToParseThePassFailedLogForResult(self): build = Build.from_file(self.ccroot + '/log20091013220324.xml') self.assertEqual(False, build.is_passed)
def testToParseTheFailedLogForBuildNumber(self): build = Build.from_file(self.ccroot + '/log20091013220324.xml') self.assertEqual("build.18", build.number)
def testToParseThePassLogForBuildNumber(self): build = Build.from_file(self.ccroot + '/log20091011173922Lbuild.1.xml') self.assertEqual("build.1", build.number)
def testToParseTheProjectName(self): build = Build.from_file(self.ccroot + '/log20091011173922Lbuild.1.xml') self.assertEqual("connectfour4", build.name)