/** * Process junit report */ public function testProcessJunitReport() { $this->setUpBaseTestrunResponse(); $testRunId = self::BASE_TEST_RUN_ID; $junitReport = new JUnitReport($this->getSimpleJUnitFixturePath()); $testRailReportA = new JUnitToTestRailRunTransformer($testRunId); $testRailSync = new TestRailSync(self::TESTRAIL_API_URL, $this->getHttpMethodsClient()); $testRailReport = $testRailReportA->transform($junitReport); $testRailSync->sync($testRailReport); $this->expectsAddResultRequest(); $testRailSync->pushResults($testRailReport); }
/** * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $this->initDependency(); $reportFilePath = $input->getArgument('report_file'); $reportType = $input->getOption('report_type'); $commentFormat = $input->getOption('comment_format'); $runId = $input->getArgument('run_id'); $testRailReport = null; if ($reportType === 'junit') { $report = new JunitReport($reportFilePath); $testRailReportA = new JUnitToTestRailRunTransformer($runId); $testRailReport = $testRailReportA->transform($report); } if (null !== $commentFormat) { $this->getTestrailSync()->setCommentFormat($commentFormat); } if (null !== $testRailReport) { $this->getTestrailSync()->sync($testRailReport); $this->getTestrailSync()->pushResults($testRailReport); } }