pyl w/ burnettk

This commit is contained in:
jasquat 2023-01-19 15:03:33 -05:00
parent b529af6142
commit 5ef4ea7b62
3 changed files with 10 additions and 12 deletions

View File

@ -5,5 +5,6 @@ environment_identifier_for_this_config_file_only = environ["SPIFFWORKFLOW_BACKEN
OPEN_ID_SERVER_URL = f"https://keycloak.{environment_identifier_for_this_config_file_only}.spiffworkflow.org/realms/sartography" OPEN_ID_SERVER_URL = f"https://keycloak.{environment_identifier_for_this_config_file_only}.spiffworkflow.org/realms/sartography"
GIT_BRANCH = environ.get("GIT_BRANCH", default="main") GIT_BRANCH = environ.get("GIT_BRANCH", default="main")
GIT_CLONE_URL_FOR_PUBLISHING = environ.get( GIT_CLONE_URL_FOR_PUBLISHING = environ.get(
"GIT_CLONE_URL", default="https://github.com/sartography/sartography-process-models.git" "GIT_CLONE_URL",
default="https://github.com/sartography/sartography-process-models.git",
) )

View File

@ -1,10 +1,9 @@
"""Test_process_instance_processor.""" """Test_process_instance_processor."""
import os
from flask.app import Flask from flask.app import Flask
from spiffworkflow_backend.models.spiff_logging import SpiffLoggingModel
from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.base_test import BaseTest
from tests.spiffworkflow_backend.helpers.test_data import load_test_spec from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
from spiffworkflow_backend.models.spiff_logging import SpiffLoggingModel
from spiffworkflow_backend.models.user import UserModel from spiffworkflow_backend.models.user import UserModel
from spiffworkflow_backend.services.process_instance_processor import ( from spiffworkflow_backend.services.process_instance_processor import (
ProcessInstanceProcessor, ProcessInstanceProcessor,
@ -21,9 +20,6 @@ class TestProcessInstanceService(BaseTest):
with_super_admin_user: UserModel, with_super_admin_user: UserModel,
) -> None: ) -> None:
"""Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity.""" """Test_does_not_log_set_data_when_calling_engine_steps_on_waiting_call_activity."""
tmp_file = '/tmp/testfile.txt'
if os.path.isfile(tmp_file):
os.remove(tmp_file)
process_model = load_test_spec( process_model = load_test_spec(
process_model_id="test_group/call-activity-to-human-task", process_model_id="test_group/call-activity-to-human-task",
process_model_source_directory="call-activity-to-human-task", process_model_source_directory="call-activity-to-human-task",
@ -34,13 +30,14 @@ class TestProcessInstanceService(BaseTest):
processor = ProcessInstanceProcessor(process_instance) processor = ProcessInstanceProcessor(process_instance)
processor.do_engine_steps(save=True) processor.do_engine_steps(save=True)
process_instance_logs = SpiffLoggingModel.query.filter_by(process_instance_id=process_instance.id).all() process_instance_logs = SpiffLoggingModel.query.filter_by(
process_instance_id=process_instance.id
).all()
initial_length = len(process_instance_logs) initial_length = len(process_instance_logs)
# logs should NOT increase after running this a second time since it's just waiting on a human task # logs should NOT increase after running this a second time since it's just waiting on a human task
print("HEY NOW")
with open(tmp_file, 'w') as f:
f.write("HEY")
processor.do_engine_steps(save=True) processor.do_engine_steps(save=True)
process_instance_logs = SpiffLoggingModel.query.filter_by(process_instance_id=process_instance.id).all() process_instance_logs = SpiffLoggingModel.query.filter_by(
process_instance_id=process_instance.id
).all()
assert len(process_instance_logs) == initial_length assert len(process_instance_logs) == initial_length