-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix existing tests, pre-commit, and Github Actions
Here we do the following: * Make tox fail on missing interperters. * Fix the TestUser test so the setup method handles errors and initializes properly before the test. * Instead of running black on pre-commit, we now run tox locally which includes all linting and test suites include black. This now ensures the same linting and test that run in Github Actions are executed locally before a commit. In addition, we run pre-commit in GHA so all linting and testing is identical between what is run locally and in GHA. * Fixed the existing main.yml GHA so the python 3.12 is set up for tox to use. This fixes the missing interperter issue that was causing the skipped tox tests in the first place. * Added a new GHA that only runs linting/tests on RPs. This will help catch things before landing on master. Note: README.md and other docs will be overhauled soon in a future PR which will reflect these changes and many other changes that have been landed without being documented.
- Loading branch information
Showing
5 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: PR Linting / Unit Testing | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
permissions: | ||
contents: 'read' | ||
|
||
jobs: | ||
lint: | ||
name: Linting / Unit Testing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: 'actions/checkout@v4' | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pre-commit | ||
- name: Run pre-commit | ||
run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
|
||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
- repo: local | ||
hooks: | ||
- id: black | ||
- id: run-tox | ||
name: Run tox tests | ||
entry: tox | ||
language: system | ||
pass_filenames: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters