Exemple #1
0
  def testSetGetDataAnalyzeReport( self,
      testSetType,
      testSetDescr, testSetAcro, testSetTotalSize, testSetLOD,
      testSetNonzeroSizeTriggerGlobalFail=True,
      colorTestSet=None,     # Change to one of the supported colors
      sortTests=True,
      limitTableRows=None,   # Change to 'int' > 0 to limit to this this
      getTestHistory=False,
    ):
  
    print("")
  
    testSetSummaryStr =  CDQAR.getCDashDataSummaryHtmlTableTitleStr(testSetDescr,
      testSetAcro, testSetTotalSize)
  
    print(testSetSummaryStr)
  
    if testSetTotalSize > 0:
  
      self.overallVars.globalPass = False
  
      self.overallVars.summaryLineDataNumbersList.append(
        testSetAcro+"="+str(testSetTotalSize))
  
      self.overallVars.htmlEmailBodyTop += \
        CDQAR.colorHtmlText(testSetSummaryStr, colorTestSet)+"<br>\n"
  
      if sortTests or limitTableRows:
        testSetSortedLimitedLOD = CDQAR.sortAndLimitListOfDicts(
          testSetLOD, self.testsSortOrder,
          limitTableRows )
      else:
        testSetSortedLimitedLOD = testSetLOD

      sio = self.inOptions
  
      if getTestHistory:

        CDQAR.foreachTransform(
          testSetSortedLimitedLOD,
          CDQAR.AddTestHistoryToTestDictFunctor(
            cdashUrl=sio.cdashSiteUrl,
            projectName=sio.cdashProjectName,
            date=sio.date,
            testingDayStartTimeUtc=sio.cdashProjectTestingDayStartTime,
            daysOfHistory=sio.testHistoryDays,
            testCacheDir=self.testHistoryCacheDir,
            useCachedCDashData=sio.useCachedCDashData,
            alwaysUseCacheFileIfExists=True,
            verbose=True,
            printDetails=sio.printDetails,
            requireMatchTestTopTestHistory=sio.requireTestHistoryMatchNonpassingTests,
            )
          )
  
      self.overallVars.htmlEmailBodyBottom += CDQAR.createCDashTestHtmlTableStr(
        testSetType,
        testSetDescr, testSetAcro, testSetTotalSize, testSetSortedLimitedLOD,
        sio.testHistoryDays, limitRowsToDisplay=limitTableRows,
        testSetColor=colorTestSet )
  def testSetGetDataAnalyzeReport( self,
      testSetType,
      testSetDescr, testSetAcro, testSetTotalSize, testSetLOD,
      testSetNonzeroSizeTriggerGlobalFail=True,
      colorTestSet=None,     # Change to one of the supported colors
      sortTests=True,
      limitTableRows=None,   # Change to 'int' > 0 to limit to this this
      getTestHistory=False,
    ):
  
    print("")
  
    testSetSummaryStr =  CDQAR.getCDashDataSummaryHtmlTableTitleStr(testSetDescr,
      testSetAcro, testSetTotalSize)
  
    print(testSetSummaryStr)
  
    if testSetTotalSize > 0:
  
      self.overallVars.globalPass = False
  
      self.overallVars.summaryLineDataNumbersList.append(
        testSetAcro+"="+str(testSetTotalSize))
  
      self.overallVars.htmlEmailBodyTop += \
        CDQAR.colorHtmlText(testSetSummaryStr, colorTestSet)+"<br>\n"
  
      if sortTests or limitTableRows:
        testSetSortedLimitedLOD = CDQAR.sortAndLimitListOfDicts(
          testSetLOD, self.testsSortOrder,
          limitTableRows )
      else:
        testSetSortedLimitedLOD = testSetLOD
  
      if getTestHistory:

        CDQAR.foreachTransform(
          testSetSortedLimitedLOD,
          CDQAR.AddTestHistoryToTestDictFunctor(
            self.inOptions.cdashSiteUrl,
            self.inOptions.cdashProjectName,
            self.inOptions.date,
            self.inOptions.testHistoryDays,
            self.testHistoryCacheDir,
            useCachedCDashData=self.inOptions.useCachedCDashData,
            alwaysUseCacheFileIfExists=True,
            verbose=True,
            printDetails=self.inOptions.printDetails,
            )
          )
  
      self.overallVars.htmlEmailBodyBottom += CDQAR.createCDashTestHtmlTableStr(
        testSetType,
        testSetDescr, testSetAcro, testSetTotalSize, testSetSortedLimitedLOD,
        self.inOptions.testHistoryDays, limitRowsToDisplay=limitTableRows,
        testSetColor=colorTestSet )
        bmNum = len(missingExpectedBuildsLOD)

        bmSummaryStr = \
          CDQAR.getCDashDataSummaryHtmlTableTitleStr(bmDescr,  bmAcro, bmNum)

        print(bmSummaryStr)

        if bmNum > 0:

            overallVars.globalPass = False

            overallVars.summaryLineDataNumbersList.append(bmAcro + "=" +
                                                          str(bmNum))

            overallVars.htmlEmailBodyTop += \
              CDQAR.colorHtmlText(bmSummaryStr,CDQAR.cdashColorFailed())+"<br>\n"

            bmColDataList = [
                tcd("Group", 'group'),
                tcd("Site", 'site'),
                tcd("Build Name", 'buildname'),
                tcd("Missing Status", 'status'),
            ]

            overallVars.htmlEmailBodyBottom += CDQAR.createCDashDataSummaryHtmlTableStr(
                bmDescr, bmAcro, bmColDataList, missingExpectedBuildsLOD,
                groupSiteBuildNameSortOrder, None)
            # NOTE: Above we don't want to limit any missing builds in this table
            # because that data is not shown on CDash and that list will never be
            # super big.
    bmDescr = "Builds Missing"
    bmAcro = "bm"
    bmNum = len(missingExpectedBuildsLOD)

    bmSummaryStr = \
      CDQAR.getCDashDataSummaryHtmlTableTitleStr(bmDescr,  bmAcro, bmNum)

    print(bmSummaryStr)

    if bmNum > 0:

      overallVars.globalPass = False

      overallVars.summaryLineDataNumbersList.append(bmAcro+"="+str(bmNum))

      overallVars.htmlEmailBodyTop += CDQAR.colorHtmlText(bmSummaryStr,CDQAR.cdashColorFailed())+"<br>\n"

      bmColDataList = [
        tcd("Group", 'group'),
        tcd("Site", 'site'),
        tcd("Build Name", 'buildname'),
        tcd("Missing Status", 'status'),
        ]

      overallVars.htmlEmailBodyBottom += CDQAR.createCDashDataSummaryHtmlTableStr(
         bmDescr,  bmAcro, bmColDataList, missingExpectedBuildsLOD,
        groupSiteBuildNameSortOrder, None )
      # NOTE: Above we don't want to limit any missing builds in this table
      # because that data is not shown on CDash and that list will never be
      # super big.
    bmDescr = "Builds Missing"
    bmAcro = "bm"
    bmNum = len(missingExpectedBuildsLOD)

    bmSummaryStr = \
      CDQAR.getCDashDataSummaryHtmlTableTitleStr(bmDescr,  bmAcro, bmNum)

    print(bmSummaryStr)

    if bmNum > 0:

      overallVars.globalPass = False

      overallVars.summaryLineDataNumbersList.append(bmAcro+"="+str(bmNum))

      overallVars.htmlEmailBodyTop += CDQAR.colorHtmlText(bmSummaryStr,CDQAR.cdashColorFailed())+"<br>\n"

      bmColDataList = [
        tcd("Group", 'group'),
        tcd("Site", 'site'),
        tcd("Build Name", 'buildname'),
        tcd("Missing Status", 'status'),
        ]

      overallVars.htmlEmailBodyBottom += CDQAR.createCDashDataSummaryHtmlTableStr(
         bmDescr,  bmAcro, bmColDataList, missingExpectedBuildsLOD,
        groupSiteBuildNameSortOrder, None )
      # NOTE: Above we don't want to limit any missing builds in this table
      # because that data is not shown on CDash and that list will never be
      # super big.