Skip to content

Commit

Permalink
fix: 修复插件测试中的插件列表地址 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Oct 2, 2023
1 parent 61c34c5 commit 3645fd9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

## [Unreleased]

### Fixed

- 修复插件测试中的插件列表地址

## [3.1.0] - 2023-10-02

### Changed
Expand Down
10 changes: 5 additions & 5 deletions examples/noneflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ jobs:
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }}

- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}

Expand All @@ -84,9 +84,9 @@ jobs:
config: >
{
"base": "master",
"plugin_path": "website/static/plugins.json",
"bot_path": "website/static/bots.json",
"adapter_path": "website/static/adapters.json"
"plugin_path": "assets/plugins.json",
"bot_path": "assets/bots.json",
"adapter_path": "assets/adapters.json"
}
env:
PLUGIN_TEST_RESULT: ${{ needs.plugin_test.outputs.result }}
Expand Down
17 changes: 10 additions & 7 deletions examples/store-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
name: NoneBot2 plugin test
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nonebot/noneflow
fetch-depth: 0
Expand All @@ -49,10 +49,10 @@ jobs:
mkdir -p plugin_test/store
curl -sSL https://raw.githubusercontent.com/nonebot/registry/results/results.json -o plugin_test/store/previous_results.json
curl -sSL https://raw.githubusercontent.com/nonebot/registry/results/plugins.json -o plugin_test/store/previous_plugins.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/website/static/adapters.json -o plugin_test/store/adapters.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/website/static/bots.json -o plugin_test/store/bots.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/website/static/drivers.json -o plugin_test/store/drivers.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/website/static/plugins.json -o plugin_test/store/plugins.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/adapters.json -o plugin_test/store/adapters.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/bots.json -o plugin_test/store/bots.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/drivers.json -o plugin_test/store/drivers.json
curl -sSL https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/plugins.json -o plugin_test/store/plugins.json
- name: Test plugin
if: ${{ !contains(fromJSON('["Bot", "Adapter", "Plugin"]'), github.event.client_payload.type) }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: results

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
statuses: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand All @@ -132,6 +132,9 @@ jobs:

- name: Build Website
run: pnpm build
env:
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Get Branch Name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
Expand Down
4 changes: 3 additions & 1 deletion src/utils/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
from urllib.request import urlopen

# NoneBot Store
STORE_PLUGINS_URL = "https://nonebot.dev/plugins.json"
STORE_PLUGINS_URL = (
"https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/plugins.json"
)

# 匹配信息的正则表达式
ISSUE_PATTERN = r"### {}\s+([^\s#].*?)(?=(?:\s+###|$))"
Expand Down
4 changes: 3 additions & 1 deletion src/utils/validation/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"""插件类型当前只支持 application 和 library"""

# NoneBot Store
STORE_ADAPTERS_URL = "https://nonebot.dev/adapters.json"
STORE_ADAPTERS_URL = (
"https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/adapters.json"
)

# Pydantic 错误信息翻译
CUSTOM_MESSAGES = {
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def mocked_api(respx_mock: MockRouter):
).respond(404)
respx_mock.get("https://www.baidu.com", name="homepage_failed").respond(404)
respx_mock.get("https://nonebot.dev/", name="homepage").respond()
respx_mock.get("https://nonebot.dev/adapters.json", name="store_adapters").respond(
respx_mock.get(
"https://raw.githubusercontent.com/nonebot/nonebot2/master/assets/adapters.json",
name="store_adapters",
).respond(
json=[
{
"module_name": "nonebot.adapters.onebot.v11",
Expand Down

0 comments on commit 3645fd9

Please sign in to comment.