-
Notifications
You must be signed in to change notification settings - Fork 36
#1248 Specify define xml path in operations #1649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0568b2c
#1248 Draft solution to bypass Excel sheet processing
alexfurmenkov 1343804
#1248 added define_xml_path parameter to operations
alexfurmenkov 8554b93
Merge branch 'refs/heads/main' into 1248-fix-define-variable-metadata
alexfurmenkov 4b8fe99
#1248 regression test and fixed when no define path provided to opera…
alexfurmenkov 3d5eb7d
#1248 prettier
alexfurmenkov 5c2b35d
Merge branch 'main' into 1248-fix-define-variable-metadata
RamilCDISC 8e8d761
#1248 rolled back changes in excel_data_service. additional tests.
alexfurmenkov fd00355
Merge remote-tracking branch 'origin/1248-fix-define-variable-metadat…
alexfurmenkov b0747b4
Merge branch 'main' into 1248-fix-define-variable-metadata
RamilCDISC 7343679
#1248 moved define contents read to base operation
alexfurmenkov 043ae09
Merge branch 'main' into 1248-fix-define-variable-metadata
gerrycampion 6e838ed
Merge branch 'main' into 1248-fix-define-variable-metadata
RamilCDISC 63e4f80
Merge branch 'main' into 1248-fix-define-variable-metadata
alexfurmenkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
186 changes: 186 additions & 0 deletions
186
tests/QARegressionTests/test_Issues/test_CoreIssue1248.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| import os | ||
| import subprocess | ||
|
|
||
| import pytest | ||
| import json | ||
| from conftest import get_python_executable | ||
|
|
||
|
|
||
| @pytest.mark.regression | ||
| class TestCoreIssue1248: | ||
| @pytest.mark.parametrize( | ||
| "command,rules_report,num_issues", | ||
| [ | ||
| # define path provided will lead to successful execution | ||
| ( | ||
| [ | ||
| f"{get_python_executable()}", | ||
| "-m", | ||
| "core", | ||
| "validate", | ||
| "-s", | ||
| "sdtmig", | ||
| "-v", | ||
| "3-2", | ||
| "-of", | ||
| "JSON", | ||
| "-lr", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "sample.yml"), | ||
| "-cs", | ||
| "-dxp", | ||
| os.path.join( | ||
| "tests", | ||
| "resources", | ||
| "CoreIssue1248", | ||
| "define_subfolder", | ||
| "define.xml", | ||
| ), | ||
| "-ps", | ||
| "1", | ||
| "-dp", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "data.xlsx"), | ||
| ], | ||
| [ | ||
| { | ||
| "core_id": "SD1129", | ||
| "version": "1", | ||
| "cdisc_rule_id": "", | ||
| "fda_rule_id": "", | ||
| "message": "TEST", | ||
| "status": "ISSUE REPORTED", | ||
| } | ||
| ], | ||
| 2, | ||
| ), | ||
| # JSON data file and no define.xml in same folder and no -dxp param will provide error | ||
| ( | ||
| [ | ||
| f"{get_python_executable()}", | ||
| "-m", | ||
| "core", | ||
| "validate", | ||
| "-s", | ||
| "sdtmig", | ||
| "-v", | ||
| "3-2", | ||
| "-of", | ||
| "JSON", | ||
| "-lr", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "sample.yml"), | ||
| "-cs", | ||
| "-dp", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "relrec.json"), | ||
| "-ps", | ||
| "1", | ||
| ], | ||
| [ | ||
| { | ||
| "core_id": "SD1129", | ||
| "version": "1", | ||
| "cdisc_rule_id": "", | ||
| "fda_rule_id": "", | ||
| "message": "TEST", | ||
| "status": "EXECUTION ERROR", | ||
| } | ||
| ], | ||
| 1, | ||
| ), | ||
| # no define.xml in same path as data.xlsx file will provide error | ||
| ( | ||
| [ | ||
| f"{get_python_executable()}", | ||
| "-m", | ||
| "core", | ||
| "validate", | ||
| "-s", | ||
| "sdtmig", | ||
| "-v", | ||
| "3-2", | ||
| "-of", | ||
| "JSON", | ||
| "-lr", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "sample.yml"), | ||
| "-cs", | ||
| "-dp", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "data.xlsx"), | ||
| "-ps", | ||
| "1", | ||
| ], | ||
| [ | ||
| { | ||
| "core_id": "SD1129", | ||
| "version": "1", | ||
| "cdisc_rule_id": "", | ||
| "fda_rule_id": "", | ||
| "message": "TEST", | ||
| "status": "EXECUTION ERROR", | ||
| } | ||
| ], | ||
| 1, | ||
| ), | ||
| # define.xml in same folder as the data.xls and no -dxp provided will provide error until | ||
| # in ExcelDataService dataset metadata creation full_path=dataset_name | ||
| ( | ||
| [ | ||
| f"{get_python_executable()}", | ||
| "-m", | ||
| "core", | ||
| "validate", | ||
| "-s", | ||
| "sdtmig", | ||
| "-v", | ||
| "3-2", | ||
| "-of", | ||
| "JSON", | ||
| "-lr", | ||
| os.path.join("tests", "resources", "CoreIssue1248", "sample.yml"), | ||
| "-cs", | ||
| "-dp", | ||
| os.path.join( | ||
| "tests", | ||
| "resources", | ||
| "CoreIssue1248", | ||
| "data_and_define", | ||
| "data.xlsx", | ||
| ), | ||
| "-ps", | ||
| "1", | ||
| ], | ||
| [ | ||
| { | ||
| "core_id": "SD1129", | ||
| "version": "1", | ||
| "cdisc_rule_id": "", | ||
| "fda_rule_id": "", | ||
| "message": "TEST", | ||
| "status": "EXECUTION ERROR", | ||
| } | ||
| ], | ||
| 1, | ||
| ), | ||
| ], | ||
| ) | ||
| def test_define_path_used(self, command, rules_report, num_issues): | ||
| subprocess.run(command, check=True) | ||
|
|
||
| # Get the latest created report file | ||
| files = os.listdir() | ||
| json_files = [ | ||
| file | ||
| for file in files | ||
| if file.startswith("CORE-Report-") and file.endswith(".json") | ||
| ] | ||
| json_report_path = sorted(json_files)[-1] | ||
| # Open the JSON report file | ||
| json_report = json.load(open(json_report_path)) | ||
| assert { | ||
| "Conformance_Details", | ||
| "Dataset_Details", | ||
| "Issue_Summary", | ||
| "Issue_Details", | ||
| "Rules_Report", | ||
| }.issubset(json_report.keys()) | ||
| assert len(json_report["Issue_Details"]) == num_issues | ||
| assert json_report["Rules_Report"] == rules_report | ||
| if os.path.exists(json_report_path): | ||
| os.remove(json_report_path) |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add a test with no -dxp flag supplied to verify the case of getting define from dataset path also.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work without the
-dxpflag until changes are made toExcelDataServicerelated to commentor changes to
self.rule_processor.perform_rule_operationscall should be made, sodataset_metadata.full_pathcontaining in our caserelrec.xptvalue will pass something else