diff --git a/src/Magento/FunctionalTestingFramework/StaticCheck/AnnotationsCheck.php b/src/Magento/FunctionalTestingFramework/StaticCheck/AnnotationsCheck.php index 86cbec2db..6d415b52d 100644 --- a/src/Magento/FunctionalTestingFramework/StaticCheck/AnnotationsCheck.php +++ b/src/Magento/FunctionalTestingFramework/StaticCheck/AnnotationsCheck.php @@ -70,8 +70,11 @@ public function execute(InputInterface $input) $allTests = TestObjectHandler::getInstance(false)->getAllObjects(); foreach ($allTests as $test) { + if ($this->validateSkipIssueId($test)) { + //if test is skipped ignore other checks + continue; + } $this->validateRequiredAnnotations($test); - $this->validateSkipIssueId($test); $this->aggregateStoriesTitlePairs($test); $this->aggregateTestCaseIdTitlePairs($test); } @@ -150,19 +153,22 @@ private function validateRequiredAnnotations($test) * Validates that if the test is skipped, that it has an issueId value. * * @param TestObject $test - * @return void + * @return boolean */ private function validateSkipIssueId($test) { + $validateSkipped = false; $annotations = $test->getAnnotations(); $skip = $annotations['skip'] ?? null; if ($skip !== null) { - $issueId = $skip[0] ?? null; - if ($issueId === null || strlen($issueId) == 0) { + $validateSkipped = true; + if ((!isset($skip[0]) || strlen($skip[0]) == 0) + && (!isset($skip['issueId']) || strlen($skip['issueId']) == 0)) { $this->errors[][] = "Test {$test->getName()} is skipped but the issueId is empty."; } } + return $validateSkipped; } /**