Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup gherkin dotnet #1511

Merged
merged 24 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
051a7eb
change test projects to .NET 5
gasparnagy May 3, 2021
fee0e5f
make tests pass with .NET 5
gasparnagy May 3, 2021
77eb304
include dontet in default build
gasparnagy May 3, 2021
d546c3a
ignored Pickles and Source tests
gasparnagy May 3, 2021
d2cc203
fixing code tests, part 1
gasparnagy May 3, 2021
374579b
fix successful AST code tests
gasparnagy May 4, 2021
c75a1f9
make error tests pass, except one
gasparnagy May 4, 2021
a2b12fe
fix tag error handling
gasparnagy May 4, 2021
b353a66
fix comment handling in tag line
gasparnagy May 4, 2021
1dd29b7
get source tests work again
gasparnagy May 4, 2021
c9c4095
fix pickles tests
gasparnagy May 4, 2021
ecff7bb
rearrange code to match messages structure, part 1
gasparnagy May 4, 2021
e5e2183
rearrange code to match messages structure, part 2
gasparnagy May 5, 2021
eb8690f
rearrange code to match messages structure, part 3
gasparnagy May 5, 2021
0f62189
rearrange code to match messages structure, part 4
gasparnagy May 5, 2021
d48801b
rearrange code to match messages structure, part 5
gasparnagy May 5, 2021
1b5c1f8
Improve Gherkin NuGet package settings
gasparnagy May 5, 2021
8d2fe11
Improve Gherkin NuGet package settings (fix)
gasparnagy May 5, 2021
9e4fd15
Replace Utf8Json with TinyJson
gasparnagy May 5, 2021
7a187a4
Add changes to CHANGELOG.md
gasparnagy May 5, 2021
767e877
Add gherkin-dotnet to the parallel build
gasparnagy May 5, 2021
a34dff3
Fix compilation of messages-dotnet tests for .NET 5
gasparnagy May 5, 2021
127feb0
Update to use v0.3.0 build image
gasparnagy May 10, 2021
3efc51e
Merge branch 'master' into cleanup-gherkin-dotnet
gasparnagy May 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,17 @@ jobs:
cd messages/dotnet
make

gherkin-dotnet:
executor: docker-cucumber-build
steps:
- attach_workspace:
at: "~/cucumber"
- run:
name: gherkin/dotnet
command: |
cd gherkin/dotnet
make

### Python

tag-expressions-python:
Expand Down Expand Up @@ -1014,6 +1025,10 @@ workflows:
requires:
- prepare-parallel

- gherkin-dotnet:
requires:
- prepare-parallel

## Python

- tag-expressions-python:
Expand Down
6 changes: 6 additions & 0 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
### Added

### Changed
* [DotNet] Replaced Utf8Json with source-embedded TinyJson.
([#511](https://github.com/cucumber/cucumber/pull/1511)
[gasparnagy])

### Deprecated

Expand All @@ -22,6 +25,9 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt
([#1495](https://github.com/cucumber/cucumber/pull/1495)
[#1494](https://github.com/cucumber/cucumber/issues/1494)
[ehuelsmann])
* [DotNet] Fixed .NET Gherkin compatibility with other Gherkin implementations.
([#511](https://github.com/cucumber/cucumber/pull/1511)
[gasparnagy])

## [18.1.1] - 2021-04-22

Expand Down
2 changes: 1 addition & 1 deletion gherkin/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LANGUAGES ?= go javascript ruby java python
LANGUAGES ?= go javascript ruby java python dotnet
include default.mk

post-release: print-documentation-instructions
Expand Down
37 changes: 0 additions & 37 deletions gherkin/dotnet/Gherkin.CLI/FeatureAstJSonContractResolver.cs

This file was deleted.

14 changes: 0 additions & 14 deletions gherkin/dotnet/Gherkin.CLI/Gherkin.CLI.csproj

This file was deleted.

63 changes: 0 additions & 63 deletions gherkin/dotnet/Gherkin.CLI/Program.cs

This file was deleted.

49 changes: 0 additions & 49 deletions gherkin/dotnet/Gherkin.CSharp.sln

This file was deleted.

41 changes: 41 additions & 0 deletions gherkin/dotnet/Gherkin.DotNet.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31005.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gherkin", "Gherkin\Gherkin.csproj", "{2FF8C8E3-D3D1-452D-8BA7-358035FEC064}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gherkin.Specs", "Gherkin.Specs\Gherkin.Specs.csproj", "{A0DEA4BA-3A79-4C05-87F2-7C7C9DE8B245}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7083F2CC-7F1D-40A3-8DF4-D16C090FF977}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
bin\gherkin = bin\gherkin
gherkin-csharp.razor = gherkin-csharp.razor
bin\gherkin-generate-tokens = bin\gherkin-generate-tokens
gherkin.berp = gherkin.berp
Makefile = Makefile
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2FF8C8E3-D3D1-452D-8BA7-358035FEC064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FF8C8E3-D3D1-452D-8BA7-358035FEC064}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FF8C8E3-D3D1-452D-8BA7-358035FEC064}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FF8C8E3-D3D1-452D-8BA7-358035FEC064}.Release|Any CPU.Build.0 = Release|Any CPU
{A0DEA4BA-3A79-4C05-87F2-7C7C9DE8B245}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0DEA4BA-3A79-4C05-87F2-7C7C9DE8B245}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0DEA4BA-3A79-4C05-87F2-7C7C9DE8B245}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0DEA4BA-3A79-4C05-87F2-7C7C9DE8B245}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {01DBBC1B-2ADE-4E49-8C44-20FF62840920}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
using System.Linq;
using FluentAssertions;
using Gherkin.Events;
using Gherkin.CucumberMessages.Types;
using Gherkin.Specs.Helper;
using Xunit;

namespace Gherkin.Specs.Events
namespace Gherkin.Specs
{
public class AstBuildingTests : EventTestBase
{
[Theory, MemberData(nameof(TestFileProvider.GetValidTestFiles), MemberType = typeof(TestFileProvider))]
public void TestSuccessfulAstBuilding(string testFeatureFile)
{
var testFile = GetFullPathToTestFeatureFile(testFeatureFile, "good", ".ast.ndjson");

var expectedAstContent = GetExpectedContent(testFile.ExpectedFileFullPath);

var expectedGherkinDocumentEvent = NDJsonParser.Deserialize<GherkinDocumentEvent>(expectedAstContent);

var raisedEvents = StartGherkinEventQueue(testFile.FullPath, false, true, false);
var expectedGherkinDocumentEvent = NDJsonParser.Deserialize<Envelope>(expectedAstContent);

raisedEvents.Should().AllBeOfType<GherkinDocumentEvent>();
var raisedEvents = ProcessGherkinEvents(testFile.FullPath, false, true, false);

AssertEvents(testFeatureFile, raisedEvents.Cast<GherkinDocumentEvent>().ToList(), expectedGherkinDocumentEvent, testFile);
raisedEvents.Should().Match(list => list.All(e => e.GherkinDocument != null));
AssertEvents(testFeatureFile, raisedEvents, expectedGherkinDocumentEvent, testFile);
}

[Theory, MemberData(nameof(TestFileProvider.GetInvalidTestFiles), MemberType = typeof(TestFileProvider))]
public void TestFailedAstBuilding(string testFeatureFile)
{
var testFile = GetFullPathToTestFeatureFile(testFeatureFile, "bad", ".errors.ndjson");

var expectedAstContent = GetExpectedContent(testFile.ExpectedFileFullPath);

var expectedGherkinDocumentEvent = NDJsonParser.Deserialize<AttachmentEvent>(expectedAstContent);

var raisedEvents = StartGherkinEventQueue(testFile.FullPath, false, true, false);
var expectedGherkinDocumentEvent = NDJsonParser.Deserialize<Envelope>(expectedAstContent);

raisedEvents.Should().AllBeOfType<AttachmentEvent>();
var raisedEvents = ProcessGherkinEvents(testFile.FullPath, false, true, false);

AssertEvents(testFeatureFile, raisedEvents.Cast<AttachmentEvent>().ToList(), expectedGherkinDocumentEvent, testFile);
raisedEvents.Should().Match(list => list.All(e => e.ParseError != null));
AssertEvents(testFeatureFile, raisedEvents, expectedGherkinDocumentEvent, testFile);
}
}
}