@@ -102,6 +102,36 @@ public IDiscovery AndDiscoveryProviderSucceed(IDiscoveryResultProvider discovery
102102 _discoveryResult = discoveryResultProvider . RunDiscovery ( _testAssemblySource . FilePath ,
103103 _projectSettings . ReqnrollConfigFilePath , _projectSettings ) ;
104104
105+ if ( _discoveryResult . LogMessages is { Length : > 0 } )
106+ {
107+ foreach ( var logMessage in _discoveryResult . LogMessages )
108+ {
109+ var lines = logMessage . Trim ( ) . Split ( new [ ] { '\n ' , '\r ' } , StringSplitOptions . RemoveEmptyEntries ) ;
110+ _logger . LogInfo ( lines [ 0 ] ) ;
111+ if ( lines . Length > 1 )
112+ {
113+ _logger . LogVerbose ( $ "Additional details:{ Environment . NewLine } { string . Join ( Environment . NewLine , lines . Skip ( 1 ) ) } ") ;
114+ }
115+ }
116+ }
117+
118+ if ( _discoveryResult . Warnings is { Length : > 0 } )
119+ {
120+ foreach ( string warning in _discoveryResult . Warnings )
121+ {
122+ _logger . LogWarning ( warning ) ;
123+ _errorListServices . AddErrors ( new [ ]
124+ {
125+ new DeveroomUserError
126+ {
127+ Category = DeveroomUserErrorCategory . Discovery ,
128+ Message = warning ,
129+ Type = TaskErrorCategory . Warning
130+ }
131+ } ) ;
132+ }
133+ }
134+
105135 if ( ! _discoveryResult . IsFailed )
106136 return this ;
107137
@@ -142,12 +172,32 @@ public IDiscovery ThenImportBindings(string projectName)
142172 _logger . LogInfo (
143173 $ "{ _stepDefinitions . Length } step definitions and { _hooks . Length } hooks discovered for project { projectName } ") ;
144174
175+ ReportGenericBindingErrors ( ) ;
145176 ReportInvalidStepDefinitions ( ) ;
146177 ReportInvalidHooks ( ) ;
147178
148179 return this ;
149180 }
150181
182+ private void ReportGenericBindingErrors ( )
183+ {
184+ if ( _discoveryResult . GenericBindingErrors == null || ! _discoveryResult . GenericBindingErrors . Any ( ) )
185+ return ;
186+
187+ _logger . LogWarning ( $ "Generic binding errors found: { Environment . NewLine } " +
188+ string . Join ( Environment . NewLine , _discoveryResult . GenericBindingErrors ) ) ;
189+
190+ _errorListServices . AddErrors (
191+ _discoveryResult . GenericBindingErrors
192+ . Select ( errorMessage => new DeveroomUserError
193+ {
194+ Category = DeveroomUserErrorCategory . Discovery ,
195+ Message = errorMessage ,
196+ Type = TaskErrorCategory . Error
197+ } )
198+ ) ;
199+ }
200+
151201 public ProjectBindingRegistry AndCreateBindingRegistry ( IMonitoringService monitoringService )
152202 {
153203 monitoringService . MonitorReqnrollDiscovery ( _discoveryResult . IsFailed , _discoveryResult . ErrorMessage ,
0 commit comments