120 Commits

Author SHA1 Message Date
Dan
ef5aca4fe4 ReviewType now comes back with the user studies, so we don't need to make an additional query to get it. 2022-03-18 09:59:10 -04:00
mike cullerton
199fe0626a Assert that if we get null for DATELASTMODIFIED, we use the value in DATECREATED 2022-03-17 15:56:44 -04:00
Dan
2fc4b44ef3 Create a path to directly download the spreadsheet file (and avoid the weird dance on the front end of making an API call to get file data.)
Fixing pagination.  Seems the front end uses a page_index that is 0 based, and sqlAlchemy prefers to start at 1.
2022-03-12 16:19:07 -05:00
mike cullerton
a536a79e87 Test for downloading logs 2022-03-12 14:29:02 -05:00
mike cullerton
ec9ff4ff8a *** WIP ***
Need to finish writing tests
2022-03-10 12:19:41 -05:00
Dan
3442655bd1 Performance Improvements:
1. Avoid ever re-generating the list of scripts that can be used in a script task.  Terribly expensive as we call eval constantly, and it never ever changes once the app starts. (see script.py changes, and comments)
2. Cache the DocumentStatus list in the flask session, so we calculate it at most once per API Call.  It's at least .25 seconds per call.  (see study_sevice)
3. We called UserFileService.get_files_for_study (which runs a db query EVERY time) for every possible document type.  Now we run the query once (study service line 321)
4. When returning a workflow, we looped through every single task in that workflow's navigation, and called the expensive spiff_task_to_api_task just to figure out it's proper display name. We run a much faster and more efficient method to calculate the display name naow (see workflow_service on lie 680, and 799)
5. A hellton of @timeit and sincetime() calls, that I want to leave in, to help debug any slowness on production.
2022-02-24 14:25:42 -05:00
Dan
b72ecb8375 Another re-work to fix 619 - and to assure that we aren't rebuilding the lookup tables too frequently. 2022-02-17 11:59:48 -05:00
Dan
0ad9843569 Dealing with some changes in SpiffWorkflow's latest release. I think this gets all tests passing again, and behaving as expected. 2022-02-16 10:46:46 -05:00
Dan
093741fa90 By default the system will start up the scheduled tasks, which is usually what you want, but in development
it can be kind of irritating for this stuff to be spinning up when you are trying to debug something, so just set
PROCESS_WAITING_TASKS to false in instance/config.py and voila!!
2022-02-15 14:07:09 -05:00
Dan
df3f67601c performance improvements. and last rements of load_example_data() 2022-02-09 23:29:39 -05:00
Dan
788e40a998 death to load_example_data() !!!!! 2022-02-09 22:13:02 -05:00
Dan
f12c4aba52 Refactor the workflow_spec_service so it doesn't cache anything, it always reads what it needs from the file system. 2022-02-09 21:06:55 -05:00
Dan
5773eb99f3 fixing study status. 2022-02-09 12:36:16 -05:00
Dan
de6d7eee84 nearly all study tests work. 2022-02-09 12:03:45 -05:00
Dan
cc915ac25a refactoring the study service. 2022-02-09 08:50:00 -05:00
alicia pritchett
a4fb00b0ed remove bad imports 2022-02-07 15:28:52 -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
mike cullerton
68820c67cb Removed (almost) all references to WorkflowSpecDependencyFile
(There is still a call in the lookup service, but we need to decide how to fix that)
2022-01-19 16:12:54 -05:00
mike cullerton
88a8c96bd6 The reference document is already created in load_example_data
This lead to a failing test after cleaning up the way we add/update files
2022-01-12 15:07:57 -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
9785a2fe5a Updated for new ProtocolBuilderCreatorStudy model and schema
Added with `session.no_autoflush` to stop rollback during test
2021-12-06 14:42:34 -05:00
mike cullerton
d08b2a8562 Updated for new ProtocolBuilderCreatorStudy model and schema
Removed unused imports
2021-12-06 14:40:56 -05: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
fdce91507c Improve the warning messages that come back when running the master workflow spec. 2021-10-07 14:43:38 -04:00
alicia pritchett
ea4e382f06 Fixing some tests 2021-10-06 15:24:58 -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
alicia pritchett
d5d4496cd0 Admin flag on category + migration + updated test 2021-09-29 16:53:59 -04:00
Dan Funk
e4add14193
Merge pull request #378 from sartography/bug/246_user_ldap_refactor
Bug/246 user ldap refactor
2021-09-22 15:31:34 -04:00
Dan Funk
deff293fff
Merge pull request #376 from sartography/bug/468_missing_file_date
fixes #448 - Missing  file date
2021-09-22 15:29:32 -04:00
Dan
19104303de Refactor of the way we store and return details about users - All the details about a user, or individual associated with a study is returned within in an Ldap model. I've removed duplication between these models. This required some cleanup of the tests, and a migration that will drop the user details. 2021-09-22 13:16:25 -04:00
Dan
4b591a076f Adding importlib-resournces as a dependency, which is suddenly failing on Travis, likely due to different versions of Python as I try to upgrade to 3.9 2021-09-21 14:36:57 -04:00
mike cullerton
deb3d7bf67 Updated for short_name and proposal_name
Also cleaned up some for readability
2021-09-17 11:59:02 -04:00
mike cullerton
444e3fa76d Merge branch 'dev' into zip-documents-379 2021-09-14 09:39:19 -04:00
mike cullerton
cd3d17862a Add task_spec_name to a bunch of tests 2021-08-26 10:43:28 -04:00
mike cullerton
35285a0b60 Fixed tests that broke from the new irb_documents spreadsheet 2021-08-26 08:51:52 -04:00
Dan
7a8eeab820 Merge branch 'dev' into bug/missing_pi_name_246 2021-08-17 11:16:03 -04:00
Dan
4e0e162fd6 Removing the execution flag Nile keeps adding to files. 2021-08-17 09:50:57 -04:00
mike cullerton
3f44c202ca Merge branch '417-hsr-open-to-enrollment-bug' into 426-remove-hsr-number 2021-08-16 12:55:24 -04:00
nilez
0a232dace6 assertEquals -> assertEqual 2021-08-16 10:25:41 -04:00
nilez
b9d4f6c436 assertEquals -> assertEqual 2021-08-16 10:18:29 -04:00
nilez
f8dd4c3eb9 Check Study Associates Endpoint 2021-08-16 09:32:02 -04:00
mike cullerton
febcb1ac5b Clarified my comments 2021-08-13 12:36:43 -04:00
mike cullerton
58119c8969 Modified test_get_all_studies so they don't fail looking for studies that are open for enrollment
We will soon have a new way to automatically set study status to `Open for Enrollment`, so I left the failing tests there and commented them out for now.
2021-08-13 12:32:11 -04:00
nilez
e32c1db4c8 Merge remote-tracking branch 'origin/dev' into bug/missing_pi_name_246
# Conflicts:
#	crc/models/study.py
#	crc/services/study_service.py
#	crc/services/workflow_service.py
#	tests/study/test_study_associate_script.py
2021-08-12 12:59:15 -04:00
nilez
d20b68e483 Fixed Deprecation Warnings in Test Files 2021-08-12 12:33:27 -04:00
Dan
848c2e622f Always use a schema to define what is being returned, it enforces consistency of the API and internally we can depend on well defined objects. 2021-08-10 16:16:08 -04:00
NWalker4483
a73d1794eb Fixed Associate API Endpoint description 2021-07-22 14:09:24 -04:00
mike cullerton
69974e89fd Added 2 simple tests for filtering by REVIEW_TYPE 2021-07-09 11:39:30 -04:00
mike cullerton
445d3e5f0b Added mocked pb study_details since we now check whether a study has valid REVIEW_TYPEs 2021-07-09 10:41:46 -04:00