Skip to content

Commit

Permalink
Another try
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCS committed May 28, 2024
1 parent d41e0ce commit 41ce08f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
run: dotnet test --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" --results-directory "TestResults"
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
if: success() || failure()
with:
name: NUnit Tests # Name of the check run which will be created
path: TestResults/test-results.trx # Path to test results
reporter: dotnet-trx # Format of test results
name: Tests Report
path: TestResults/test-results.trx
reporter: dotnet-trx
- name: Copy generated nuget file
run: find . -name "SystemTestingTools*.nupkg" -exec cp "{}" ./ \;
- name: Set nuget package artifact
Expand Down
9 changes: 8 additions & 1 deletion Tool/SystemTestingTools/ValueObjects/FileFullPath.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using static SystemTestingTools.Helper;
using static SystemTestingTools.Internal.Enums;

Expand All @@ -17,7 +18,13 @@ public class FileFullPath : StringValueObject
public FileFullPath(string value) : base(value)
{
if (!Path.HasExtension(_value)) _value += ".txt";
if (!File.Exists(_value)) throw new ArgumentException($"Could not find file '{_value}'");
var folder = Path.GetDirectoryName(_value);
if (!Directory.Exists(folder)) throw new ArgumentException($"Could not find folder '{folder}'");
if (!File.Exists(_value))

Check failure on line 23 in Tool/SystemTestingTools/ValueObjects/FileFullPath.cs

View workflow job for this annotation

GitHub Actions / Tests Report

IsolatedTests.ComponentTestings.MathHappyTests ► When_CallingManyWcfMethods_Then_CanPerformMath_Successfully

Failed test found in: TestResults/test-results.trx Error: System.ArgumentException : Could not find folder '/home/runner/work/SystemTestingTools/SystemTestingTools/Examples/MovieProject/MovieProject.Tests/MovieProject.IsolatedTests/ComponentTesting/Stubs/MathWcf/Real_Responses/Happy'
Raw output
System.ArgumentException : Could not find folder '/home/runner/work/SystemTestingTools/SystemTestingTools/Examples/MovieProject/MovieProject.Tests/MovieProject.IsolatedTests/ComponentTesting/Stubs/MathWcf/Real_Responses/Happy'
   at SystemTestingTools.FileFullPath..ctor(String value) in /home/runner/work/SystemTestingTools/SystemTestingTools/Tool/SystemTestingTools/ValueObjects/FileFullPath.cs:line 23
   at SystemTestingTools.FileFullPath.op_Implicit(String value) in /home/runner/work/SystemTestingTools/SystemTestingTools/Tool/SystemTestingTools/ValueObjects/FileFullPath.cs:line 47
   at IsolatedTests.ComponentTestings.MathHappyTests.When_CallingManyWcfMethods_Then_CanPerformMath_Successfully() in /home/runner/work/SystemTestingTools/SystemTestingTools/Examples/MovieProject/MovieProject.Tests/MovieProject.IsolatedTests/ComponentTesting/MathHappyTests.cs:line 33
--- End of stack trace from previous location where exception was thrown ---
{
var filesCount = Directory.GetFiles(folder).Length;
throw new ArgumentException($"Could not find file '{_value}', but there are {filesCount} other files in the folder {folder}");
}
}

public string ReadContent()
Expand Down

0 comments on commit 41ce08f

Please sign in to comment.