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

Application upgrade to SQLAlchemy, Pytest #346

Merged
merged 186 commits into from
Feb 20, 2025

Conversation

benjwadams
Copy link
Contributor

@benjwadams benjwadams commented May 10, 2024

Draft commit for migration to SQLAlchemy and moves application to application factory pattern for better reusability and testing.

Adds support for BDD testing via pytest-bdd, see example feature files. Example tests extend #343 by implementing these tests.

This is still a work in progress and not complete, but represents a large effort to modernize the DAC architecture.

benjwadams and others added 30 commits April 12, 2024 13:27
Uses application factory pattern.

Moves over to SQLAlchemy from MongoKit.
Removes BerkeleyDB for user authentication, instead using User model
to store password.  FTP PAM authentication methods will need to be
updated to use SQL instead.
Adds a model attribute/DB column for whether CF Standard names
are all compliant after Compliance Checker runs.  Also updates NCEI
archival scripts to utilize this column as part of the criteria
prior to determining whether datasets should be archived by NCEI.
Removes a non-functioning dataset removal task which didn't properly get
queued up due to Flask application context error.  In theory even for
removing many files from the web application from a delayed mode
dataset the operation should not take much time and deletions are not a
common occurrence.  If needed can be fixed and re-added later.
Adds feature file for example scenarios with deployments.
Tests are currently not implemented for these feature files
but will likely be implemented later using pytest-bdd.
Adds BDD testing steps for glider deployment creation, ensuring
that a user can create a deployment successfully, have an email
sent out to Glider DAC group, and ensure the proper filesystem
directory and file structure is created for the dataset.
@benjwadams
Copy link
Contributor Author

benjwadams commented Jan 27, 2025

Almost there, just need to mock the Redis connection now.

EDIT: Didn't end up doing this, instead opting to use a Redis instance for testing in GHA.

@benjwadams
Copy link
Contributor Author

benjwadams commented Jan 28, 2025

It worked!! 🎆

Could have potentially run the Redis dependency as another container, but I opted to use the Redis GitHub action instead.

@benjwadams benjwadams marked this pull request as ready for review January 28, 2025 18:48
@benjwadams benjwadams changed the title Draft application upgrade to SQLAlchemy, Pytest Application upgrade to SQLAlchemy, Pytest Jan 29, 2025
pre-commit-ci bot and others added 6 commits February 3, 2025 21:57
updates:
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1)
Bumps [gautamkrishnar/keepalive-workflow](https://github.com/gautamkrishnar/keepalive-workflow) from 2.0.8 to 2.0.9.
- [Release notes](https://github.com/gautamkrishnar/keepalive-workflow/releases)
- [Commits](gautamkrishnar/keepalive-workflow@995aec6...75c5933)

---
updated-dependencies:
- dependency-name: gautamkrishnar/keepalive-workflow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…mkrishnar/keepalive-workflow-2.0.9

Bump gautamkrishnar/keepalive-workflow from 2.0.8 to 2.0.9
Update docker-compose.yml to use ERDDAP v2.25.1
Doesn't write logs to file in default settings.  Same functionality
as 6d8ac91 ported over to SQLAlchemy
and application factory code.
Removes many unused and obsolete files.  To create a REPL in the
Glider DAC environment, instead of using "console" script,
use "manage.py shell".
Removes cron container from docker-compose.yml.  As of time of this
commit, the cron container doesn't actually perform any duties,
and cron jobs on the host are still
utilized instead.  Future versions of Glider DAC may move to celery
or some other task scheduling library.
Removes unneeded packages from being installed by Docker,
removes unneeded steps with changing user, adds cleanup
of apt package cache for smaller image size.
@benjwadams benjwadams merged commit e196018 into ioos:develop Feb 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants