File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,25 @@ static async Task<Guard<DirectoryInfo>> EnsureSampleResults(
9696 CancellationToken ct
9797 ) =>
9898 sample . IsAssertionOnly
99- ? new DirectoryInfo ( sample . DefaultResultsPath )
99+ ? EnsureExistingAllureResultsDirectory ( sample )
100100 : await ProduceSampleResults ( sample , input , ct ) ;
101101
102+ static DirectoryInfo EnsureExistingAllureResultsDirectory ( AllureSampleRegistryEntry sample )
103+ {
104+ var path = sample . DefaultResultsPath ;
105+ var dInfo = new DirectoryInfo ( path ) ;
106+ if ( ! dInfo . Exists || ! dInfo . EnumerateFiles ( ) . Any ( ) )
107+ {
108+ throw new FileNotFoundException (
109+ $ "Can't read Allure results of the '{ sample . Id } ' sample. Please, make sure "
110+ + $ "the sample's been run and the results are available at '{ path } '. "
111+ + "You can use the 'dotnet msbuild -t:Allure_RunTestSamples' command "
112+ + "to run all samples of the solution/project."
113+ ) ;
114+ }
115+ return dInfo ;
116+ }
117+
102118 static async Task < Guard < DirectoryInfo > > ProduceSampleResults (
103119 AllureSampleRegistryEntry sample ,
104120 AllureSampleRunInput input ,
You can’t perform that action at this time.
0 commit comments