-
Notifications
You must be signed in to change notification settings - Fork 4
fix(hooks): changed context to ScenarioContext for BEFORE/AFTER_STEP hook #175
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
Conversation
🦙 MegaLinter status:
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 6 | 0 | 0 | 0.02s | |
| ✅ CPP | clang-format | 81 | 1 | 0 | 0 | 0.57s |
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.11s | |
| ✅ JSON | jsonlint | 8 | 0 | 0 | 0.18s | |
| ✅ JSON | prettier | 8 | 6 | 0 | 0 | 0.5s |
| markdownlint | 4 | 1 | 2 | 0 | 0.73s | |
| markdown-link-check | 4 | 2 | 0 | 330.56s | ||
| ✅ MARKDOWN | markdown-table-formatter | 4 | 1 | 0 | 0 | 0.18s |
| ✅ REPOSITORY | checkov | yes | no | no | 14.66s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.01s | |
| ✅ REPOSITORY | grype | yes | no | no | 20.72s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.06s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 1.03s | |
| ✅ REPOSITORY | syft | yes | no | no | 0.92s | |
| ✅ REPOSITORY | trivy | yes | no | no | 6.8s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.07s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 7.36s | |
| lychee | 49 | 30 | 0 | 8.43s | ||
| ✅ YAML | prettier | 10 | 0 | 0 | 0 | 0.56s |
| ✅ YAML | v8r | 10 | 0 | 0 | 4.54s | |
| ✅ YAML | yamllint | 10 | 0 | 0 | 0.49s |
See detailed report in MegaLinter reports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates hook execution by switching from using StepContext to ScenarioContext for BEFORE/AFTER_STEP hooks. The key changes include:
- Updating context initialization in ContextManagerInstance.hpp.
- Adjusting test assertions in TestHookExecutor.cpp.
- Modifying the HookExecutor.cpp constructor to use ScenarioContext instead of StepContext.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cucumber_cpp/library/engine/test_helper/ContextManagerInstance.hpp | Updates context initialization to inline construction of scoped contexts. |
| cucumber_cpp/library/engine/test/TestHookExecutor.cpp | Changes test assertions to use ScenarioContext for hook execution. |
| cucumber_cpp/library/engine/HookExecutor.cpp | Updates StepScope constructor to use ScenarioContext for consistency. |
cucumber_cpp/library/engine/test_helper/ContextManagerInstance.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the hook behavior by updating the context used in BEFORE/AFTER_STEP hooks to use ScenarioContext instead of StepContext and corrects a naming typo.
- Replaced StepContext with ScenarioContext calls in hook-related files.
- Corrected the misspelling of ScopedFeautureContext to ScopedFeatureContext throughout the code.
- Updated context instantiation in the ContextManagerInstance to use locally scoped context objects.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cucumber_cpp/library/engine/test_helper/ContextManagerInstance.hpp | Updated context instantiation; changed from member initialization to local variable creation for context scopes. |
| cucumber_cpp/library/engine/test/TestHookExecutor.cpp | Replaced StepContext assertions with ScenarioContext assertions. |
| cucumber_cpp/library/engine/TestExecution.hpp | Fixed a spelling typo in the ScopedFeatureContext declaration. |
| cucumber_cpp/library/engine/HookExecutor.cpp | Updated hook initialization to use ScenarioContext instead of StepContext. |
| cucumber_cpp/library/engine/ContextManager.hpp | Corrected struct name from ScopedFeautureContext to ScopedFeatureContext. |
| cucumber_cpp/library/engine/ContextManager.cpp | Updated all internal references to the corrected ScopedFeatureContext. |
|




No description provided.