File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
src/Magento/FunctionalTestingFramework/StaticCheck Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ dev/tests/mftf.log
1919dev /tests /docs /*
2020dev /tests /_output
2121dev /tests /functional.suite.yml
22+ mftf-annotations-static-check.txt
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ public function execute(InputInterface $input)
7171
7272 foreach ($ allTests as $ test ) {
7373 $ this ->validateRequiredAnnotations ($ test );
74+ $ this ->validateSkipIssueId ($ test );
7475 $ this ->aggregateStoriesTitlePairs ($ test );
7576 $ this ->aggregateTestCaseIdTitlePairs ($ test );
7677 }
@@ -145,6 +146,25 @@ private function validateRequiredAnnotations($test)
145146 }
146147 }
147148
149+ /**
150+ * Validates that if the test is skipped, that it has an issueId value.
151+ *
152+ * @param TestObject $test
153+ * @return void
154+ */
155+ private function validateSkipIssueId ($ test )
156+ {
157+ $ annotations = $ test ->getAnnotations ();
158+
159+ $ skip = $ annotations ['skip ' ] ?? null ;
160+ if ($ skip !== null ) {
161+ $ issueId = $ skip [0 ] ?? null ;
162+ if ($ issueId === null || strlen ($ issueId ) == 0 ) {
163+ $ this ->errors [][] = "Test {$ test ->getName ()} is skipped but the issueId is empty. " ;
164+ }
165+ }
166+ }
167+
148168 /**
149169 * Add the key = "stories appended to title", value = test name, to the class variable.
150170 *
You can’t perform that action at this time.
0 commit comments