Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0 -- --update-allow-list

- name: Test
run: dotnet test --configuration Release --logger GitHubActions
Expand All @@ -39,7 +39,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release -- --update-allow-list
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0 -- --update-allow-list

- name: Test
run: dotnet test --configuration Release --framework net6.0 --logger GitHubActions
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0

- name: Test
run: dotnet test --configuration Release --framework net6.0 --logger GitHubActions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0

- name: Test
run: dotnet test --configuration Release --logger GitHubActions
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You agree this file is not required, or am I missing something?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even more than when the next OS image is updated and doesn't have this one it would break.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well you are missing the fact that the solution does not require NET 8 SDK because nothing targets net8.0 yet. This will lead to the fact that depending the SDK you have (say 6 or 8) you will get different output folders (UseArtifactsOutput) and the tests will break.

So when the targets will be updated to net8.0 it will implicitly require the SDK and this file can be removed. But I discovered that there's regex changes that break the tests when run under net8.0 so requires some work.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is to enfore that 8.0 sdk is used because of UseArtifactsOutput, ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for the time being. A useful features but can break things if solution is used with older SDK.

"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion test/Esprima.Tests.SourceGenerators/SourceGeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ protected static string LoadEsprimaSourceFile(string file)

protected static string ToEsprimaSourcePath(string path)
{
return Path.Combine("../../../../../src/Esprima/", path);
return Path.Combine("../../../../src/Esprima/", path);
}
}
4 changes: 2 additions & 2 deletions test/Esprima.Tests.Test262/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static class Program
public static async Task<int> Main(string[] args)
{
var rootDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? string.Empty;
var projectRoot = Path.Combine(rootDirectory, "../../..");
var solutionRoot = Path.Combine(rootDirectory, "../../../..");

var allowListFile = Path.Combine(projectRoot, "allow-list.txt");
var allowListFile = new FileInfo(Path.Combine(solutionRoot, "test", "Esprima.Tests.Test262", "allow-list.txt")).FullName;
var lines = File.Exists(allowListFile) ? await File.ReadAllLinesAsync(allowListFile) : Array.Empty<string>();
var knownFailing = new HashSet<string>(lines
.Where(x => !string.IsNullOrWhiteSpace(x) && !x.StartsWith("#", StringComparison.Ordinal))
Expand Down
4 changes: 2 additions & 2 deletions test/Esprima.Tests/Fixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ internal static string GetFixturesPath()
var assemblyPath = typeof(Fixtures).GetTypeInfo().Assembly.Location;
var assemblyDirectory = new FileInfo(assemblyPath).Directory;
#endif
var root = assemblyDirectory?.Parent?.Parent?.Parent?.FullName;
return root ?? "";
var root = assemblyDirectory?.Parent?.Parent?.Parent?.Parent?.FullName;
return Path.Combine(root ?? "", "test", "Esprima.Tests");
}

private sealed class FixtureMetadata
Expand Down