Exemple #1
0
    def check(self):
        for line in self._tailer.get_lines():
            if "Adding worker" in line:
                marker = "results="
                pos = line.index(marker)
                fname = line[pos + len(marker):].strip()
                self.log.debug("Adding result reader for %s", fname)
                if not self.engine.is_functional_mode():
                    reader = JTLReader(fname, self.log)
                    if isinstance(self.engine.aggregator, ConsolidatingAggregator):
                        self.engine.aggregator.add_underling(reader)
                else:
                    reader = FuncSamplesReader(self.report_file, self.engine, self.log)
                    if isinstance(self.engine.aggregator, FunctionalAggregator):
                        self.engine.aggregator.add_underling(reader)
                self._readers.append(reader)

        return super(ApiritifNoseExecutor, self).check()
Exemple #2
0
    def test_functional_report(self):
        engine = EngineEmul()
        aggregator = FunctionalAggregator()
        aggregator.engine = engine
        engine.aggregator = aggregator

        obj = JUnitXMLReporter()
        obj.engine = engine
        obj.parameters = BetterDict()

        reader = FuncSamplesReader(RESOURCES_DIR + "functional/nose.ldjson", engine, ROOT_LOGGER)
        aggregator.add_underling(reader)

        aggregator.prepare()
        obj.prepare()
        aggregator.post_process()
        obj.post_process()

        self.assertFilesEqual(obj.report_file_path, RESOURCES_DIR + "functional/xunit-report.xml")
Exemple #3
0
    def test_functional_report(self):
        engine = EngineEmul()
        aggregator = FunctionalAggregator()
        aggregator.engine = engine
        engine.aggregator = aggregator

        obj = JUnitXMLReporter()
        obj.engine = engine
        obj.parameters = BetterDict()

        reader = FuncSamplesReader(
            __dir__() + "/../resources/functional/nose.ldjson", engine,
            logging.getLogger())
        aggregator.add_underling(reader)

        aggregator.prepare()
        obj.prepare()
        aggregator.post_process()
        obj.post_process()

        self.assertFilesEqual(
            obj.report_file_path,
            __dir__() + "/../resources/functional/xunit-report.xml")
Exemple #4
0
 def register_file(self, report_filename):
     self.filenames.append(report_filename)
     reader = FuncSamplesReader(report_filename, self.engine, self.log)
     self.readers.append(reader)