Skip to content

feat/github-issue-48-django-test-coverage #69

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 22 commits into from
Apr 19, 2025

Conversation

travis-sauer-oltech
Copy link
Collaborator

No description provided.

* Implemented unit tests for JheUser, Organization, Patient, and other models.
* Created test settings and runner for Django tests.
* Removed obsolete test file and added new test structure for better organization.
* Simplified run-name and echo statements for better readability.
* Standardized naming conventions for steps.
* Removed unnecessary comments and emojis for a cleaner output.
…ng tests

* Included a step to locate `manage.py` to ensure the correct directory is accessed for running Django tests.
* Changed the Python setup step to specify version 3.11.
* Ensures compatibility with the latest features and improvements in Django.
…e installing dependencies

* Moved the step to find `manage.py` location above the dependency installation step for better clarity and organization.
* cd into jhe on the Pipenv step
…kflow

* Added necessary environment variables for the Django application.
* Ensured the workflow has all required configurations for testing.
* Changed `run-name` to provide detailed context during workflow execution.
* Removed workflow steps from __init__.py under tests directory
* Improved the formatting of the `run-name` in the GitHub Actions workflow for better readability.
…`Patient`, and related models

* Updated old 'tests.py' file to reflect file's test coverage
*Introduced tests for email verification, and authorization code generation.
* Added organization relationship tests and patient consent scope methods.
* Implemented tests for study and observation functionalities, ensuring robust coverage.
* Changed workflow name to `Django Backend Test` for clarity.
* Updated `run-name` format for better readability.
* Modified test pattern to `test*.py` to ensure all relevant tests are executed.
* Introduced `@override_settings` for in-memory SQLite database in `base_model_tests.py` and `test_model_methods.py`.
* Removed `test_settings.py` as its functionality is now integrated into the test files.
…s.py override

* Introduced a new `test_settings.py` file to configure an in-memory SQLite database for tests.
* Updated the test command in the GitHub Actions workflow to specify the test settings.
* Removed redundant database settings from individual test files to streamline test configuration.
* Changed the test settings reference from `jhe.settings.test` to `jhe.test_settings` in the GitHub Actions workflow.
…Actions

* Added PostgreSQL service with health checks for the test suite.
* Updated database settings to use environment variables for better configuration management.
* Changed database engine from SQLite to PostgreSQL for consistency with production.
* Upgraded the PostgreSQL service image from version 13 to 16 in the GitHub Actions workflow.
* This change ensures compatibility with the latest features and improvements in PostgreSQL.
* Simplified the `for_practitioner_organization_study`, `for_practitioner_organization`, and `for_practitioner_organization_study_patient` methods by:
  - Setting default values for `page` and `pageSize`.
  - Removing redundant checks for "null" values.
* Improved readability and maintainability of the code.
* Removed `--keepdb` option from the test command to ensure a fresh database for each test run.
* Updated comments for clarity regarding coverage testing.
* Disabled migrations for the `oauth2_provider` app to speed up tests.
* This change assumes that the app is already migrated in the main database.
* Adjusted the test command to ensure it uses the correct settings file.
* Prepared for future coverage testing by commenting out the coverage command.
* Adjusted assertions in `test_for_practitioner_organization_study` and `test_count_for_practitioner_organization_study_patient` to allow for zero patients.
* Enhanced `test_practitioner_authorized` to ensure user is linked to the organization before authorization checks.
* Improved `test_count_for_practitioner_organization_study_patient` to create necessary study and consent for accurate testing.
* Changed the workflow trigger branches from `feat/github-issue-48-django-test-coverage` to `main` for both push and pull_request events.
* Ensured consistency in the workflow execution context.
@travis-sauer-oltech travis-sauer-oltech merged commit 893d639 into main Apr 19, 2025
2 checks passed
@travis-sauer-oltech travis-sauer-oltech deleted the feat/github-issue-48-django-test-coverage branch April 19, 2025 19:56
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.

1 participant