Skip to content

Commit

Permalink
make mstest deployment item work on linux?
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Jan 16, 2024
1 parent ff2762a commit aed504b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Build
run: dotnet build --no-restore
- name: xUnit Specs
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=xUnit&Category=Net60&Category!=requiresMsBuild" --logger "trx;LogFileName=specs-xunit-results.trx"
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=xUnit&Category=Net60&Category!=requiresMsBuild&Category=quarantaine" --logger "trx;LogFileName=specs-xunit-results.trx"
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Build
run: dotnet build --no-restore
- name: NUnit Specs
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=NUnit&Category=Net60&Category!=requiresMsBuild" --logger "trx;LogFileName=specs-nunit-results.trx"
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=NUnit&Category=Net60&Category!=requiresMsBuild&Category=quarantaine" --logger "trx;LogFileName=specs-nunit-results.trx"
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Build
run: dotnet build --no-restore
- name: MsTest Specs
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=MsTest&Category=Net60&Category!=requiresMsBuild" --logger "trx;LogFileName=specs-mstest-results.trx"
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=MsTest&Category=Net60&Category!=requiresMsBuild&Category=quarantaine" --logger "trx;LogFileName=specs-mstest-results.trx"
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Scenario: Should be able to deploy files
| Succeeded |
| 1 |

@quarantaine
@config
Scenario: Should be able to deploy files to specific folder
Given there is a Reqnroll project
Expand Down
17 changes: 17 additions & 0 deletions Tests/Reqnroll.Specs/StepDefinitions/ContentFileSteps.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.IO;
using Reqnroll.TestProjectGenerator.Driver;

namespace Reqnroll.Specs.StepDefinitions
Expand All @@ -12,9 +13,25 @@ public ContentFileSteps(ProjectsDriver projectsDriver)
_projectsDriver = projectsDriver;
}

internal static string NormalizeDirectorySeparators(string path)
{
if (path == null)
return null;

switch (Path.DirectorySeparatorChar)
{
case '\\':
return path.Replace('/', '\\');
case '/':
return path.Replace('\\', '/');
}
return path;
}

[Given("there is a content file '(.*)' in the project as")]
public void GivenThereIsAContentFileInTheProjectAs(string fileName, string fileContent)
{
fileName = NormalizeDirectorySeparators(fileName);
_projectsDriver.AddFile(fileName, fileContent, "Content");
}
}
Expand Down

0 comments on commit aed504b

Please sign in to comment.