Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ This project adheres to [Semantic Versioning](https://semver.org/). Version numb
- **MINOR**: New features that are backward-compatible.
- **PATCH**: Bug fixes or minor changes that do not affect backward compatibility.

## [1.9.14]

_released 06-19-2025

### Fixed
- Fixed an issue where test cases are not created in sections specified by --section-id
- Test cases not being added when using --case-ids in add_run module

## [1.9.13]

_released 06-11-2025
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ trcli
```
You should get something like this:
```
TestRail CLI v1.9.13
TestRail CLI v1.9.14
Copyright 2025 Gurock Software GmbH - www.gurock.com
Supported and loaded modules:
- parse_junit: JUnit XML Files (& Similar)
Expand All @@ -45,7 +45,7 @@ CLI general reference
--------
```shell
$ trcli --help
TestRail CLI v1.9.13
TestRail CLI v1.9.14
Copyright 2025 Gurock Software GmbH - www.gurock.com
Usage: trcli [OPTIONS] COMMAND [ARGS]...

Expand Down Expand Up @@ -266,7 +266,7 @@ will be used to upload all results into the same test run.
### Reference
```shell
$ trcli add_run --help
TestRail CLI v1.9.13
TestRail CLI v1.9.14
Copyright 2025 Gurock Software GmbH - www.gurock.com
Usage: trcli add_run [OPTIONS]

Expand All @@ -280,8 +280,8 @@ Options:
--run-assigned-to-id The ID of the user the test run should be assigned
to. [x>=1]
--run-include-all Use this option to include all test cases in this test run.
--case-ids Comma separated list of test case IDs to include in
the test run.
--run-case-ids Comma separated list of test case IDs to include in
the test run (i.e.: 1,2,3,4).
--run-refs A comma-separated list of references/requirements
-f, --file Write run title and id to file.
--help Show this message and exit.
Expand Down
2 changes: 1 addition & 1 deletion trcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.9.13"
__version__ = "1.9.14"
13 changes: 13 additions & 0 deletions trcli/api/api_request_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,20 @@ def check_missing_section_ids(self, project_id: int) -> Tuple[bool, str]:
returned_sections, error_message = self.__get_all_sections(project_id, suite_id)
if not error_message:
missing_test_sections = False
sections_by_id = {section["id"]: section for section in returned_sections}
sections_by_name = {section["name"]: section for section in returned_sections}
section_data = []
for section in self.suites_data_from_provider.testsections:
if self.environment.section_id:
if section.section_id in sections_by_id.keys():
section_json = sections_by_id[section.section_id]
section_data.append({
"section_id": section_json["id"],
"suite_id": section_json["suite_id"],
"name": section_json["name"],
})
else:
missing_test_sections = True
if section.name in sections_by_name.keys():
section_json = sections_by_name[section.name]
section_data.append({
Expand Down Expand Up @@ -384,6 +395,7 @@ def add_run(
assigned_to_id: int = None,
include_all: bool = False,
refs: str = None,
case_ids: List[int] = None,
) -> Tuple[int, str]:
"""
Creates a new test run.
Expand All @@ -393,6 +405,7 @@ def add_run(
"""
add_run_data = self.data_provider.add_run(
run_name,
case_ids=case_ids,
milestone_id=milestone_id,
assigned_to_id=assigned_to_id,
include_all=include_all,
Expand Down
1 change: 1 addition & 0 deletions trcli/api/project_based_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def create_or_update_test_run(self) -> Tuple[int, str]:
assigned_to_id=self.environment.run_assigned_to_id,
include_all=bool(self.environment.run_include_all),
refs=self.environment.run_refs,
case_ids=self.environment.run_case_ids,
)
run_id = added_run
else:
Expand Down
5 changes: 3 additions & 2 deletions trcli/commands/cmd_add_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ def write_run_to_file(environment: Environment, run_id: int):
help="Use this option to include all test cases in this test run."
)
@click.option(
"--case-ids",
"--run-case-ids",
metavar="",
help="Comma separated list of test case IDs to include in the test run."
type=lambda x: [int(i) for i in x.split(",")],
help="Comma separated list of test case IDs to include in the test run (i.e.: 1,2,3,4)."
)
@click.option(
"--run-refs",
Expand Down