зеркало из https://github.com/microsoft/AzureTRE.git
Fix pipeline uninstalling a parent instead of upgrading it (#2153)
This commit is contained in:
Родитель
1f51b433c7
Коммит
72e5dabc99
|
@ -101,7 +101,7 @@ def extract_properties(body: str) -> RequestProperties:
|
|||
|
||||
|
||||
def is_require_data_copy(new_status: str):
|
||||
if new_status.lower() in [constants.STAGE_SUBMITTED, constants.STAGE_APPROVAL_INPROGRESS, constants.STAGE_REJECTION_INPROGRESS]:
|
||||
if new_status.lower() in [constants.STAGE_SUBMITTED, constants.STAGE_APPROVAL_INPROGRESS, constants.STAGE_REJECTION_INPROGRESS, constants.STAGE_BLOCKING_INPROGRESS]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.0.7"
|
||||
__version__ = "0.0.8"
|
||||
|
|
|
@ -40,9 +40,12 @@ class TestDataCopyProperties(unittest.TestCase):
|
|||
# Testing all values that should return true
|
||||
self.assertEqual(is_require_data_copy("submITted"), True)
|
||||
self.assertEqual(is_require_data_copy("submitted"), True)
|
||||
self.assertEqual(is_require_data_copy("approved"), True)
|
||||
self.assertEqual(is_require_data_copy("REJected"), True)
|
||||
self.assertEqual(is_require_data_copy("blocked"), True)
|
||||
self.assertEqual(is_require_data_copy("approved"), False)
|
||||
self.assertEqual(is_require_data_copy("REJected"), False)
|
||||
self.assertEqual(is_require_data_copy("blocked"), False)
|
||||
self.assertEqual(is_require_data_copy("approval_in_progress"), True)
|
||||
self.assertEqual(is_require_data_copy("rejection_in_progress"), True)
|
||||
self.assertEqual(is_require_data_copy("blocking_in_progress"), True)
|
||||
|
||||
def test_wrong_status_raises_when_getting_storage_account_properties(self):
|
||||
self.assertRaises(Exception, get_source_dest_env_vars, "Miaow", "import")
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.3.27"
|
||||
__version__ = "0.3.28"
|
||||
|
|
|
@ -178,7 +178,7 @@ async def update_status_in_database(resource_repo: ResourceRepository, operation
|
|||
operation_step=next_step,
|
||||
resource_repo=resource_repo,
|
||||
resource_template_repo=resource_template_repo,
|
||||
primary_resource=resource_repo.get_resource_by_id(resource_id), # need to get the resource again as it has been updated
|
||||
primary_resource=resource_repo.get_resource_by_id(operation.resourceId), # need to get the resource again as it has been updated
|
||||
resource_to_update_id=next_step.resourceId,
|
||||
primary_action=operation.action,
|
||||
user=operation.user)
|
||||
|
|
|
@ -21,7 +21,7 @@ APPROVED = AirlockRequestStatus.Approved
|
|||
REJECTION_IN_PROGRESS = AirlockRequestStatus.RejectionInProgress
|
||||
REJECTED = AirlockRequestStatus.Rejected
|
||||
CANCELLED = AirlockRequestStatus.Cancelled
|
||||
BLOCKING_IN_PROGRESS = AirlockRequestStatus.Blocked
|
||||
BLOCKING_IN_PROGRESS = AirlockRequestStatus.BlockingInProgress
|
||||
BLOCKED = AirlockRequestStatus.Blocked
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import copy
|
||||
import json
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import MagicMock, ANY
|
||||
import pytest
|
||||
import uuid
|
||||
|
||||
|
@ -305,12 +305,13 @@ async def test_properties_dont_change_with_no_outputs(app, sb_client, logging_mo
|
|||
repo().update_item_dict.assert_called_once_with(expected_resource.dict())
|
||||
|
||||
|
||||
@patch('service_bus.deployment_status_update.update_resource_for_step')
|
||||
@patch('service_bus.deployment_status_update.OperationRepository')
|
||||
@patch('service_bus.deployment_status_update.ResourceRepository')
|
||||
@patch('service_bus.helpers.ServiceBusClient')
|
||||
@patch('service_bus.deployment_status_update.ServiceBusClient')
|
||||
@patch('fastapi.FastAPI')
|
||||
async def test_multi_step_operation_sends_next_step(app, sb_client, sb_sender_client, repo, operations_repo, multi_step_operation, user_resource_multi, basic_shared_service):
|
||||
async def test_multi_step_operation_sends_next_step(app, sb_client, sb_sender_client, repo, operations_repo, update_resource_for_step, multi_step_operation, user_resource_multi, basic_shared_service):
|
||||
received_message = test_sb_message_multi_step_1_complete
|
||||
received_message["status"] = Status.Deployed
|
||||
service_bus_received_message_mock = ServiceBusReceivedMessageMock(received_message)
|
||||
|
@ -328,8 +329,21 @@ async def test_multi_step_operation_sends_next_step(app, sb_client, sb_sender_cl
|
|||
|
||||
# get the multi-step operation and process it
|
||||
operations_repo().get_operation_by_id.return_value = multi_step_operation
|
||||
update_resource_for_step.return_value = user_resource_multi
|
||||
|
||||
await receive_message_and_update_deployment(app)
|
||||
|
||||
# check the resource is updated as expected
|
||||
update_resource_for_step.assert_called_once_with(
|
||||
operation_step=ANY,
|
||||
resource_repo=ANY,
|
||||
resource_template_repo=ANY,
|
||||
primary_resource=user_resource_multi,
|
||||
resource_to_update_id=multi_step_operation.steps[1].resourceId,
|
||||
primary_action=ANY,
|
||||
user=ANY)
|
||||
repo().get_resource_by_id.assert_called_with(multi_step_operation.resourceId)
|
||||
|
||||
# check the operation is updated as expected
|
||||
expected_operation = copy.deepcopy(multi_step_operation)
|
||||
expected_operation.status = Status.PipelineDeploying
|
||||
|
|
Загрузка…
Ссылка в новой задаче