From b7c6a6c1754d9b9725faaac80b65acef28928781 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:26:32 -0800 Subject: [PATCH 01/20] Update bot.yaml From 241cd561fda0cbeae30523328a7891f92ed5f305 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:27:11 -0800 Subject: [PATCH 02/20] Update bot.yaml From 69f3a6e5b4cde7dc73c8ad8014c81524c93705f3 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:28:04 -0800 Subject: [PATCH 03/20] Update cli.py --- caltechdata_api/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/caltechdata_api/cli.py b/caltechdata_api/cli.py index b0e9c00..d5c6f56 100644 --- a/caltechdata_api/cli.py +++ b/caltechdata_api/cli.py @@ -58,7 +58,7 @@ def decrypt_token(encrypted_token, key): return f.decrypt(encrypted_token).decode() -# Function to get or set token with support for test systems +# Function to get or set token with support for test system. def get_or_set_token(production=True): # First check for environment variable env_token = os.environ.get("CALTECHDATA_TOKEN") @@ -68,7 +68,7 @@ def get_or_set_token(production=True): key = load_or_generate_key() - # Use different token files for production and test environment + # Use different token files for production and test environment. token_filename = "token.txt" if production else "token_test.txt" token_file = os.path.join(caltechdata_directory, token_filename) @@ -609,6 +609,7 @@ def create_record(production): print_upload_message(rec_id, production) with open(response + ".json", "w") as file: json.dump(metadata, file, indent=2) + exit() break else: break From 17041d7cb4c4f41adf395369cad49e0fdbf45978 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:29:07 -0800 Subject: [PATCH 04/20] Update customize_schema.py --- caltechdata_api/customize_schema.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index d3bfbf9..62a2796 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -508,11 +508,11 @@ def validate_metadata(json_record): if creator["nameType"] == "Organizational": if "name" not in creator: errors.append("Each organizational 'creator' must have 'name'.") - else: - if "familyName" not in creator: - errors.append( - "Each 'creator' must have a 'familyName' or have type Organizational" - ) + #else: + # if "familyName" not in creator: + # errors.append( + # "Each 'creator' must have a 'familyName' or have type Organizational" + # ) if "affiliation" in creator: if not isinstance(creator["affiliation"], list): errors.append("'affiliation' in 'creators' should be a list.") @@ -539,11 +539,11 @@ def validate_metadata(json_record): errors.append( "Each organizational 'contributor' must have 'name'." ) - else: - if "familyName" not in contributor: - errors.append( - "Each 'contributor' must have a 'familyName' or have type Organizational" - ) + #else: + #if "familyName" not in contributor: + # errors.append( + # "Each 'contributor' must have a 'familyName' or have type Organizational" + # ) if "affiliation" in contributor: if not isinstance(contributor["affiliation"], list): errors.append( From d937dbd829c61005936e2c7c51ede1033cb17807 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:32:58 -0800 Subject: [PATCH 05/20] Update bot_yaml.py --- tests/bot_yaml.py | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/bot_yaml.py b/tests/bot_yaml.py index fe3d489..e2bb4e6 100644 --- a/tests/bot_yaml.py +++ b/tests/bot_yaml.py @@ -56,28 +56,29 @@ def import_cli_module(self): cli_module = importlib.util.module_from_spec(spec) spec.loader.exec_module(cli_module) return cli_module - + def generate_test_responses(self): - """Generate test responses for CLI prompts""" - return { - "Do you want to create or edit a CaltechDATA record? (create/edit): ": "create", - "Do you want to use metadata from an existing file or create new metadata? (existing/create): ": "create", - "Enter the title of the dataset: ": f"Test Dataset {self.timestamp}", - "Enter the abstract or description of the dataset: ": "This is an automated test dataset containing sample climate data for validation purposes.", - "Enter the number corresponding to the desired license: ": "1", - "Enter your ORCID identifier: ": os.environ.get( - "TEST_ORCID", "0000-0002-1825-0097" - ), - "How many funding entries do you want to provide? ": "1", - "Enter the award number for funding: ": "NSF-1234567", - "Enter the award title for funding: ": "Automated Testing Grant", - "Enter the funder ROR (https://ror.org): ": "021nxhr62", - "Do you want to upload or link data files? (upload/link/n): ": "upload", - "Enter the filename to upload as a supporting file (or 'n' to finish): ": "test_data.csv", - "Do you want to add more files? (y/n): ": "n", - "Do you want to send this record to CaltechDATA? (y/n): ": "y", - } - + """Generate test responses for CLI prompts""" + return { + "What would you like to do? (create/edit/profile/exit): ": "create", + "Do you want to use metadata from an existing file or create new metadata? (existing/create): ": "create", + "Enter the title of the dataset: ": f"Test Dataset {self.timestamp}", + "Enter the abstract or description of the dataset: ": "This is an automated test dataset containing sample climate data for validation purposes.", + "Enter the number corresponding to the desired license: ": "1", + "Use saved profile? (y/n): ": "n", + "Enter your ORCID identifier: ": os.environ.get( + "TEST_ORCID", "0000-0002-1825-0097" + ), + "How many funding entries do you want to provide? ": "1", + "Enter the award number for funding: ": "NSF-1234567", + "Enter the award title for funding: ": "Automated Testing Grant", + "Enter the funder ROR (https://ror.org): ": "021nxhr62", + "Do you want to upload or link data files? (upload/link/n): ": "upload", + "Enter the filename to upload as a supporting file (or 'n' to finish): ": "test_data.csv", + "Do you want to add more files? (y/n): ": "n", + "Do you want to send this record to CaltechDATA? (y/n): ": "y", + } + def run_test_submission(self): """Run the complete test submission process""" try: From 7d6afcfac922560f2fe3097996e8a337d38998dd Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:33:33 -0800 Subject: [PATCH 06/20] Update test_rdm.py --- tests/test_rdm.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/test_rdm.py b/tests/test_rdm.py index 2dd0fcd..fff39bc 100644 --- a/tests/test_rdm.py +++ b/tests/test_rdm.py @@ -5,17 +5,19 @@ get_metadata, ) import json +import os def test_datacite_rdm_conversion(full_datacite43_record, full_rdm_record): - converted = customize_schema(full_datacite43_record, schema="43", pilot=True) + converted = customize_schema(full_datacite43_record, schema="43") assert converted == full_rdm_record def test_datacite_rdm_create_edit(full_datacite43_record): + env_token = os.environ.get("CALTECHDATA_TOKEN") doi = caltechdata_write( - full_datacite43_record, schema="43", pilot=True, publish=True + full_datacite43_record, schema="43", production=False, publish=True, token=env_token ) assert doi.startswith("10.33569") @@ -23,28 +25,29 @@ def test_datacite_rdm_create_edit(full_datacite43_record): doi = caltechdata_write( full_datacite43_record, schema="43", - pilot=True, + production=False, files=["codemeta.json"], publish=True, + token=env_token ) assert doi.startswith("10.33569") # If we don't publish, don't get back a DOI - idv = caltechdata_write(full_datacite43_record, schema="43", pilot=True) + idv = caltechdata_write(full_datacite43_record, schema="43", production=False, token=env_token) assert idv.startswith("10.33569") == False full_datacite43_record["publisher"] = "Edited" doi = caltechdata_edit( - idv, full_datacite43_record, schema="43", pilot=True, publish=True + idv, full_datacite43_record, schema="43", production=False, publish=True, token=env_token ) assert doi.startswith("10.33569") idv = doi.split("/")[1] - new_metadata = get_metadata(idv, production=False, pilot=True) + new_metadata = get_metadata(idv, production=False, publish=True) assert new_metadata["publisher"] == "Edited" @@ -55,14 +58,15 @@ def test_datacite_rdm_create_edit(full_datacite43_record): full_datacite43_record, files=["codemeta.json"], schema="43", - pilot=True, + production=False, publish=True, + token=env_token ) assert new_doi != doi idv = new_doi.split("/")[1] - new_metadata = get_metadata(idv, production=False, pilot=True) + new_metadata = get_metadata(idv, production=False) assert new_metadata["publisher"] == "Again!" From 9916a90cd0355a6d5f1fab620cfc590d3d0713f2 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:31:50 -0800 Subject: [PATCH 07/20] Update test_rdm.py --- tests/test_rdm.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/test_rdm.py b/tests/test_rdm.py index fff39bc..85940c6 100644 --- a/tests/test_rdm.py +++ b/tests/test_rdm.py @@ -17,7 +17,11 @@ def test_datacite_rdm_conversion(full_datacite43_record, full_rdm_record): def test_datacite_rdm_create_edit(full_datacite43_record): env_token = os.environ.get("CALTECHDATA_TOKEN") doi = caltechdata_write( - full_datacite43_record, schema="43", production=False, publish=True, token=env_token + full_datacite43_record, + schema="43", + production=False, + publish=True, + token=env_token, ) assert doi.startswith("10.33569") @@ -28,20 +32,27 @@ def test_datacite_rdm_create_edit(full_datacite43_record): production=False, files=["codemeta.json"], publish=True, - token=env_token + token=env_token, ) assert doi.startswith("10.33569") # If we don't publish, don't get back a DOI - idv = caltechdata_write(full_datacite43_record, schema="43", production=False, token=env_token) + idv = caltechdata_write( + full_datacite43_record, schema="43", production=False, token=env_token + ) assert idv.startswith("10.33569") == False full_datacite43_record["publisher"] = "Edited" doi = caltechdata_edit( - idv, full_datacite43_record, schema="43", production=False, publish=True, token=env_token + idv, + full_datacite43_record, + schema="43", + production=False, + publish=True, + token=env_token, ) assert doi.startswith("10.33569") @@ -60,7 +71,7 @@ def test_datacite_rdm_create_edit(full_datacite43_record): schema="43", production=False, publish=True, - token=env_token + token=env_token, ) assert new_doi != doi From a04057102ed9477b66abb234d2e1d6f88ac5fb1f Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:33:41 -0800 Subject: [PATCH 08/20] Update cli.py --- caltechdata_api/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caltechdata_api/cli.py b/caltechdata_api/cli.py index d5c6f56..3e99fde 100644 --- a/caltechdata_api/cli.py +++ b/caltechdata_api/cli.py @@ -609,7 +609,7 @@ def create_record(production): print_upload_message(rec_id, production) with open(response + ".json", "w") as file: json.dump(metadata, file, indent=2) - exit() + exit() break else: break From db96fe97fc9e183a75a86b380de16784fb3198ac Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:34:03 -0800 Subject: [PATCH 09/20] Update customize_schema.py --- caltechdata_api/customize_schema.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index 62a2796..bcb1a5e 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -508,7 +508,7 @@ def validate_metadata(json_record): if creator["nameType"] == "Organizational": if "name" not in creator: errors.append("Each organizational 'creator' must have 'name'.") - #else: + # else: # if "familyName" not in creator: # errors.append( # "Each 'creator' must have a 'familyName' or have type Organizational" @@ -539,11 +539,11 @@ def validate_metadata(json_record): errors.append( "Each organizational 'contributor' must have 'name'." ) - #else: - #if "familyName" not in contributor: - # errors.append( - # "Each 'contributor' must have a 'familyName' or have type Organizational" - # ) + # else: + # if "familyName" not in contributor: + # errors.append( + # "Each 'contributor' must have a 'familyName' or have type Organizational" + # ) if "affiliation" in contributor: if not isinstance(contributor["affiliation"], list): errors.append( From 186e68c079d9eead8fe26a35b98d79e7778baba0 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:35:21 -0800 Subject: [PATCH 10/20] Update bot.yaml --- .github/workflows/bot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index eafab97..475b6dc 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -38,7 +38,7 @@ jobs: - name: Run CaltechDATA Metadata Validation env: - CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }} + RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} run: | python tests/bot_yaml.py - name: Run Unit Tests From aef04926fd8f1208572949441bdc0cff80571ab0 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:37:22 -0800 Subject: [PATCH 11/20] Update bot_yaml.py --- tests/bot_yaml.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/bot_yaml.py b/tests/bot_yaml.py index e2bb4e6..0a2162e 100644 --- a/tests/bot_yaml.py +++ b/tests/bot_yaml.py @@ -56,29 +56,29 @@ def import_cli_module(self): cli_module = importlib.util.module_from_spec(spec) spec.loader.exec_module(cli_module) return cli_module - + def generate_test_responses(self): - """Generate test responses for CLI prompts""" - return { - "What would you like to do? (create/edit/profile/exit): ": "create", - "Do you want to use metadata from an existing file or create new metadata? (existing/create): ": "create", - "Enter the title of the dataset: ": f"Test Dataset {self.timestamp}", - "Enter the abstract or description of the dataset: ": "This is an automated test dataset containing sample climate data for validation purposes.", - "Enter the number corresponding to the desired license: ": "1", - "Use saved profile? (y/n): ": "n", - "Enter your ORCID identifier: ": os.environ.get( - "TEST_ORCID", "0000-0002-1825-0097" - ), - "How many funding entries do you want to provide? ": "1", - "Enter the award number for funding: ": "NSF-1234567", - "Enter the award title for funding: ": "Automated Testing Grant", - "Enter the funder ROR (https://ror.org): ": "021nxhr62", - "Do you want to upload or link data files? (upload/link/n): ": "upload", - "Enter the filename to upload as a supporting file (or 'n' to finish): ": "test_data.csv", - "Do you want to add more files? (y/n): ": "n", - "Do you want to send this record to CaltechDATA? (y/n): ": "y", - } - + """Generate test responses for CLI prompts""" + return { + "What would you like to do? (create/edit/profile/exit): ": "create", + "Do you want to use metadata from an existing file or create new metadata? (existing/create): ": "create", + "Enter the title of the dataset: ": f"Test Dataset {self.timestamp}", + "Enter the abstract or description of the dataset: ": "This is an automated test dataset containing sample climate data for validation purposes.", + "Enter the number corresponding to the desired license: ": "1", + "Use saved profile? (y/n): ": "n", + "Enter your ORCID identifier: ": os.environ.get( + "TEST_ORCID", "0000-0002-1825-0097" + ), + "How many funding entries do you want to provide? ": "1", + "Enter the award number for funding: ": "NSF-1234567", + "Enter the award title for funding: ": "Automated Testing Grant", + "Enter the funder ROR (https://ror.org): ": "021nxhr62", + "Do you want to upload or link data files? (upload/link/n): ": "upload", + "Enter the filename to upload as a supporting file (or 'n' to finish): ": "test_data.csv", + "Do you want to add more files? (y/n): ": "n", + "Do you want to send this record to CaltechDATA? (y/n): ": "y", + } + def run_test_submission(self): """Run the complete test submission process""" try: From 36a349b04af1f85fd98d41e5ec5f342d62db1ecc Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:44:16 -0800 Subject: [PATCH 12/20] Update customize_schema.py --- caltechdata_api/customize_schema.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index bcb1a5e..ea38dc9 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -508,11 +508,11 @@ def validate_metadata(json_record): if creator["nameType"] == "Organizational": if "name" not in creator: errors.append("Each organizational 'creator' must have 'name'.") - # else: - # if "familyName" not in creator: - # errors.append( - # "Each 'creator' must have a 'familyName' or have type Organizational" - # ) + else: + if "familyName" not in creator: + errors.append( + "Each 'creator' must have a 'familyName' or have type Organizational" + ) if "affiliation" in creator: if not isinstance(creator["affiliation"], list): errors.append("'affiliation' in 'creators' should be a list.") From ff8d20a9d6f9cd9d196bf2bbfa571ff3178d8f14 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:46:28 -0800 Subject: [PATCH 13/20] Update bot.yaml --- .github/workflows/bot.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index 475b6dc..758bef7 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -36,13 +36,13 @@ jobs: pip install pytest requests s3fs cryptography pip install . - - name: Run CaltechDATA Metadata Validation + - name: Run against CaltechData Test system env: RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} run: | - python tests/bot_yaml.py - - name: Run Unit Tests + pytest test_unit.py + - name: Run Medata Validation Test and RDM run: | cd tests - pytest test_unit.py + python tests/bot_yaml.py pytest test_rdm.py From d4262082c72a658fba5e8a33eb9283288a33debf Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:47:27 -0800 Subject: [PATCH 14/20] Update customize_schema.py --- caltechdata_api/customize_schema.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index ea38dc9..743c62c 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -539,11 +539,11 @@ def validate_metadata(json_record): errors.append( "Each organizational 'contributor' must have 'name'." ) - # else: - # if "familyName" not in contributor: - # errors.append( - # "Each 'contributor' must have a 'familyName' or have type Organizational" - # ) + else: + if "familyName" not in contributor: + errors.append( + "Each 'contributor' must have a 'familyName' or have type Organizational" + ) if "affiliation" in contributor: if not isinstance(contributor["affiliation"], list): errors.append( From a80ea5ac3b1a7db9f45a955eac51e7e713c0b5bc Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:48:11 -0800 Subject: [PATCH 15/20] Update bot.yaml --- .github/workflows/bot.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index 758bef7..2ebf50d 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -41,8 +41,9 @@ jobs: RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} run: | pytest test_unit.py + pytest test_rdm.py - name: Run Medata Validation Test and RDM run: | cd tests python tests/bot_yaml.py - pytest test_rdm.py + From ec5f1b390efac89c8d90d8c1472f0a4fd674b6e0 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:50:09 -0800 Subject: [PATCH 16/20] Update customize_schema.py --- caltechdata_api/customize_schema.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index 743c62c..519342c 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -508,11 +508,11 @@ def validate_metadata(json_record): if creator["nameType"] == "Organizational": if "name" not in creator: errors.append("Each organizational 'creator' must have 'name'.") - else: - if "familyName" not in creator: - errors.append( - "Each 'creator' must have a 'familyName' or have type Organizational" - ) + else: + if "familyName" not in creator: + errors.append( + "Each 'creator' must have a 'familyName' or have type Organizational" + ) if "affiliation" in creator: if not isinstance(creator["affiliation"], list): errors.append("'affiliation' in 'creators' should be a list.") @@ -539,11 +539,11 @@ def validate_metadata(json_record): errors.append( "Each organizational 'contributor' must have 'name'." ) - else: - if "familyName" not in contributor: - errors.append( - "Each 'contributor' must have a 'familyName' or have type Organizational" - ) + else: + if "familyName" not in contributor: + errors.append( + "Each 'contributor' must have a 'familyName' or have type Organizational" + ) if "affiliation" in contributor: if not isinstance(contributor["affiliation"], list): errors.append( From c521bfe21e2dda41a48d92d541dcf2fe328cd557 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:53:57 -0800 Subject: [PATCH 17/20] Update bot.yaml --- .github/workflows/bot.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index 2ebf50d..eebcaee 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -43,7 +43,9 @@ jobs: pytest test_unit.py pytest test_rdm.py - name: Run Medata Validation Test and RDM + env: + RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} run: | cd tests - python tests/bot_yaml.py + python bot_yaml.py From 57435f38fc2c09fbb4e829907ee75894536de231 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:54:31 -0800 Subject: [PATCH 18/20] Update test_rdm.py --- tests/test_rdm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rdm.py b/tests/test_rdm.py index 85940c6..ddd94fd 100644 --- a/tests/test_rdm.py +++ b/tests/test_rdm.py @@ -15,7 +15,7 @@ def test_datacite_rdm_conversion(full_datacite43_record, full_rdm_record): def test_datacite_rdm_create_edit(full_datacite43_record): - env_token = os.environ.get("CALTECHDATA_TOKEN") + env_token = os.environ.get("RDMTOK") doi = caltechdata_write( full_datacite43_record, schema="43", From 1613945fed1502effc9d1f98728e7ecb6b14fd07 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:57:25 -0800 Subject: [PATCH 19/20] Update bot.yaml --- .github/workflows/bot.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index eebcaee..eafab97 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -36,16 +36,13 @@ jobs: pip install pytest requests s3fs cryptography pip install . - - name: Run against CaltechData Test system + - name: Run CaltechDATA Metadata Validation env: - RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} + CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }} run: | - pytest test_unit.py - pytest test_rdm.py - - name: Run Medata Validation Test and RDM - env: - RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} + python tests/bot_yaml.py + - name: Run Unit Tests run: | cd tests - python bot_yaml.py - + pytest test_unit.py + pytest test_rdm.py From 104f7ccb584b37e013de7e39b057d789e2ba0475 Mon Sep 17 00:00:00 2001 From: RohanBhattaraiNP <152933030+RohanBhattaraiNP@users.noreply.github.com> Date: Fri, 7 Feb 2025 12:00:50 -0800 Subject: [PATCH 20/20] Update bot.yaml --- .github/workflows/bot.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml index eafab97..e05d105 100644 --- a/.github/workflows/bot.yaml +++ b/.github/workflows/bot.yaml @@ -36,13 +36,17 @@ jobs: pip install pytest requests s3fs cryptography pip install . - - name: Run CaltechDATA Metadata Validation + - name: Run against CaltechData Test system env: - CALTECHDATA_TOKEN: ${{ secrets.CALTECHDATA_TOKEN }} - run: | - python tests/bot_yaml.py - - name: Run Unit Tests + RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} run: | cd tests pytest test_unit.py pytest test_rdm.py + - name: Run Medata Validation Test and RDM + env: + RDMTOK: ${{ secrets.CALTECHDATA_TOKEN }} + run: | + cd tests + python bot_yaml.py +