Repository navigation
Preserve Test Fragment name when saving - #6934
milamberspace merged 2 commits into
Conversation
2482bf9 to
ad9ab43
Compare
milamberspace
left a comment
There was a problem hiding this comment.
Thanks! The root cause checks out: GuiPackage.createTestElement() reuses the cached TestFragmentControllerGui, the very instance showing the selected fragment, and calls clearGui() on it, so the next GUI-to-element update wrote the default name back into the tree. Building the exported root from a throwaway TestFragmentControllerGui avoids touching the cached editor, flushing pending edits with updateCurrentNode() first is right, and carrying the fragment's name over to the exported root is a nice touch.
A couple of things before this can go in:
- AI attribution: ASF does not list AI tools as co-authors. Please replace the
Co-authored-by: Copilot <…>trailer in the commit message with aGenerated-by:trailer, for exampleGenerated-by: GitHub Copilot. See the ASF Generative Tooling guidance. xdocs/changes.xml: please add an entry under Bug fixes › General, for example<li><pr>6934</pr><issue>6170</issue>Keep the name of a Test Fragment when saving it with <code>Save as Test Fragment</code>.</li>, with a "Contributed by" credit and a matching line in the Thanks section.
Minor, non-blocking: the new tests cover setTestFragmentName only; the clearGui() side effect is GUI-bound, so the manual check is fine.
This review was drafted by an AI-assisted tool and
confirmed by an Apache JMeter maintainer. After you've
addressed the points above and pushed an update, an Apache JMeter
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.More on how Apache JMeter handles maintainer review:
Contributing guide.
Fixes apache#6170 Generated-by: GitHub Copilot
ad9ab43 to
da68fba
Compare
milamberspace
left a comment
There was a problem hiding this comment.
Thanks for the quick update! Both points are addressed: the commit now carries a Generated-by: trailer, and changes.xml has the entry and the credit. CI is green. I'll adjust the credit to your full name on master after merging.
This review was drafted by an AI-assisted tool and
confirmed by an Apache JMeter maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache JMeter handles maintainer review:
Contributing guide.
Generated-by: Claude Code 2.1.337 (Claude Opus 5.5)
Description
Saving a Test Fragment now retains its existing name in the open plan and in the exported
.jmxfile. The save operation also avoids clearing the cached fragment editor while constructing the export.Motivation and Context
Fixes #6170. Previously, saving a renamed Test Fragment could reset its UI name to
Test Fragment.How Has This Been Tested?
.\gradlew.bat --quiet :src:components:test --tests org.apache.jmeter.gui.action.TestSave classes style- passed.Screenshots (if appropriate):
Types of changes
Checklist: