Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:white_check_mark: Stabilize CI regression tests and Electron downloads

Daniel3b5d3a36f721
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index 456843c9d1..2516afe496 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -301,7 +301,7 @@ jobs:
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
- name: Install Electron Binary
- run: pnpm run install:electron
+ run: node node_modules/electron/install.js
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
- name: Building UI
@@ -414,7 +414,7 @@ jobs:
- name: Run End-to-End Tests
if: matrix.config.e2e_shards != ''
continue-on-error: true
- timeout-minutes: 30
+ timeout-minutes: 50
shell: bash
run: |
TEST_PIDS=()
@@ -424,13 +424,18 @@ jobs:
port="${shard_config#*:}"
(
# UI 测试共享同一内核及全局界面状态,必须串行运行
- # 串行执行保留 25 分钟总时限,外层步骤仍由 30 分钟超时保护
+ # 编辑器分组用例较多,保留 45 分钟总时限;其他分组保持 25 分钟
+ # 外层步骤保留 5 分钟余量,单项用例仍使用测试配置中的超时
+ test_timeout=1500000
+ if [ "${shard}" = "editor" ]; then
+ test_timeout=2700000
+ fi
SIYUAN_BASE_URL="http://127.0.0.1:${port}" \
SIYUAN_E2E_SHARD="${shard}" \
SIYUAN_TEST_RESULTS_DIR="test-results-${shard}" \
PLAYWRIGHT_HTML_OUTPUT_DIR="playwright-report-${shard}" \
pnpm exec playwright test --config=config/playwright.focused.config.ts \
- --global-timeout=1500000 --workers=1 \
+ --global-timeout="${test_timeout}" --workers=1 \
--reporter=line,html --output="test-results-${shard}"
) &
TEST_PID=$!
diff --git a/app/tests/tabsNavigation.test.js b/app/tests/tabsNavigation.test.js
index 8957b3a782..1054824432 100644
--- a/app/tests/tabsNavigation.test.js
+++ b/app/tests/tabsNavigation.test.js
@@ -62,11 +62,11 @@ const cases = (source) => {
disconnect() { disconnected = true; }
}
const navigation = new Function("ResizeObserver", "Constants", "isInEmbedBlock", "revealTabsForTarget",
- "preventScroll", "focusBlock", "scrollCenter", "pushBack", "setTimeout",
+ "preventScroll", "focusBlock", "scrollCenter", "pushBack", "setTimeout", "isPhablet",
source.visibility + source.navigation + "; return switchEditor;")(
Observer, {CB_GET_FOCUS: "focus"}, () => false,
target => { target.dataset.tabsHidden = "false"; }, () => {}, () => document.createRange(),
- (_protyle, target) => { scrolls++; target.dataset.tabsHidden = "false"; }, () => {}, () => {});
+ (_protyle, target) => { scrolls++; target.dataset.tabsHidden = "false"; }, () => {}, () => {}, () => false);
root.innerHTML = '<div class="tab-item" data-node-id="target" data-tabs-hidden="false">Target</div>';
const target = root.firstElementChild;
const protyle = {element: root, wysiwyg: {element: root}, contentElement: root,
diff --git a/kernel/model/tree_notification_test.go b/kernel/model/tree_notification_test.go
index 00b7ffe65f..becc816545 100644
--- a/kernel/model/tree_notification_test.go
+++ b/kernel/model/tree_notification_test.go
@@ -2,6 +2,8 @@ package model
import (
"errors"
+ "os"
+ "os/exec"
"path/filepath"
"sync"
"sync/atomic"
@@ -55,6 +57,17 @@ func TestClosedBoxNotification(t *testing.T) {
}
func TestClosedBoxRepeatedLookupPreservesError(t *testing.T) {
+ // 独立进程隔离其他用例遗留的索引任务,保留真实请求入口的索引状态检查。
+ const subprocessEnv = "SIYUAN_TEST_CLOSED_BOX_LOOKUP"
+ if os.Getenv(subprocessEnv) != "1" {
+ cmd := exec.Command(os.Args[0], "-test.run=^TestClosedBoxRepeatedLookupPreservesError$", "-test.timeout=30s")
+ cmd.Env = append(os.Environ(), subprocessEnv+"=1")
+ if output, err := cmd.CombinedOutput(); err != nil {
+ t.Fatalf("closed notebook lookup subprocess failed: %v\n%s", err, output)
+ }
+ return
+ }
+
fixture := setupFileOperationTest(t)
originalLimiter := searchTreeLimiter
searchTreeLimiter = rate.NewLimiter(rate.Inf, 1)