Custom Metadata Feature#5685
Open
febb0e wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for per-test-case metadata end-to-end (parsing → running model → result model → XML output → Rebot → log/report JS model + HTML rendering).
Changes:
- Parse
[Metadata]in test cases and store it on running/resultTestCasemodels. - Persist test metadata in output.xml (
<meta name="...">value</meta>) and read it back. - Expose test metadata in JS log model, update log.html template, and add acceptance tests.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| utest/reporting/test_jsmodelbuilders.py | Updates expected JS model structure to include metadata for tests. |
| src/robot/running/suiterunner.py | Passes parsed test metadata into the execution result test object. |
| src/robot/running/model.py | Extends running test model constructor to carry metadata. |
| src/robot/running/builder/transformers.py | Collects per-test metadata during parsing/model transformation. |
| src/robot/result/xmlelementhandlers.py | Allows <meta> children under <test> when building results from XML. |
| src/robot/result/model.py | Extends result test model constructor to accept metadata. |
| src/robot/reporting/jsmodelbuilders.py | Emits test metadata into the JS model used by logs/reports. |
| src/robot/parsing/lexer/settings.py | Enables Metadata setting within test case settings. |
| src/robot/output/xmllogger.py | Writes test metadata into output.xml as <meta> elements. |
| src/robot/model/testcase.py | Adds metadata to the data model and includes it in to_dict(). |
| src/robot/htmldata/rebot/testdata.js | Parses metadata from the JS model and shifts indices accordingly. |
| src/robot/htmldata/rebot/model.js | Stores parsed metadata on the JS Test object. |
| src/robot/htmldata/rebot/log.html | Renders test metadata rows in the log. |
| atest/testdata/output/testcase_metadata.robot | New test data exercising [Metadata] in test cases. |
| atest/robot/output/testcase_metadata.robot | New acceptance tests covering model, XML, Rebot, and log rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
152
to
157
| self._resolve_setting(data.tags), | ||
| self._get_timeout(data), | ||
| data.lineno, | ||
| metadata=data.metadata.copy(), | ||
| start_time=datetime.now(), | ||
| ) |
Comment on lines
+283
to
+288
| {{each metadata}} | ||
| <tr> | ||
| <th>{{html $value[0]}}:</th> | ||
| <td class="doc">{{html $value[1]}}</td> | ||
| </tr> | ||
| {{/each}} |
Comment on lines
215
to
+219
| data["doc"] = self.doc | ||
| if self.tags: | ||
| data["tags"] = tuple(self.tags) | ||
| if self.metadata: | ||
| data["metadata"] = self.metadata |
| tags: "Tags | Sequence[str]" = (), | ||
| timeout: "str | None" = None, | ||
| lineno: "int | None" = None, | ||
| metadata: "dict | None" = None, |
| return Tags(tags) | ||
|
|
||
| @setter | ||
| def metadata(self, metadata: "dict|None") -> Metadata: |
Member
|
Makes #5495 obsolete |
This was referenced Jun 15, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #4409
Overview
Add support for testcase metadata via the normal test setting syntax:
[Metadata] Name ValueThis metadata is now carried through execution, written to
output.xml, parsed back from XML, into the log.What changed
Metadata.running+result) now includesmetadataon test cases.<meta name="...">...</meta>under each<test>.<meta>entries.Compatibility
Tests
Added acceptance suite for the core flow:
output.xmlrebotprocessingNotes
This change is only about explicit
[Metadata]in test cases.It does not introduce custom bracket settings like
[Owner]or a new CLI filtering flag.Usage example