-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] First integration of Gherkin #120
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
m-olko
wants to merge
11
commits into
main
Choose a base branch
from
gherkin_incremental
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
11 commits
Select commit
Hold shift + click to select a range
12d0d7c
First integration of Gherkin
m-olko 9712b4d
Removed hardcoding flag configs paths
m-olko b7fef18
Added support for flags selectors
m-olko 0084199
mend
m-olko 2648f46
Merge remote-tracking branch 'origin/main' into gherkin_incremental
m-olko 2299c8c
migrate gherkin tests to use detailed evaluation
m-olko 46a7e1d
Split gherkin steps into specialized files
m-olko aee7424
Prevent orphan flagd and replace sleeps with grpc readiness probing
m-olko 62a23ef
Fixed config pattern matching
m-olko b975754
Addressed AI comments
m-olko aa18245
Merge branch 'main' into gherkin_incremental
m-olko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
|
||
| # Generate the version file from the template by extracting the version from CMakeLists.txt | ||
| genrule( | ||
| name = "generate_version_file", | ||
| srcs = [ | ||
| "CMakeLists.txt", | ||
| "src/version.template", | ||
| ], | ||
| outs = ["src/version.hpp"], | ||
| cmd = """ | ||
| VERSION=$$(grep 'project(cwt-cucumber VERSION' $(location CMakeLists.txt) | sed 's/.*VERSION \\([0-9.]*\\).*/\\1/'); | ||
| MAJOR=$${VERSION%%.*}; | ||
| MINOR=$${VERSION#*.}; | ||
| sed -e "s/@PROJECT_VERSION@/$$VERSION/g" \ | ||
| -e "s/\\$${PROJECT_VERSION_MAJOR}/$$MAJOR/g" \ | ||
| -e "s/\\$${PROJECT_VERSION_MINOR}/$$MINOR/g" \ | ||
| -e "s/\\$${PROJECT_VERSION}/$$VERSION/g" \ | ||
| $(location src/version.template) > $@ | ||
| """, | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "cwt-cucumber", | ||
| srcs = glob( | ||
| ["src/**/*.cpp"], | ||
| exclude = ["src/main.cpp"], | ||
| ), | ||
| hdrs = glob( | ||
| ["src/**/*.hpp"], | ||
| exclude = ["src/version.hpp"], | ||
| ) + [ | ||
| "src/version.hpp", | ||
| ], | ||
| copts = ["-std=c++20"], | ||
| strip_include_prefix = "src", | ||
| visibility = ["//visibility:public"], | ||
| ) |
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 @@ | ||
| exports_files(glob(["gherkin/**/*.feature"])) | ||
|
|
||
| filegroup( | ||
| name = "features", | ||
| srcs = glob(["gherkin/**/*.feature"]), | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "flags", | ||
| srcs = glob(["flags/**/*.json"]), | ||
| visibility = ["//visibility:public"], | ||
| ) |
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 @@ | ||
| Checks: '-*' |
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,2 @@ | ||
| CompileFlags: | ||
| Add: [-std=c++20] |
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,69 @@ | ||
| load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test") | ||
|
|
||
| SRCS = [ | ||
| "steps/config_steps.cpp", | ||
| "steps/context_steps.cpp", | ||
| "steps/evaluation_steps.cpp", | ||
| "steps/flag_steps.cpp", | ||
| "steps/lifecycle_steps.cpp", | ||
| "steps/provider_steps.cpp", | ||
| "steps/step_utils.cpp", | ||
| "steps/step_utils.h", | ||
| "test_env.cpp", | ||
| "test_env.h", | ||
| "test_runner.cpp", | ||
| "test_state.cpp", | ||
| "test_state.h", | ||
| ] | ||
|
|
||
| DATA = [ | ||
| "@flagd_binary//:flagd", | ||
| "@flagd_testbed//:features", | ||
| "@flagd_testbed//:flags", | ||
| ] | ||
|
|
||
| DEPS = [ | ||
| "//providers/flagd/src:flagd_provider", | ||
| "@bazel_tools//tools/cpp/runfiles", | ||
| "@com_github_grpc_grpc//:grpc++", | ||
| "@cwt_cucumber//:cwt-cucumber", | ||
| "@nlohmann_json//:json", | ||
| "@openfeature_cpp_sdk//openfeature", | ||
| "@openfeature_cpp_sdk//openfeature:openfeature_api", | ||
| ] | ||
|
|
||
| cc_binary( | ||
| name = "gherkin_bin", | ||
| srcs = SRCS, | ||
| copts = ["-std=c++20"], | ||
| data = DATA, | ||
| env = { | ||
| "FLAGD_TEST_FLAGS": "$(locations @flagd_testbed//:flags)", | ||
| }, | ||
| target_compatible_with = [ | ||
| "@platforms//os:linux", | ||
| "@platforms//cpu:x86_64", | ||
| ], | ||
| deps = DEPS, | ||
| ) | ||
|
|
||
| cc_test( | ||
| name = "gherkin_test", | ||
| srcs = SRCS, | ||
| args = [ | ||
| "$(locations @flagd_testbed//:features)", | ||
| ], | ||
| copts = ["-std=c++20"], | ||
| data = DATA, | ||
| env = { | ||
| "FLAGD_TEST_FLAGS": "$(locations @flagd_testbed//:flags)", | ||
| }, | ||
| # TODO(#91): This tag disables those tests from github action check | ||
| # We should remove it once all tests will be passing | ||
| tags = ["manual"], | ||
|
m-olko marked this conversation as resolved.
|
||
| target_compatible_with = [ | ||
| "@platforms//os:linux", | ||
| "@platforms//cpu:x86_64", | ||
| ], | ||
| deps = DEPS, | ||
| ) | ||
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.