File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed
src/Magento/FunctionalTestingFramework Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,20 @@ protected function configure()
47
47
protected function execute (InputInterface $ input , OutputInterface $ output )
48
48
{
49
49
$ staticCheckObjects = $ this ->staticChecksList ->getStaticChecks ();
50
+
51
+ $ errors = [];
52
+
50
53
foreach ($ staticCheckObjects as $ staticCheck ) {
51
54
$ staticOutput = $ staticCheck ->execute ($ input );
52
55
LoggingUtil::getInstance ()->getLogger (get_class ($ staticCheck ))->info ($ staticOutput );
53
56
$ output ->writeln ($ staticOutput );
57
+ $ errors += $ staticCheck ->getErrors ();
58
+ }
59
+
60
+ if (empty ($ errors )) {
61
+ return 0 ;
62
+ } else {
63
+ return 1 ;
54
64
}
55
65
}
56
66
}
Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ interface StaticCheckInterface
19
19
* @return string
20
20
*/
21
21
public function execute (InputInterface $ input );
22
+
23
+ /**
24
+ * Return array containing all errors found after running the execute() function.
25
+ * @return array
26
+ */
27
+ public function getErrors ();
22
28
}
Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ class TestDependencyCheck implements StaticCheckInterface
62
62
*/
63
63
private $ alreadyExtractedDependencies ;
64
64
65
+ /**
66
+ * Array containing all errors found after running the execute() function.
67
+ * @var array
68
+ */
69
+ private $ errors ;
70
+
65
71
/**
66
72
* Checks test dependencies, determined by references in tests versus the dependencies listed in the Magento module
67
73
*
@@ -98,13 +104,22 @@ public function execute(InputInterface $input)
98
104
$ actionGroupXmlFiles = $ this ->buildFileList ($ allModules , $ filePaths [1 ]);
99
105
$ dataXmlFiles = $ this ->buildFileList ($ allModules , $ filePaths [2 ]);
100
106
101
- $ testErrors = [];
102
- $ testErrors += $ this ->findErrorsInFileSet ($ testXmlFiles );
103
- $ testErrors += $ this ->findErrorsInFileSet ($ actionGroupXmlFiles );
104
- $ testErrors += $ this ->findErrorsInFileSet ($ dataXmlFiles );
107
+ $ this -> errors = [];
108
+ $ this -> errors += $ this ->findErrorsInFileSet ($ testXmlFiles );
109
+ $ this -> errors += $ this ->findErrorsInFileSet ($ actionGroupXmlFiles );
110
+ $ this -> errors += $ this ->findErrorsInFileSet ($ dataXmlFiles );
105
111
106
112
//print all errors to file
107
- return $ this ->printErrorsToFile ($ testErrors );
113
+ return $ this ->printErrorsToFile ($ this ->getErrors ());
114
+ }
115
+
116
+ /**
117
+ * Return array containing all errors found after running the execute() function.
118
+ * @return array
119
+ */
120
+ public function getErrors ()
121
+ {
122
+ return $ this ->errors ;
108
123
}
109
124
110
125
/**
You can’t perform that action at this time.
0 commit comments