Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
name: Pytest

on:
- push
- pull_request
pull_request:
push:
branches:
- "main"

jobs:
pytest:
runs-on: ubuntu-latest
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -28,8 +38,9 @@ jobs:
- name: Run tests
run: ./tests/run.sh

- name: Upload coverage report
uses: actions/upload-artifact@v3
- name: Coverage comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
name: coverage-report
path: ./tests/coverage
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 80
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["gam", "google"]
authors = [
{ name = "Compiler LLC", email = "[email protected]" }
]
requires-python = ">=3.9"
requires-python = ">=3.11"
dependencies = [
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/[email protected]#subdirectory=src"
]
Expand All @@ -26,8 +26,8 @@ dev = [
"pre-commit"
]
test = [
"coverage",
"pytest",
"pytest-cov",
"pytest-mock"
]

Expand All @@ -43,6 +43,11 @@ line-length = 127
target-version = ['py311']
include = '\.pyi?$'

[tool.coverage.run]
branch = true
relative_files = true
source = ["compiler_admin"]

[tool.pyright]
include = ["compiler_admin", "tests"]

Expand Down
2 changes: 1 addition & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

# run normal pytests, skip e2e tests
pytest -m "not e2e" --cov=compiler_admin --cov-branch --import-mode=importlib
coverage run -m pytest -m "not e2e"

# clean out old coverage results
rm -rf ./tests/coverage
Expand Down
4 changes: 4 additions & 0 deletions tests/web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu

python -m http.server -d ./tests/coverage