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
19
19
dev /tests /docs /*
20
20
dev /tests /_output
21
21
dev /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)
71
71
72
72
foreach ($ allTests as $ test ) {
73
73
$ this ->validateRequiredAnnotations ($ test );
74
+ $ this ->validateSkipIssueId ($ test );
74
75
$ this ->aggregateStoriesTitlePairs ($ test );
75
76
$ this ->aggregateTestCaseIdTitlePairs ($ test );
76
77
}
@@ -145,6 +146,25 @@ private function validateRequiredAnnotations($test)
145
146
}
146
147
}
147
148
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
+
148
168
/**
149
169
* Add the key = "stories appended to title", value = test name, to the class variable.
150
170
*
You can’t perform that action at this time.
0 commit comments