-
Notifications
You must be signed in to change notification settings - Fork 41
Feature/2777 multiline strings #360
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
Feature/2777 multiline strings #360
Conversation
7cfdbe3 to
77a4deb
Compare
- Update toFragments() to detect and render multiline strings - Add multilineFragmentKind for proper content display - Add comprehensive test coverage - Preserve formatting and whitespace in multiline content Fixes getgauge/gauge#2777 Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
…ge#359) Bumps the github-actions group with 1 update: [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/setup-go` from 5 to 6 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
Bumps the go group with 6 updates: | Package | From | To | | --- | --- | --- | | [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | `2.24.2` | `2.24.3` | | [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.75.0` | `1.75.1` | | google.golang.org/protobuf | `1.36.8` | `1.36.9` | | [golang.org/x/net](https://github.com/golang/net) | `0.43.0` | `0.44.0` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.35.0` | `0.36.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.28.0` | `0.29.0` | Updates `github.com/tdewolff/minify/v2` from 2.24.2 to 2.24.3 - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](tdewolff/minify@v2.24.2...v2.24.3) Updates `google.golang.org/grpc` from 1.75.0 to 1.75.1 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.75.0...v1.75.1) Updates `google.golang.org/protobuf` from 1.36.8 to 1.36.9 Updates `golang.org/x/net` from 0.43.0 to 0.44.0 - [Commits](golang/net@v0.43.0...v0.44.0) Updates `golang.org/x/sys` from 0.35.0 to 0.36.0 - [Commits](golang/sys@v0.35.0...v0.36.0) Updates `golang.org/x/text` from 0.28.0 to 0.29.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-version: 2.24.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: google.golang.org/grpc dependency-version: 1.75.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: google.golang.org/protobuf dependency-version: 1.36.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: golang.org/x/net dependency-version: 0.44.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go - dependency-name: golang.org/x/sys dependency-version: 0.36.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go - dependency-name: golang.org/x/text dependency-version: 0.29.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
77a4deb to
ca277ca
Compare
|
my bad: i have pushed the following line in the go.mod |
Signed-off-by: Karim Nabli <karim.nabli.ie@gmail.com>
Head branch was pushed to by a user without write access
|
What’s going on here? Is this releasable and backwards compat? I haven’t followed what’s happening, but want to release other fixes. |
|
Yes it is. |
|
OK, released as |
Gauge Multiline String Feature Implementation
Overview
This implementation of native multiline string support for Gauge, addressing a long-standing feature request. The implementation allows users to include multiline content in step arguments using triple-quote syntax (
""").The token (
""") must be in a single line, to define that start and the end of the multiline.Changes Made Across Three Projects
1. Gauge Core (gauge repository)
parser/lex.go
extractMultilineContent()function that identifies and captures content between"""delimitersGenerateTokens()to handle multiline content as implicit step argumentsparser/specparser.go
CreateStepUsingLookup()to detect when a step has multiline content without explicit parameter placeholdersparser/stepParser.go
extractStepValueAndParameterTypes()to handle multiline contentprocessStep()to skip parameter processing for implicit multiline stringsgauge/arg.go
MultilineStringconstant to support the new parameter typegauge/protoConverters.go
Multiline_Stringparameter type inconvertToProtoParameter()andmakeParameterCopy()2. Gauge Protocol (gauge-proto repository)
Parameter_Multiline_Stringto the protocol buffer definition3. HTML Report Plugin (html-report repository)
toFragments()function to detect and properly render multiline strings in HTML reportsmultilineFragmentKindsupport with proper content preservation3.1 Spec level
3.1.1 Multiline icon representation
3.1.2 Multiline hover
3.1.3 Multiline expansion
3.1 Concept level
Similar to the spec one
Technical Implementation Details
Parsing Logic
"""following a step as multiline block start"""delimiters is captured as a single string, preserving all formattingstepToken.Args[0]Parameter Handling
{}placeholders needed)gauge_messages.Parameter_Multiline_Stringparameter typegauge_messages.Fragmentwith parameter type for renderingKey Design Decisions
Usage Examples
Before (Workarounds)
After (Native Support)
Multiple Use Cases
Benefits Achieved
Backward Compatibility
"""syntax is usedTesting Coverage
The implementation includes comprehensive tests covering:
Core Functionality
Edge Cases
Integration
Test Status:
Protocol Impact
Parameter_Multiline_Stringto the protocol buffer definitionconvertToProtoParameter()andmakeParameterCopy()to handle the new typePerformance Considerations
"""is detectedReview Notes
Next Steps
This implementation finally provides native multiline string support in Gauge while maintaining the framework's commitment to readability, usability, and backward compatibility. The feature aligns Gauge with modern testing tool expectations and eliminates the need for workarounds when dealing with structured data or code snippets in specifications.