From 9c280c2eaad14fa4d1493d200adb3f02c3b62ee2 Mon Sep 17 00:00:00 2001 From: Manju R Date: Tue, 25 Aug 2026 14:35:11 +0530 Subject: [PATCH] fix: lower max batch size from 2000 to 200 TMS-196 lowers the bulk-results API cap to 200 results per request. - BatchConfig.set_size now rejects a size above 200; the message wording also matches the check, which previously said "less than 2000" while testing for "> 2000" - Both TestOps reporters clamp with min(200, ...) instead of min(2000, ...) - pytest and robotframework UPGRADE docs state the 1-200 range Co-Authored-By: Claude Opus 5 (1M context) --- qase-pytest/docs/UPGRADE.md | 2 +- qase-python-commons/src/qase/commons/models/config/batch.py | 4 ++-- qase-python-commons/src/qase/commons/reporters/testops.py | 2 +- .../src/qase/commons/reporters/testops_multi.py | 2 +- qase-robotframework/docs/UPGRADE.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qase-pytest/docs/UPGRADE.md b/qase-pytest/docs/UPGRADE.md index 21d77907..20b30994 100644 --- a/qase-pytest/docs/UPGRADE.md +++ b/qase-pytest/docs/UPGRADE.md @@ -17,7 +17,7 @@ In v5, two configuration options defined how the reporter was uploading results `testops.bulk` and `testops.chunk`. In v6, reporter always sends results in portions, called batches. -Default batch size is 200, and can be set to anything from 1 to 2000. +Default batch size is 200, and can be set to anything from 1 to 200. Update the config in the following way: ```diff diff --git a/qase-python-commons/src/qase/commons/models/config/batch.py b/qase-python-commons/src/qase/commons/models/config/batch.py index 2fa83f44..8639a6cf 100644 --- a/qase-python-commons/src/qase/commons/models/config/batch.py +++ b/qase-python-commons/src/qase/commons/models/config/batch.py @@ -8,6 +8,6 @@ def __init__(self): self.size = 200 def set_size(self, size: int): - if size > 2000 or size == 0: - raise ValueError("Batch size should be greater than 0 and less than 2000") + if size > 200 or size == 0: + raise ValueError("Batch size should be greater than 0 and no greater than 200") self.size = size diff --git a/qase-python-commons/src/qase/commons/reporters/testops.py b/qase-python-commons/src/qase/commons/reporters/testops.py index d7fd1262..1284c48c 100644 --- a/qase-python-commons/src/qase/commons/reporters/testops.py +++ b/qase-python-commons/src/qase/commons/reporters/testops.py @@ -32,7 +32,7 @@ def __init__(self, config: QaseConfig, logger: Logger, client: BaseApiClient) -> self.complete_after_run = self.config.testops.run.complete self.environment = None - self.batch_size = min(2000, max(1, int(self.config.testops.batch.size or DEFAULT_BATCH_SIZE))) + self.batch_size = min(200, max(1, int(self.config.testops.batch.size or DEFAULT_BATCH_SIZE))) self.send_semaphore = threading.Semaphore(DEFAULT_THREAD_COUNT) # Semaphore to limit concurrent sends self.lock = threading.Lock() self.count_running_threads = 0 diff --git a/qase-python-commons/src/qase/commons/reporters/testops_multi.py b/qase-python-commons/src/qase/commons/reporters/testops_multi.py index 8138e7dd..3b72eae9 100644 --- a/qase-python-commons/src/qase/commons/reporters/testops_multi.py +++ b/qase-python-commons/src/qase/commons/reporters/testops_multi.py @@ -22,7 +22,7 @@ def __init__(self, config: QaseConfig, logger: Logger, client: BaseApiClient) -> self.client = client self.multi_config = config.testops_multi - self.batch_size = min(2000, max(1, int(self.config.testops.batch.size or DEFAULT_BATCH_SIZE))) + self.batch_size = min(200, max(1, int(self.config.testops.batch.size or DEFAULT_BATCH_SIZE))) self.send_semaphore = threading.Semaphore(DEFAULT_THREAD_COUNT) self.lock = threading.Lock() self.count_running_threads = 0 diff --git a/qase-robotframework/docs/UPGRADE.md b/qase-robotframework/docs/UPGRADE.md index bc6ff12a..bbb11c47 100644 --- a/qase-robotframework/docs/UPGRADE.md +++ b/qase-robotframework/docs/UPGRADE.md @@ -40,7 +40,7 @@ In v3, two configuration options defined how the reporter was uploading results `testops.bulk` and `testops.chunk`. In v3, reporter always sends results in portions, called batches. -Default batch size is 200, and can be set to anything from 1 to 2000. +Default batch size is 200, and can be set to anything from 1 to 200. Update the config in the following way: ```diff