-
Notifications
You must be signed in to change notification settings - Fork 4
feat!: rewrite to use cucumber messages #273
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
Open
daantimmer
wants to merge
114
commits into
main
Choose a base branch
from
feature/rewrite-to-use-cucumber-messages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
1457b95
feat!: rewrite to use cucumber messages
daantimmer e8e9362
enable ccache
daantimmer 792332e
disable the build of shared libs
daantimmer e8c96aa
disable position independent code generation for jbeder/yaml-cpp
daantimmer 48d99c6
add additional launch tags
daantimmer 1ae9468
add first version (empty, minimal and data-tables are enabled) of the…
daantimmer 10137be
refactored a lot of code
daantimmer 7ac6e9c
removed unused files
daantimmer 77b4762
update devcontainers for CI
daantimmer 50a2bce
removed agauniyal/rang from dependencies
daantimmer 4054607
cleanup Application
daantimmer 45a4380
sanitize and dump actual and expected json
daantimmer 958e05c
set option variables for dependencies as cache variables
daantimmer 6eb2da0
fix grouping for string parameter
daantimmer ece0b62
use ScopedFakeTestPartResultReporter instead of EmptyTestEventListene…
daantimmer 6f1f4c8
Enable the following compatibility tests: ambiguous, backgrounds, cda…
daantimmer 07a77d7
add examples-tables-attachment compatibility test
daantimmer 028dcc5
add attachments compatibility test
daantimmer 640986f
enabled examples-tables-undefined and global-hooks compatibility test
daantimmer cbb2f0c
Added global-hooks-afterall-error, global-hooks-attachments, global-h…
daantimmer dfe7157
add all compatibility checks by default regardless if a cpp implement…
daantimmer de2aaeb
add hooks-named, hooks-skipped and hooks-undefined compatibility tests
daantimmer d1a3e52
add multiple-features and multiple-features-reverses compatibility tests
daantimmer cad1bcf
Merge branch 'main' into feature/rewrite-to-use-cucumber-messages
daantimmer 83c6e5a
fix clang-msvc build
daantimmer 13484a5
fix clang-msvc build
daantimmer c7ee029
fix MSVC build
daantimmer 4a9afab
fix MSVC build
daantimmer d11d0d0
add parameter-types compatibility tests
daantimmer 78f70e1
add pending compatibility tests
daantimmer c67ebd4
fixed TestExpression tests
daantimmer 323b2d4
fixed TestExpression tests
daantimmer 3be881a
add retry, retry-ambiguous, retry-pending and retry-undefined compati…
daantimmer e94534c
add rules, rules-backgrounds and skipped compatibility tests
daantimmer c235f1a
add undefined, unknown-parameter-type and unused-steps compatibility …
daantimmer 5893f62
fixed build issues and solved sonarcloud warnings
daantimmer d75b763
make URI cross-OS compatible
daantimmer 917debc
remove compatibility kit from ls-lint
daantimmer 5815b57
fix possible null-pointer dereference
daantimmer 9986ec8
make uri's canonical
daantimmer c66a111
fixed const instead of static
daantimmer 3e626e7
fix sonar warnings and replace \r\n with \n
daantimmer 5c23d80
refactor RemoveIncompatibilities to improve iteration and const corre…
daantimmer 1ad2458
refactor RemoveIncompatibilities to enhance iteration logic and ensur…
daantimmer e10babb
remove old reporters
daantimmer a56826e
remove unused stuff
daantimmer 998dbd2
refactor to reduce nesting
daantimmer 811ac18
refactory HookRegistry
daantimmer 76ed6f4
refactored Parameter
daantimmer d61854c
refactored Query.hpp
daantimmer ba22049
removed TraceTime
daantimmer 6a2492c
Refactored RunCucumber
daantimmer 54278d0
minor refactorings
daantimmer 867e06e
minor refactorings
daantimmer 0715a6e
remove unused files
daantimmer 2d07945
fixed co-pilot comments
daantimmer 03832cd
fix bats-acceptance tests
daantimmer c9994f4
minor updates
daantimmer ef2d0c1
add summary formatter to debug launch configurations
daantimmer 3dbb76e
add summary formatter to test.bats
daantimmer efe611e
query is now also a broadcaster for events
daantimmer a0f27cc
moved to new api::Formatters to register/enable formatters
daantimmer da2fcfb
remove unused eventDataCollector member from PrettyPrinter
daantimmer 88e3a93
refactor: simplify title formatting in PrettyPrinter
daantimmer ee24b6f
refactor: update message formatting in FormatMessage function
daantimmer f3f2b9f
refactor: enhance error message in BuildArguments for better clarity
daantimmer 2c52a4a
refactor: streamline hook assembly in AssembleTestSteps for improved …
daantimmer 4782695
refactor: update test script and application files to improve formatt…
daantimmer ef11c11
refactor: enhance tests for TreeRegexp to clarify limitations of std:…
daantimmer c1d2a0b
refactor: rename ExtractStep to ExtractSteps for clarity and consistency
daantimmer 0ff58a4
refactor: rename FormatMessage to FormatTestFailureMessage for clarity
daantimmer aa57ace
chore: update SonarQube scan action to version 7.0.0
daantimmer 1eaefa6
refactor: add debug output steps to static analysis workflow for bett…
daantimmer 7231def
refactor: update static analysis workflow to include exit codes for d…
daantimmer 5f59bca
refactor: update static analysis workflow to use logical OR for exit …
daantimmer 04b8aa4
refactor: update static analysis workflow to use 'true' for exit code…
daantimmer c23eabf
refactor: update test commands to use 'pretty' format for better outp…
daantimmer 51fd45e
refactor: add coverage clean step and duplicate directory size checks…
daantimmer b9adf82
refactor: update test cases to correctly handle mandatory arguments a…
daantimmer 794c541
refactor: remove tee command from bats task to simplify output handling
daantimmer 8c18af3
refactor: remove unnecessary trailing commas in launch.json arguments
daantimmer 5879949
refactor: replace strong ordering operators with SourceLocationOrder …
daantimmer 5fd1def
refactor: simplify character class and group handling in regex parsing
daantimmer 0e1a68b
refactor: use EXIT_SUCCESS and EXIT_FAILURE for exit codes in GetExit…
daantimmer 3819881
refactor: move operator+ overloads for Lineage into the class definit…
daantimmer 86b0bad
refactor: update SonarQube issue ignore rules to include additional c…
daantimmer f1e4d65
refactor: remove unnecessary blank line at the end of Parameter.cpp
daantimmer 60af5a5
refactor: use default comparator for orderingMap in Application.cpp
daantimmer 4b546b1
refactor: update launch arguments to use --tags instead of --tag
daantimmer 6e50738
refactor: update formatter registration to use nlohmann::json for for…
daantimmer c82fa49
refactor: introduce FormatterOption struct for improved formatter han…
daantimmer b2155bf
refactor: enhance compatibility handling and streamline step registra…
daantimmer f91df55
refactor: simplify LoadDevkit function and improve path handling
daantimmer 2e421e5
refactor: mark FormatterOption constructor as explicit
daantimmer 6338f25
refactor: implement group parsing logic in TreeRegexp and enhance str…
daantimmer 8e6e1f4
refactor: move ParameterRegistration instance to header for better vi…
daantimmer ccb2404
refactor: replace emplace with try_emplace for custom output file han…
daantimmer cffd389
refactor: remove unused includes from Body.cpp
daantimmer 8c8dc9d
refactor: simplify event listener management and enhance parameter em…
daantimmer c8a25e4
refactor: improve AssembleSteps function signature and optimize assem…
daantimmer a47f823
refactor: optimize Argument constructor by using std::move for group …
daantimmer 4902aaa
refactor: implement custom signal handler for SIGABRT
daantimmer 3a7dac9
refactor: update CMakeLists to use consistent library naming and impr…
daantimmer e6c718b
refactor: replace ConverterTypeMap with support::ConverterTypeMap and…
daantimmer c46a929
refactor: remove unused GTest dependencies and clean up CMakeLists files
daantimmer f65ebd1
refactor: remove GTest dependencies and clean up RunCucumber implemen…
daantimmer f95d924
refactor: remove Parameter class and update related implementations t…
daantimmer bb8ceed
refactor: remove unused Body include from Worker.cpp
daantimmer 4ac0d91
movesupport code to the support library
daantimmer b77cf83
refactor: enable test subdirectory and add dummy test implementation
daantimmer fe31842
refactor: remove unused includes from Token.hpp
daantimmer f5cfead
refactor: update parameter registration and step handling to use supp…
daantimmer 7ab4c0e
Refactor Query and Formatter Integration
daantimmer 3af273c
refactor: reorganize formatter library to use helper functions and im…
daantimmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ ignore: | |
| - external | ||
| - megalinter-reports | ||
| - testdata | ||
| - compatibility | ||
daantimmer marked this conversation as resolved.
Show resolved
Hide resolved
daantimmer marked this conversation as resolved.
Show resolved
Hide resolved
daantimmer marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daantimmer marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MegaLinter] reported by reviewdog 🐶 amp-cucumber-cpp-runner/CMakePresets.json Lines 2 to 139 in 9986ec8
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| function(add_compatibility_kit name) | ||
| set(libname compatibility.${name}.test) | ||
| add_executable(${libname}) | ||
|
|
||
| if(CCR_BUILD_TESTS) | ||
| add_test(NAME ${libname} COMMAND ${libname}) | ||
| endif() | ||
|
|
||
| target_link_libraries(${libname} PRIVATE | ||
| cucumber_cpp | ||
| gtest_main | ||
| ) | ||
|
|
||
| target_include_directories(${libname} PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
| ) | ||
|
|
||
| target_sources(${libname} PRIVATE | ||
| compatibility.cpp | ||
| ) | ||
|
|
||
|
|
||
| if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${name}/${name}.cpp) | ||
| target_sources(${libname} PRIVATE | ||
| ${name}/${name}.cpp | ||
| ) | ||
| else() | ||
| set(SKIP_TEST On) | ||
| endif() | ||
|
|
||
| string(REPLACE "-" "_" KITNAME ${name}) | ||
|
|
||
| target_compile_definitions(${libname} PRIVATE | ||
| KIT_NAME=${KITNAME} | ||
| KIT_STRING="${name}" | ||
| KIT_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}/${name}" | ||
| KIT_NDJSON_FILE="${CMAKE_CURRENT_SOURCE_DIR}/${name}/${name}.ndjson" | ||
| $<$<BOOL:${SKIP_TEST}>:SKIP_TEST> | ||
| ) | ||
| endfunction() | ||
|
|
||
| file(GLOB kits RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/*) | ||
| foreach(kit ${kits}) | ||
| if (IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/${kit}) | ||
| message(STATUS "Adding compatibility kit: ${kit}") | ||
| add_compatibility_kit(${kit}) | ||
| endif() | ||
| endforeach() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #include "cucumber_cpp/CucumberCpp.hpp" | ||
| #include <string> | ||
|
|
||
| STEP(R"(^a (.*?) with (.*?)$)", (const std::string& arg1, const std::string& arg2)) | ||
| { | ||
| // no-op | ||
| } | ||
|
|
||
| STEP(R"(^a step with (.*?)$)", (const std::string& arg1)) | ||
| { | ||
| // no-op | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Feature: Ambiguous steps | ||
| Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine | ||
| which one to execute. | ||
|
|
||
| Scenario: Multiple step definitions for a step | ||
| Given a step with multiple definitions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| {"meta":{"protocolVersion":"31.0.0","implementation":{"name":"fake-cucumber","version":"123.45.6"},"cpu":{"name":"arm64"},"os":{"name":"darwin","version":"24.5.0"},"runtime":{"name":"Node.js","version":"24.4.1"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber-ltd/shouty.rb/actions/runs/154666429","buildNumber":"154666429","git":{"revision":"99684bcacf01d95875834d87903dcb072306c9ad","remote":"https://github.com/cucumber-ltd/shouty.rb.git","branch":"main"}}}} | ||
| {"source":{"data":"Feature: Ambiguous steps\n Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine\n which one to execute.\n\n Scenario: Multiple step definitions for a step\n Given a step with multiple definitions\n","uri":"samples/ambiguous/ambiguous.feature","mediaType":"text/x.cucumber.gherkin+plain"}} | ||
| {"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Ambiguous steps","description":" Multiple step definitions that match a pickle step result in an AMBIGUOUS status, since Cucumnber cannot determine\n which one to execute.","children":[{"scenario":{"id":"1","tags":[],"location":{"line":5,"column":3},"keyword":"Scenario","name":"Multiple step definitions for a step","description":"","steps":[{"id":"0","location":{"line":6,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step with multiple definitions"}],"examples":[]}}]},"comments":[],"uri":"samples/ambiguous/ambiguous.feature"}} | ||
| {"pickle":{"id":"3","uri":"samples/ambiguous/ambiguous.feature","location":{"line":5,"column":3},"astNodeIds":["1"],"tags":[],"name":"Multiple step definitions for a step","language":"en","steps":[{"id":"2","text":"a step with multiple definitions","type":"Context","astNodeIds":["0"]}]}} | ||
| {"stepDefinition":{"id":"4","pattern":{"type":"REGULAR_EXPRESSION","source":"^a (.*?) with (.*?)$"},"sourceReference":{"uri":"samples/ambiguous/ambiguous.ts","location":{"line":3}}}} | ||
| {"stepDefinition":{"id":"5","pattern":{"type":"REGULAR_EXPRESSION","source":"^a step with (.*?)$"},"sourceReference":{"uri":"samples/ambiguous/ambiguous.ts","location":{"line":7}}}} | ||
| {"testRunStarted":{"id":"6","timestamp":{"seconds":0,"nanos":0}}} | ||
| {"testCase":{"id":"7","pickleId":"3","testSteps":[{"id":"8","pickleStepId":"2","stepDefinitionIds":["4","5"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"start":2,"value":"step","children":[]}},{"group":{"start":12,"value":"multiple definitions","children":[]}}]},{"stepMatchArguments":[{"group":{"start":12,"value":"multiple definitions","children":[]}}]}]}],"testRunStartedId":"6"}} | ||
| {"testCaseStarted":{"id":"9","testCaseId":"7","timestamp":{"seconds":0,"nanos":1000000},"attempt":0}} | ||
| {"testStepStarted":{"testCaseStartedId":"9","testStepId":"8","timestamp":{"seconds":0,"nanos":2000000}}} | ||
| {"testStepFinished":{"testCaseStartedId":"9","testStepId":"8","testStepResult":{"status":"AMBIGUOUS","duration":{"seconds":0,"nanos":0}},"timestamp":{"seconds":0,"nanos":3000000}}} | ||
| {"testCaseFinished":{"testCaseStartedId":"9","timestamp":{"seconds":0,"nanos":4000000},"willBeRetried":false}} | ||
| {"testRunFinished":{"testRunStartedId":"6","timestamp":{"seconds":0,"nanos":5000000},"success":false}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { Given } from '@cucumber/fake-cucumber' | ||
|
|
||
| Given(/^a (.*?) with (.*?)$/, function () { | ||
| // first one | ||
| }) | ||
|
|
||
| Given(/^a step with (.*)$/, function () { | ||
| // second one | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #include "cucumber_cpp/CucumberCpp.hpp" | ||
| #include "cucumber_cpp/library/engine/ExecutionContext.hpp" | ||
| #include <cstdint> | ||
| #include <filesystem> | ||
| #include <fstream> | ||
| #include <ios> | ||
| #include <numeric> | ||
| #include <source_location> | ||
| #include <sstream> | ||
| #include <string> | ||
|
|
||
| namespace | ||
| { | ||
| const std::filesystem::path currentCompileDir = std::filesystem::path{ std::source_location::current().file_name() }.parent_path(); | ||
| } | ||
|
|
||
| WHEN(R"(the string {string} is attached as {string})", (const std::string& text, const std::string& mediaType)) | ||
| { | ||
| Attach(text, mediaType); | ||
| } | ||
|
|
||
| WHEN(R"(the string {string} is logged)", (const std::string& text)) | ||
| { | ||
| Log(text); | ||
| } | ||
|
|
||
| WHEN(R"(text with ANSI escapes is logged)") | ||
| { | ||
| Log("This displays a \x1b[31mr\x1b[0m\x1b[91ma\x1b[0m\x1b[33mi\x1b[0m\x1b[32mn\x1b[0m\x1b[34mb\x1b[0m\x1b[95mo\x1b[0m\x1b[35mw\x1b[0m"); | ||
| } | ||
|
|
||
| WHEN(R"(the following string is attached as {string}:)", (const std::string& mediaType)) | ||
| { | ||
| Attach(docString->content, mediaType); | ||
| } | ||
|
|
||
| WHEN(R"(an array with {int} bytes is attached as {string})", (std::int32_t size, const std::string& mediaType)) | ||
| { | ||
| std::string data(size, '\0'); | ||
| std::iota(data.begin(), data.end(), 0); | ||
| std::stringstream stream{ data }; | ||
| Attach(stream, mediaType); | ||
| } | ||
|
|
||
| WHEN(R"(a PDF document is attached and renamed)") | ||
| { | ||
| std::ifstream pdfFile{ currentCompileDir / "document.pdf", std::ios::binary }; | ||
| Attach(pdfFile, cucumber_cpp::library::engine::AttachOptions{ "application/pdf", "renamed.pdf" }); | ||
| } | ||
|
|
||
| WHEN(R"(a link to {string} is attached)", (const std::string& url)) | ||
| { | ||
| Link(url); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.