-
Notifications
You must be signed in to change notification settings - Fork 1
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 workflow for pytest #28
Conversation
.github/workflows/pytest.yaml
Outdated
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] |
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.
Generally we should run tests on all pull request pushes (plus merges, i.e. pushes, to main as you have above). So we usually leave out any branches
here.
.github/workflows/pytest.yaml
Outdated
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip |
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.
Middleware likes using the uv
installer, as it can be much faster than pip
.
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
pip install -e . | ||
- name: Lint with flake8 |
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.
See the reusable workflows in https://github.com/lsst/rubin_workflows/tree/main/.github/workflows for ways to avoid needing to do this explicitly as well as retain common configurations between repos.
@@ -24,7 +24,7 @@ | |||
import sqlalchemy | |||
import sqlalchemy.dialects.postgresql | |||
from flask import Flask, request | |||
from utils import setup_logging, setup_postgres | |||
from .utils import setup_logging, setup_postgres |
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.
I think this doesn't work in the Docker container after copying the files. We may need to reorganize the destination tree to make this function properly.
.github/workflows/pytest.yaml
Outdated
contents: read | ||
|
||
jobs: | ||
build: |
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.
The name of this job is not exactly appropriate. Later on, we might merge this with the build workflow so it's test and then build.
Closing since this was a fork. |
This change adds a GitHub workflow for pytest and makes modifications that allow the tests to run. It does not correct one failing test.