Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Dec 3, 2023
1 parent bc7dd82 commit 0a34e7c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
14 changes: 7 additions & 7 deletions tests/integration/client/orkes/test_orkes_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def run(self) -> None:
self.test_secret_lifecycle()
self.test_scheduler_lifecycle(workflowDef)
self.test_application_lifecycle()
self.test_user_group_permissions_lifecycle(workflowDef)
self.__test_unit_test_workflow()
self.test_user_group_permissions_lifecycle(workflowDef)

def test_workflow_lifecycle(self, workflowDef, workflow):
self.__test_register_workflow_definition(workflowDef)
Expand Down Expand Up @@ -451,8 +451,8 @@ def __test_task_tags(self):
def __test_workflow_tags(self):
singleTag = MetadataTag("wftag", "val")

self.metadata_client.addWorkflowTag(singleTag, WORKFLOW_NAME)
fetchedTags = self.metadata_client.getWorkflowTags(WORKFLOW_NAME)
self.metadata_client.add_workflow_tag(singleTag, WORKFLOW_NAME)
fetchedTags = self.metadata_client.get_workflow_tags(WORKFLOW_NAME)
assert len(fetchedTags) == 1
assert fetchedTags[0].key == singleTag.key

Expand All @@ -462,13 +462,13 @@ def __test_workflow_tags(self):
MetadataTag("wftag3", "val3")
]

self.metadata_client.setWorkflowTags(tags, WORKFLOW_NAME)
fetchedTags = self.metadata_client.getWorkflowTags(WORKFLOW_NAME)
self.metadata_client.set_workflow_tags(tags, WORKFLOW_NAME)
fetchedTags = self.metadata_client.get_workflow_tags(WORKFLOW_NAME)
assert len(fetchedTags) == 3

tag = MetadataTag("wftag2", "val2")
self.metadata_client.deleteWorkflowTag(tag, WORKFLOW_NAME)
assert (len(self.metadata_client.getWorkflowTags(WORKFLOW_NAME))) == 2
self.metadata_client.delete_workflow_tag(tag, WORKFLOW_NAME)
assert (len(self.metadata_client.get_workflow_tags(WORKFLOW_NAME))) == 2

def __test_workflow_rate_limit(self):
assert self.metadata_client.getWorkflowRateLimit(WORKFLOW_NAME) == None
Expand Down
25 changes: 11 additions & 14 deletions tests/integration/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sys

from conductor.client.configuration.configuration import Configuration
from conductor.client.configuration.settings.authentication_settings import AuthenticationSettings
from conductor.client.http.api_client import ApiClient
from conductor.client.workflow.executor.workflow_executor import WorkflowExecutor
from metadata.test_workflow_definition import run_workflow_definition_tests
from workflow.test_workflow_execution import run_workflow_execution_tests
from client.orkes.test_orkes_clients import TestOrkesClients
from workflow.test_workflow_execution import run_workflow_execution_tests
from metadata.test_workflow_definition import run_workflow_definition_tests
from client import test_async

import logging
import sys
import os

_logger = logging.getLogger(
Expand Down Expand Up @@ -40,25 +40,22 @@ def generate_configuration():
key_secret=envs['SECRET']
)
configuration = Configuration(**params)
configuration.debug = False
configuration.apply_logging_config()

return configuration


def main():
args = sys.argv[1:]
configuration = generate_configuration()
api_client = ApiClient(configuration)
workflow_executor = WorkflowExecutor(configuration)

if len(args) == 1 and args[0] == '--orkes-clients-only':
TestOrkesClients(configuration=configuration).run()
elif len(args) == 1 and args[0] == '--workflow-execution-only':
run_workflow_execution_tests(configuration, workflow_executor)
else:
test_async.test_async_method(api_client)
run_workflow_definition_tests(workflow_executor)
run_workflow_execution_tests(configuration, workflow_executor)
TestOrkesClients(configuration=configuration).run()
test_async.test_async_method(api_client)
run_workflow_definition_tests(workflow_executor)
run_workflow_execution_tests(configuration, workflow_executor)
TestOrkesClients(configuration=configuration).run()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tests/integration/workflow/test_workflow_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run_workflow_execution_tests(configuration: Configuration, workflow_executor
configuration=configuration,
scan_for_annotated_workers=True,
)
set_start_method('fork')
set_start_method('fork', force=True)
task_handler.start_processes()
try:
test_get_workflow_by_correlation_ids(workflow_executor)
Expand Down

0 comments on commit 0a34e7c

Please sign in to comment.