Skip to content

Commit

Permalink
fix tests on linux and run them in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Oct 15, 2023
1 parent ff4d268 commit 7387dfe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ jobs:
path: |
_package
- name: Unit Tests
- name: Unit Tests (actions/runner)
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64'
run: |
${{ matrix.devScript }} test
working-directory: src

- name: Unit Tests (Sdk.Tests)
if: matrix.runtime != 'linux-arm64' && matrix.runtime != 'linux-arm' && matrix.runtime != 'osx-arm64'
run: |
dotnet test src/Sdk.Tests/Sdk.Tests.csproj
- name: Setup
if: 'false' # Disabled due to 403 of statuses api with this token and rate limit
Expand Down
2 changes: 1 addition & 1 deletion src/Sdk.Tests/AzurePipelines/TestData/TestGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static IEnumerable<TestWorkflow> ResolveWorkflows(string basePath, string
bool asPipeline = false;

// prioritize filtering pipeline*.yml files
var pipelines = files.Where(i => i.Contains("\\pipeline"));
var pipelines = files.Where(i => i.Contains($"{Path.DirectorySeparatorChar}pipeline"));
if (pipelines.Any())
{
asPipeline = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Sdk.Tests/AzurePipelines/Util/LocalFileProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public async Task<string> ReadFile(string repositoryAndRef, string path)
#region Helper methods for local repositories
public void AddRepo(string repositoryAndRef, string folderPath)
{
if (!folderPath.EndsWith(@"\"))
if (!folderPath.EndsWith(Path.DirectorySeparatorChar))
{
folderPath = $"{folderPath}\\";
folderPath = $"{folderPath}{Path.DirectorySeparatorChar}";
}
string repoName = repositoryAndRef.Split("@")[0];
repos[repoName] = folderPath;
Expand Down

0 comments on commit 7387dfe

Please sign in to comment.