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 workflow for pytest #28

Closed
wants to merge 5 commits into from
Closed

Add workflow for pytest #28

wants to merge 5 commits into from

Conversation

bbrondel
Copy link
Collaborator

This change adds a GitHub workflow for pytest and makes modifications that allow the tests to run. It does not correct one failing test.

push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
Copy link
Contributor

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.

python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 Show resolved Hide resolved
contents: read

jobs:
build:
Copy link
Contributor

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.

@timj
Copy link
Member

timj commented Jul 22, 2024

Closing since this was a fork.

@timj timj closed this Jul 22, 2024
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