Skip to content
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

Add Python tests and GitHub actions workflow #66

Merged
merged 14 commits into from
Jun 26, 2023
Merged

Add Python tests and GitHub actions workflow #66

merged 14 commits into from
Jun 26, 2023

Conversation

duncandewhurst
Copy link
Contributor

@duncandewhurst duncandewhurst commented May 22, 2023

  • Add a GitHub actions workflow to run tests for:
    • Empty JSON files
    • Invalid JSON files
    • Incorrectly formatted JSON files
    • Invalid JSON Schema files
    • Invalid and incorrectly formatted CSV files
  • Add developer documentation that describes what to do if the tests fail
  • Indent JSON files
  • Fix broken refs in schema (where needed, I added empty definitions. I assume that we'll fix these as part of other planned schema changes)
  • Fix incorrectly formatted CSV files

As noted below, some JSON Schema checks are commented out until the issues that they relate to have been addressed:

def validate_json_schema(path, name, data, schema):
errors = 0
errors += validate_schema(path, data, validator)
errors += validate_array_items(path, data)
errors += validate_items_type(path, data)
# Codelist fields are not yet implemented
# errors += validate_codelist_enum(path, data)
errors += validate_merge_properties(path, data)
errors += validate_ref(path, data)
# Titles and descriptions are not yet added
# errors += validate_metadata_presence(path, data)
errors += validate_object_id(path, jsonref.replace_refs(data))
errors += validate_null_type(path, data, no_null=True)
# Here, we don't add to `errors`, in order to not count these warnings as errors.
validate_deep_properties(path, data)

@duncandewhurst duncandewhurst changed the title .github/workflows: Add run-tests.yml Add Python tests and GitHub actions workflow Jun 15, 2023
@duncandewhurst duncandewhurst marked this pull request as ready for review June 15, 2023 04:00
@duncandewhurst duncandewhurst requested review from odscjen and removed request for odscjen June 15, 2023 04:00
@duncandewhurst duncandewhurst marked this pull request as draft June 15, 2023 04:02
@duncandewhurst
Copy link
Contributor Author

Actually, following open-contracting/jscc#8 (comment), I can use the main JSCC repo instead of the fork that I created.

@duncandewhurst duncandewhurst marked this pull request as ready for review June 19, 2023 22:23
odscjen
odscjen previously approved these changes Jun 20, 2023
@odscjen odscjen requested a review from stufraser1 June 20, 2023 14:56
@duncandewhurst
Copy link
Contributor Author

@stufraser1 please could you review this PR? It will be useful to have these tests running on the dev branch before we start merging schema PRs.

@duncandewhurst duncandewhurst merged commit eae9dbb into dev Jun 26, 2023
4 checks passed
@duncandewhurst duncandewhurst deleted the pytest branch June 26, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants