Add remote test execution support for Python/Behave backend with generic message endpoint
Final Refactoring Updates
Renamed Java Implementation
- Renamed
MessageEndpointProcesstoJavaMessageEndpointProcessto prevent name clash with the generic base class - Updated all references in
CucumberFeatureLocalApplicationLaunchConfigurationDelegate
Moved Common Code to Base Class
- Moved
deserializeEnvelope()implementation to the base class since both Java and Python use identical Jackson-based deserialization - Both backends now only need to override
getLabel()and provide backend-specific argument injection - Added dependency on
io.cucumber.eclipse.java.pluginsto editor bundle for Jackson access
Backend-Specific Code
-
Java: Implements
addArguments()to inject-pplugin argument -
Python: Already uses
BehaveProcessLauncher.withRemoteConnection()for argument injection
Code Reduction
- Java: ~25 lines (down from ~33)
- Python: ~25 lines (down from ~33)
- Base: ~240 lines including shared deserialization logic
The refactoring demonstrates maximum code reuse while maintaining clean separation of backend-specific concerns.
Original prompt
This section details on the original issue you should resolve
<issue_title>[bheave] Add support to watch the remote code execution of cucumber/behave tests</issue_title> <issue_description>In java we have a cumber-java-plugin that opens a socket connection to the host running the process to watch the test execution and getting results.
We need to investigate if
behave(source here https://github.com/behave/behave ) support something similar in general we want the following:
- Users should usually not need to modify their code in any way but we may inject additional commandline arguments
- Our code should be a python script that plugs into a suitable extension point in behave, (e.g. using the report facility)
- it must then somehow read a port as a parameter, this can be an ENV variable or whatever else might be possible (e.g. in java we can pass it directly as a plugin parameter)
- Then it should open a socket connection and send encoded cucumber messages we can read again by java code for this we should use https://github.com/cucumber/messages/tree/main/python
- For the protocol we want to use something similar to what https://github.com/cucumber/cucumber-eclipse/blob/main/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/MessageEndpoint.java does (so we can possibly even reuse that on the receiver side)
- This messages should then be read and redirected to the unittest view as we do for the java backend
- The copilote instructions need to be updated to reflect this new thing wen implementing new backends</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes cucumber/cucumber-eclipse#578
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.