-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 使用 pytest 跑单测
- Loading branch information
Showing
32 changed files
with
183 additions
and
90 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,66 @@ | ||
name: PR Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- .github/workflows/aws-preview.yml | ||
- server/** | ||
- petercat_utils/** | ||
- subscriber/** | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
pull-requests: write | ||
actions: write | ||
|
||
env: | ||
AWS_REGION: ap-northeast-1 | ||
REPORT_FILE: md_report.md | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Preview | ||
strategy: | ||
fail-fast: true | ||
defaults: | ||
run: | ||
working-directory: ./server | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::654654285942:role/Github-OIDC | ||
audience: sts.amazonaws.com | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12.0' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install ruff | ||
pip install pytest pytest-cov pytest-md-report | ||
- name: Lint with Ruff | ||
run: | | ||
ruff check --output-format=github . | ||
- name: Test with pytest | ||
run: | | ||
pytest -v --md-report --md-report-output ${{ env.REPORT_FILE }} | ||
cat ${{ env.REPORT_FILE }} | ||
- name: Comment PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
filePath: ./server/${{ env.REPORT_FILE }} |
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ venv | |
.next/ | ||
out/ | ||
|
||
.ruff_cache/ | ||
|
||
# production | ||
build | ||
|
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
## Supabase Budget | ||
|
||
|Resources| Instances | Pricing | | ||
|---------|------|------| | ||
| Supabase | 1 | $0 | ||
|
||
|
||
## Infrastructure Budget | ||
|
||
|Resources| Instances | Pricing | | ||
|---------|------|------| | ||
| EC2 Container Registry (ECR) | | https://aws.amazon.com/cn/ecr/pricing/ | ||
| Route 53 | 1 | $0.53 | ||
| Secrets Manager | 1 | $0.40 | ||
| S3 | Very Few | https://aws.amazon.com/cn/s3/pricing/ | ||
| CloudFront | 2 | $0 | ||
| Lambda | 4 | https://aws.amazon.com/cn/lambda/pricing/ | ||
|
||
|
||
## LLM Budget | ||
|
||
|Resources| Instances | Pricing | | ||
|---------|------|------| | ||
| OpenAI | - | https://openai.com/pricing/ | ||
| Gemini flash | - | $0 |
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 |
---|---|---|
|
@@ -6,11 +6,26 @@ authors = ["raoha.rh <[email protected]>"] | |
readme = "README.md" | ||
packages = [{include = "petercat_utils"}] | ||
|
||
[tool.ruff] | ||
builtins = ["_"] | ||
|
||
[pytest] | ||
testpaths = ["tests"] | ||
pythonpath = "." | ||
consider_namespace_packages = "True" | ||
python_files = "test_*.py" | ||
cov="com" | ||
cov-report=["xml","html"] | ||
md_report = true | ||
md_report_verbose = 0 | ||
md_report_color = "auto" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
langchain_community = "^0.2.11" | ||
langchain_openai = "^0.1.20" | ||
langchain_core = "0.2.28" | ||
langchain = "^0.2.12" | ||
supabase = "2.6.0" | ||
pydantic = "2.7.0" | ||
PyGithub = "2.3.0" | ||
|
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[pytest] | ||
testpaths = tests | ||
python_files = test_*.py | ||
rootdir=server | ||
consider_namespace_packages = True | ||
python_files = test_*.py | ||
cov=com | ||
cov-report=xml,html |
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
Empty file.
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
Oops, something went wrong.