Commit Graph

219 Commits

Author SHA1 Message Date
Dan d64853fa5b two passing tests around the WorkflowSpecService 2022-02-07 13:34:13 -05:00
Dan 056f901f9a WIP - its just caos right now. 2022-02-07 12:59:48 -05:00
Dan ad095aaaf5 don't try to load the workflowspecservice too early. 2022-02-07 12:38:00 -05:00
Dan abc17a8aff load the workflow_spec_service from app to avoid frequent file scans. 2022-02-07 12:30:20 -05:00
Dan 1c384a78e9 the tests kind of try and run now ... 2022-02-07 12:18:32 -05:00
Dan ff9b2694ae Fix migrations that depend on removed models. 2022-02-07 11:56:22 -05:00
Dan ed07907ee2 at least allow the tests to spin up, even if they all fail. 2022-02-07 11:00:19 -05:00
Dan 2383c7d76d WIP - lots of random changes, trying to swtich over 2022-02-04 14:50:31 -05:00
Dan 6765afbd02 WIP - Move the categories and specifications out of the database. 2022-02-04 13:51:39 -05:00
Dan 4ec6e403f5 1. Created a UserFileService, so it's clear what we use when for File Services, UserFiles, SpecFiles, and ReferenceFiles each function differently.
2. Reference Files and Spec Files are written to disk, they do not exist in the database at all.
2022-02-02 12:59:56 -05:00
Dan 4c00a5762f partial commit - new spec_file_service, and new spec_file_api endpoints that use spec and file name, not file id.
removed worklow_sync
cleaned up file and workflow models
most of the test are broken.
2022-01-28 06:42:37 -05:00
Dan Funk 97c29bf77c
Merge pull request #449 from sartography/files-to-filesystem-572
Files to filesystem 572
2022-01-26 10:11:26 -05:00
mike cullerton 6f31a26772 Better description 2022-01-24 11:06:01 -05:00
mike cullerton 2ecf6cdf86 Validation is the right way to test this. 2022-01-24 11:03:49 -05:00
mike cullerton 73e250a54c Test for missing library hint in the error message 2022-01-24 10:35:11 -05:00
mike cullerton 91fa44b2ab ** WIP **
Committing so I can work on another ticket.
2022-01-21 14:37:11 -05:00
mike cullerton 7e5f2a7d6a We no longer use versioning for spec files 2022-01-12 15:09:03 -05:00
mike cullerton b99ed73951 Remove unused imports 2022-01-12 15:00:26 -05:00
mike cullerton 4df2ed6ce4 *** WIP ***
Failing tests, and missing functionality.
Committing to get stuff on Github.
2022-01-11 15:30:22 -05:00
mike cullerton dc27f795c8 *** WIP ***
Committing because it is Friday afternoon, and my computer is acting flaky
2022-01-07 15:34:51 -05:00
Dan f129509802 Looks like reording the deletes allows us to remove workflow specs a little easier. Tested this with libraries, and seems to work ok. 2021-12-20 14:36:45 -05:00
alicia pritchett 0e28d2c5f5 Fix a test 2021-12-10 12:16:39 -05:00
Dan Funk 0cfa59bfea
Merge pull request #429 from sartography/chore/clear-form-data-553
Fixes #553 - Don't load Form data
2021-12-08 10:37:44 -05:00
Dan ffafc1674a assure we don't overwrite task data with a previous form submission if that data already exists. 2021-12-07 17:04:20 -05:00
mike cullerton 4ea3682dd6 Updated for new ProtocolBuilderCreatorStudy model and schema
Removed unused imports
2021-12-06 14:43:07 -05:00
alicia pritchett 22320efad4 test for this ticket 2021-12-03 12:23:57 -05:00
Dan 676321c2e2 Fixing a test. 2021-11-30 12:55:52 -05:00
Dan ad93b5fae6 We were not correctly handing the possibility of there only being a waiting task (and no ready tasks).
We also had a problem with the validator throwing a 500 when it was trying tell us it would never finish validation.
2021-11-30 12:44:35 -05:00
Dan b12e178288 Fixing a failing test. 2021-11-17 14:12:15 -05:00
alicia pritchett 1866e6bba9 Fixes validation for #518
Well really what this does is give every field a default value of None. what that does is allow you to use value expressions even without a given default value. this part in the backend fixes validation.
2021-11-01 14:35:30 -04:00
Dan 539174d4c4 drop unused method 2021-10-21 14:02:19 -04:00
Dan 5429e7da7d All enumerated lists used in web forms should contain a single value, not a dictionary of value/labels.
Removing the spreadsheet.value.column and data.value.column so we just have value.column for both.
Improving the __str__ function in the ApiError class, to make debugging a little easier.
Adding a "validate_all" flask command, to help us track down any issues with current workflows in production (use this in concert with sync_with_testing)
Fixed logs of tests.
removed fact_runner.py, a very early and crufty bit of code.
2021-10-19 10:13:43 -04:00
Dan Funk a39e0ba219
Merge pull request #390 from sartography/varchar-category-id-483
Varchar category id #483
2021-10-07 12:23:56 -04:00
mike cullerton da894219c5 Changes to tests after removing `name` column from `workflow_spec` and `workflow_spec_category` tables. 2021-10-05 14:20:03 -04:00
Dan b02731df17 Add some additional checks in the workflow service so we assure the data we are creating during validation can be serialized and deserialized just as it would be through the API. (Was hanging us up on dates)
Assure that if we generate a default value for a date in the task data, it is stored as an ISO String.

remove any unserializable data from the task_data when an error is encountered, rather than just dropping all the task_data. This case seems to happen a lot and it leaves us with nothing to go on.
2021-10-04 15:07:47 -04:00
Dan Funk f898d6f502
Merge pull request #385 from sartography/ids-approval-validation-478
Ids approval validation #478
2021-09-30 13:59:26 -04:00
Dan Funk 0353161402
Merge branch 'dev' into feature/381_validate_field_types 2021-09-30 13:19:36 -04:00
mike cullerton 2067c7226a Better test. Actually grab data explicitly from the list in Element Documentation 2021-09-30 12:54:03 -04:00
mike cullerton 7676e230e5 Test and bpmn for enum checkbox 2021-09-30 12:10:47 -04:00
Dan 8e00f16eaa Assure that the field type provided is supported. Catches errors such as adding a custom field type of 'text_area' rather than "textarea" 2021-09-29 11:43:08 -04:00
mike cullerton fb9c3e96ac Test and mocked status data for adding master workflow into validation.
Make sure we see ApiError for disabled workflow spec
2021-09-24 11:08:54 -04:00
mike cullerton 9aadaac0df Test to make sure we do not set a category_id for library workflow specs 2021-09-13 16:16:05 -04:00
mike cullerton 5ddff1d1be Merge branch 'dev' into add-reorder-api-endpoints-444 2021-09-09 13:10:54 -04:00
mike cullerton a35d122a03 Tests for case where we have bad display_order numbers.
I.e., 0, 1, 1, 1
2021-09-08 11:18:06 -04:00
mike cullerton e6a2b9d642 New test and BPMN for changes 2021-08-31 16:18:29 -04:00
mike cullerton 86583aa2d6 Be explicit about loading sample data
Add category_id when checking order
2021-08-31 12:19:45 -04:00
mike cullerton cfd8f3fe74 Test for reordering remaining spec categories after delete 2021-08-30 15:21:42 -04:00
mike cullerton e317b59bfe Test for reordering workflow specs upon deletion 2021-08-30 14:57:16 -04:00
mike cullerton c99080845b renamed a test 2021-08-30 13:56:27 -04:00
mike cullerton dfe967d578 Tests for reordering categories 2021-08-30 13:56:13 -04:00
mike cullerton d43eb4d6f8 Tests for workflow spec reordering 2021-08-30 12:35:57 -04:00
mike cullerton 543fc1fb4a Start of tests for new reorder API endpoint
Modified example_data to include a display_order for example spec
2021-08-27 13:04:11 -04:00
mike cullerton cd3d17862a Add task_spec_name to a bunch of tests 2021-08-26 10:43:28 -04:00
nilez b9d4f6c436 assertEquals -> assertEqual 2021-08-16 10:18:29 -04:00
mike cullerton e0096ebc8e Test and BPMN to make sure we don't process when field is hidden, but do process when field is not hidden 2021-08-11 16:44:45 -04:00
Kelly McDonald 25319a0e6a Make changes to alembic process - fix test for new API 2021-08-02 08:59:24 -04:00
mike cullerton 097dd9f9a3 Included the failing test, with self.assertRaises
Reworded some of the comments
2021-07-28 11:22:45 -04:00
Kelly McDonald 217e61eed3 next_task returns the next available task, except when the task is completed when it returns the EndEvent -
The problem was that it was returning the first EndEvent it found, not the last one. This caused a problem when we had a CallActivity which has its own EndEvent.

Fixes #399
2021-07-27 09:19:08 -04:00
mike cullerton 2c892560ad Failing test for Call Activity End Events - Ticket 399 2021-07-26 12:12:01 -04:00
Dan 2a45f2fcda Merge branch 'dev' into add-name-error-hint-8 2021-07-07 11:24:00 -04:00
Dan fb54edac1c Adding additional details to error messages, and cleaning up the cruft around these messages to keep them clear and succinct.
Most noteable is the addition of the line on which the error occurs for script tasks.  It will report the line number and pass back the content of
the line that failed.
The validator only returns the first error it encounters, as it's clear that all we ever get right now is two of the same error.
Did a lot of work between this and spiffworkflow to remove all the places where we obfuscate or drop details as we converted between workflowExceptions and APIExceptions.
Dropped the python levenshtein dependency, in favor of just rolling a simple one ourselves in Spiffworkflow.
2021-07-07 00:53:49 -04:00
mike cullerton 2a43230121 Test and workflow for the new name error hint code 2021-07-01 15:39:25 -04:00
Dan Funk 19d63e2aa2
Merge pull request #328 from sartography/restart-workflow-programmatically-347
Restart workflow programmatically #347
2021-06-17 10:36:46 -04:00
Dan a4caae8d64 when validating, we need to take every step to remove the workflows we create during the validation. 2021-06-16 14:40:20 -04:00
mike cullerton 94e730d04e Test script validation 2021-06-15 11:15:31 -04:00
mike cullerton addf1cab5b Added tests for failing conditions 2021-06-15 10:30:18 -04:00
mike cullerton 9e20025f33 Test and workflow for reset_workflow 2021-06-15 08:37:42 -04:00
mike cullerton 9dc5871848 Added mocked PB data for tests using study_info script. 2021-06-07 10:08:44 -04:00
mike cullerton 37ba46fb8f These tests now require PB Mock because of the validate_study_id changes 2021-06-03 14:30:00 -04:00
Dan ef7ee284b2 Prefer tasks that share a parent over just the the next available task when returning the next_task in the workflow processor. 2021-05-19 16:26:16 -04:00
Dan Funk ade7812540
Merge pull request #310 from sartography/get-primary-workflow-301
Get primary workflow #301
2021-05-14 12:41:48 -04:00
mike cullerton 4c8ea14435 Fixed test - changed the method name 2021-05-12 14:07:54 -04:00
mike cullerton 8f8d9d30e4 Added test for get_primary_workflow 2021-05-12 13:52:18 -04:00
mike cullerton 67321ecd97 Test and workflow for persisting read-only data 2021-05-07 14:07:19 -04:00
mike cullerton 09d8c8bcba added missing test for update_workflow_spec_category 2021-04-26 12:57:08 -04:00
mike cullerton 0aa3e8f586 added missing test for add_workflow_spec_category 2021-04-26 12:41:50 -04:00
mike cullerton b73c2ff1cb Added missing test for `get_workflow_from_workflow_spec` 2021-04-26 12:00:06 -04:00
Mike Cullerton 39fcab3730
Merge branch 'dev' into launch-workflow-outside-study-204 2021-04-26 10:27:32 -04:00
mike cullerton 7cca559747 Fixed issue where we were passing in a workflow_api instead of a workflow when completing a form in tests. 2021-04-26 08:58:09 -04:00
mike cullerton c002ef1e76 Added test for new api endpoint to get all standalone workflow_specs.
Modified test_add_new_workflow_specification to include new standalone argument
2021-04-26 08:56:21 -04:00
mike cullerton 2d4a68da6d Added test for deleting files on restart. 2021-04-15 11:30:17 -04:00
Dan 6427a54d74 Set the correct default value on enumerations - if it is a multi-select enum (checkbox is set) then it should return a default value of an empty array, and not a dictionary. 2021-04-09 08:40:58 -04:00
mike cullerton 5155db89f9 Added test for deleting multiple files.
Fixed existing tests to accommodate changes to test workflow bpmn file
2021-04-05 15:13:32 -04:00
mike cullerton 33cef2bd2a Added tests for failing conditions 2021-04-05 13:19:29 -04:00
mike cullerton 9317e49e65 Merge branch 'dev' into delete-uploaded-file-script-283 2021-04-05 10:40:33 -04:00
mike cullerton d81497f8cb Test and workflow for new script to delete IRB documents 2021-04-05 08:55:41 -04:00
Dan dcb4e7b736 fixing an error by taking a bit of the magic out of one of Mike's regex hinting tools. I figure the hint is still good, and a little less bittle, and all the information is already there if people need to dig. 2021-04-02 17:58:27 -04:00
Dan 2100f27976 fixing the api.yml file which was starting to throw errors when updating the libraries.
Seems that sqlalchemy now has a hard time incrementing sequences, so putting in a fix for this.
Upgrading many of our libraries, to avoid any disconnects as we try to handle security patches from these automated bumps.
2021-04-02 17:10:05 -04:00
mike cullerton c4b52f85af Test and workflow for testing infinite loop code. 2021-03-17 14:52:50 -04:00
Dan 6f80d816cd My privous efforts didn't take into account the fact that we use dot notation in field names.
I've re-worked the workflow form endpoint, so that it only accepts the data that should be in the form, and ignores any other values that come back from the front end.  It seems Formly has some bugs that were introducing confusing information, and I want everything to behave consistently.
I had to re-work some of the tests, which were relying on an ability to set data through a form post without having a corresponding form to do so.
2021-03-14 12:20:39 -04:00
Dan 576aebab19 Sometimes a workflow can be completely broken and unloadable. For instance, it starts off with a engine step / script task that will not execute. So the failure happens the second it is processed. When calling reset on a workflow, we should catch the failure, and reset the workflow, so we aren't trapped in an unrecoverable state.
To do so, I changed the WorkflowProcessor's reset method to be static, it will try to instantiate the current workflow and execute a cancel_notify event, but if that fails, it will continue and always return a new workflow processor using the latest spec.
2021-03-09 11:52:55 -05:00
Dan 36dcc58705 Merge branch 'dev' of github.com:sartography/cr-connect-workflow into dev 2021-03-08 14:00:14 -05:00
Dan 291216e081 Fixing a bug that prevented proper evaluation of a enum field where the default value was null or empty. 2021-03-08 14:00:03 -05:00
mike cullerton f883eb2bbe We now include field.id in the ApiError message for hidden and default validation. (The field must have a default value or value expression)
While working on this ticket I found a logic error in the test. I expected both default_value and value_expression. It turns out the default_value is always there, it's just null if we don't set it.

Modified the existing test for hidden and required, and added tests to make sure my passing logic is now correct.
2021-03-04 10:42:13 -05:00
mike cullerton 9a2ffb98ad Customer Error is in a place that we can try it out on testing.
So far, there are two known errors.
 - Missing condition type (Ticket 178)
 - Invalid property value in extensions tab for display_name (No ticket for this error)

We now have the option of using regular expressions to pull task_id, etc. from an error to pass back to the user in the hint.
2021-03-01 16:41:55 -05:00
mike cullerton 9d804c36d5 Merge branch 'dev' into customer-error-messages-192.
Needed some sql changes from dev
2021-03-01 10:29:10 -05:00
mike cullerton f937ac3ce9 Getting some thoughts down for the extension property error. This might force us to use regexes for the error service.
Committing so I can work on another branch.
2021-02-24 10:56:25 -05:00
mike cullerton e0de1d0b3b Fixed 3 tests to reflect a change in crc.api.workflow.validate_workflow_specification.
Added a '\n' to the error message between the actual error and our preamble.
2021-02-19 15:55:40 -05:00
mike cullerton 446bff9c8c Modified test for missing default value on hidden and required fields to check for task_id and task_name 2021-02-15 16:28:51 -05:00
mike cullerton 34700568ee Added a test for allowing periods in field ids 2021-02-15 16:28:21 -05:00