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
2 changes: 1 addition & 1 deletion testit-adapter-behave/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

VERSION = "4.2.6"
VERSION = "4.2.7"

setup(
name='testit-adapter-behave',
Expand Down
2 changes: 1 addition & 1 deletion testit-adapter-nose/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = "4.2.6"
VERSION = "4.2.7"

setup(
name='testit-adapter-nose',
Expand Down
2 changes: 1 addition & 1 deletion testit-adapter-pytest/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

VERSION = "4.2.6"
VERSION = "4.2.7"

setup(
name='testit-adapter-pytest',
Expand Down
2 changes: 1 addition & 1 deletion testit-adapter-robotframework/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

VERSION = "4.2.6"
VERSION = "4.2.7"

setup(
name='testit-adapter-robotframework',
Expand Down
2 changes: 1 addition & 1 deletion testit-python-commons/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

VERSION = "4.2.6"
VERSION = "4.2.7"

setup(
name='testit-python-commons',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ def update_test_results(self, fixtures_containers: dict, test_result_ids: dict)
test_results = Converter.fixtures_containers_to_test_results_with_all_fixture_step_results(
fixtures_containers, test_result_ids)

if not test_results:
return

for test_result in test_results:
model = Converter.convert_test_result_with_all_setup_and_teardown_steps_to_test_results_id_put_request(
test_result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ def fixtures_containers_to_test_results_with_all_fixture_step_results(
test_result_with_all_fixture_step_results.set_teardown_results(
fixtures_container.afters[0].steps)

test_results_with_all_fixture_step_results.append(test_result_with_all_fixture_step_results)
if (test_result_with_all_fixture_step_results.get_setup_results()
or test_result_with_all_fixture_step_results.get_teardown_results()):
test_results_with_all_fixture_step_results.append(test_result_with_all_fixture_step_results)

return test_results_with_all_fixture_step_results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ def write_tests(self) -> None:

@adapter_logger
def __load_setup_and_teardown_step_results(self) -> None:
self.__api_client.update_test_results(
self.__fixture_manager.get_all_items(), self.__test_result_map
)
fixtures = self.__fixture_manager.get_all_items()
if not fixtures:
return

self.__api_client.update_test_results(fixtures, self.__test_result_map)

@adapter_logger
def __write_tests_after_all(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SyncStorageRunner:
across multiple workers.
"""

SYNC_STORAGE_VERSION = "v0.3.6-tms-5.7"
SYNC_STORAGE_VERSION = "v0.3.7-tms-5.7"
SYNC_STORAGE_REPO_URL = (
"https://github.com/testit-tms/sync-storage-public/releases/download/"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from unittest.mock import Mock

from testit_python_commons.client.converter import Converter
from testit_python_commons.models.outcome_type import OutcomeType
from testit_python_commons.models.step_result import StepResult
Expand All @@ -20,3 +22,15 @@ def test_setup_teardown_put_request_does_not_include_step_results():
assert len(model.setup_results) == 1
assert len(model.setup_results[0].step_results) == 1
assert model.setup_results[0].step_results[0].title == 'child'


def test_fixtures_converter_skips_tests_without_fixture_steps():
fixtures_container = Mock()
fixtures_container.external_ids = ['other-test']

result = Converter.fixtures_containers_to_test_results_with_all_fixture_step_results(
{'uuid': fixtures_container},
{'test-1': 'result-1'},
)

assert result == []
10 changes: 10 additions & 0 deletions testit-python-commons/tests/services/test_adapter_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ def test_write_tests_realtime_import_enabled(self, adapter_manager, mock_adapter
)
mock_api_client_worker.write_tests.assert_not_called()

def test_write_tests_realtime_skips_update_without_fixtures(
self, adapter_manager, mock_adapter_config, mock_api_client_worker, mock_fixture_manager):
mock_adapter_config.should_import_realtime.return_value = True
mock_fixture_manager.get_all_items.return_value = {}

adapter_manager.write_tests()

mock_fixture_manager.get_all_items.assert_called_once()
mock_api_client_worker.update_test_results.assert_not_called()

def test_load_attachments(self, adapter_manager, mock_api_client_worker):
attach_paths = ["path/to/attachment1.txt", "path/to/attachment2.jpg"]
expected_result = ["id1", "id2"]
Expand Down
2 changes: 1 addition & 1 deletion update_versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

NEW_VERSION="4.2.6"
NEW_VERSION="4.2.7"
TESTIT_API_CLIENT_VERSION="7.5.10"

echo "Updating all adapters to version: $NEW_VERSION"
Expand Down
Loading