refactor: remove obsolete tests and improve existing test coverage

- Deleted the `missing-llm-notification-startup.e2e.test.ts` file as it is no longer needed.
- Enhanced `send-guard-mode-switch-and-preferences.e2e.test.ts` to include checks for missing model notifications.
- Removed `browser-use-deepseek-financing-search.e2e.test.ts` due to redundancy.
- Cleaned up `chat-run-service-contract.test.ts` by removing performance tests that are no longer relevant.
- Updated `aiLiveTestData.ts` to remove unused constants and types related to risk reports.
- Removed `aiToolHarness.ts` function for writing sample documents as it is no longer utilized.
- Updated `llmConfig.ts` to infer LLM provider kind from environment variables.
- Cleaned up `cache-summary.ts` by removing unused JSON conversion functions.
- Deleted `browserLlmConfig.ts` as it was redundant.
- Enhanced `settings.ts` to support new application settings and improved HTTP server response handling.
- Removed unused functions from `workbench.ts` related to waiting for assistant answers.
This commit is contained in:
hy committed 2026-07-14 10:49:58 +08:00
1 parent 9cbab9d5bd
commit 9bd424cd1c
58 files changed
+2223 -2330

No files matched your search

+76 -2
View File
@@ -50,8 +50,11 @@ jobs:
build-macos-x64:
needs: validate-release
runs-on: macos-15-intel
environment: ncuratore
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
CSC_IDENTITY_AUTO_DISCOVERY: ${{ secrets.MAC_CSC_LINK != '' }}
steps:
- uses: actions/checkout@v4
with:
@@ -93,8 +96,11 @@ jobs:
build-macos-arm64:
needs: validate-release
runs-on: macos-15
environment: ncuratore
env:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
CSC_IDENTITY_AUTO_DISCOVERY: ${{ secrets.MAC_CSC_LINK != '' }}
steps:
- uses: actions/checkout@v4
with:
@@ -241,6 +247,74 @@ jobs:
test -n "$R2_BUCKET_NAME"
test "${R2_PUBLIC_BASE_URL%/}" = "https://download.ncurator.com"
- name: Prepare R2 update metadata
run: |
node scripts/prepare-r2-update-metadata.mjs \
release-artifacts \
r2-update-metadata \
"$RELEASE_TAG"
- name: Upload versioned update assets to Cloudflare R2
shell: bash
run: |
set -euo pipefail
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"
while IFS= read -r -d '' source; do
asset="$(basename "$source")"
aws s3 cp "$source" \
"s3://${R2_BUCKET_NAME}/updates/${RELEASE_TAG}/$asset" \
--endpoint-url "$endpoint" \
--region auto \
--cache-control 'public, max-age=31536000, immutable' \
--no-progress
done < <(find release-artifacts -type f \
\( -name '*.dmg' -o -name '*.zip' -o -name '*.exe' -o -name '*.blockmap' \) \
-print0)
- name: Verify versioned R2 update assets
shell: bash
run: |
set -euo pipefail
base_url="${R2_PUBLIC_BASE_URL%/}"
while IFS= read -r -d '' source; do
asset="$(basename "$source")"
expected_size="$(stat -c '%s' "$source")"
actual_size="$(curl --fail --silent --show-error --head \
"$base_url/updates/$RELEASE_TAG/$asset" \
| tr -d '\r' \
| awk 'tolower($1)=="content-length:" {value=$2} END {print value}')"
test "$actual_size" = "$expected_size"
done < <(find release-artifacts -type f \
\( -name '*.dmg' -o -name '*.zip' -o -name '*.exe' -o -name '*.blockmap' \) \
-print0)
- name: Promote R2 update metadata
shell: bash
run: |
set -euo pipefail
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"
for metadata in latest.yml latest-mac.yml; do
aws s3 cp "r2-update-metadata/$metadata" \
"s3://${R2_BUCKET_NAME}/updates/latest/$metadata" \
--endpoint-url "$endpoint" \
--region auto \
--content-type application/yaml \
--cache-control 'no-store' \
--no-progress
done
- name: Verify latest R2 update metadata
shell: bash
run: |
set -euo pipefail
base_url="${R2_PUBLIC_BASE_URL%/}"
for metadata in latest.yml latest-mac.yml; do
content="$(curl --fail --silent --show-error \
"$base_url/updates/latest/$metadata?noCache=${GITHUB_RUN_ID}")"
grep -F "version: ${RELEASE_TAG#v}" <<< "$content"
grep -F "../${RELEASE_TAG}/" <<< "$content"
done
- name: Upload versioned installers to Cloudflare R2
shell: bash
run: |
+83 -2
View File
@@ -19,6 +19,8 @@ jobs:
R2_PUBLIC_BASE_URL: ${{ secrets.R2_PUBLIC_BASE_URL }}
RELEASE_TAG: ${{ inputs.tag }}
steps:
- uses: actions/checkout@v4
- name: Validate R2 configuration
shell: bash
run: |
@@ -30,15 +32,24 @@ jobs:
test "${R2_PUBLIC_BASE_URL%/}" = "https://download.ncurator.com"
[[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]
- name: Download installers from GitHub Release
- name: Download update assets from GitHub Release
shell: bash
run: |
set -euo pipefail
mkdir -p release-assets
for asset in \
latest.yml \
latest-mac.yml \
Ncurator-mac-arm64.dmg \
Ncurator-mac-arm64.dmg.blockmap \
Ncurator-mac-arm64.zip \
Ncurator-mac-arm64.zip.blockmap \
Ncurator-mac-x64.dmg \
Ncurator-windows-x64.exe
Ncurator-mac-x64.dmg.blockmap \
Ncurator-mac-x64.zip \
Ncurator-mac-x64.zip.blockmap \
Ncurator-windows-x64.exe \
Ncurator-windows-x64.exe.blockmap
do
curl --fail --location --retry 3 \
--output "release-assets/$asset" \
@@ -46,6 +57,76 @@ jobs:
done
ls -lh release-assets
- name: Prepare R2 update metadata
run: |
node scripts/prepare-r2-update-metadata.mjs \
release-assets \
r2-update-metadata \
"$RELEASE_TAG"
- name: Upload versioned update assets to R2
shell: bash
run: |
set -euo pipefail
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"
for source in release-assets/*; do
asset="$(basename "$source")"
case "$asset" in
latest.yml|latest-mac.yml) continue ;;
esac
aws s3 cp "$source" \
"s3://${R2_BUCKET_NAME}/updates/${RELEASE_TAG}/$asset" \
--endpoint-url "$endpoint" \
--region auto \
--cache-control 'public, max-age=31536000, immutable' \
--no-progress
done
- name: Verify versioned R2 update assets
shell: bash
run: |
set -euo pipefail
base_url="${R2_PUBLIC_BASE_URL%/}"
for source in release-assets/*; do
asset="$(basename "$source")"
case "$asset" in
latest.yml|latest-mac.yml) continue ;;
esac
expected_size="$(stat -c '%s' "$source")"
actual_size="$(curl --fail --silent --show-error --head \
"$base_url/updates/$RELEASE_TAG/$asset" \
| tr -d '\r' \
| awk 'tolower($1)=="content-length:" {value=$2} END {print value}')"
test "$actual_size" = "$expected_size"
done
- name: Promote R2 update metadata
shell: bash
run: |
set -euo pipefail
endpoint="https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com"
for metadata in latest.yml latest-mac.yml; do
aws s3 cp "r2-update-metadata/$metadata" \
"s3://${R2_BUCKET_NAME}/updates/latest/$metadata" \
--endpoint-url "$endpoint" \
--region auto \
--content-type application/yaml \
--cache-control 'no-store' \
--no-progress
done
- name: Verify latest R2 update metadata
shell: bash
run: |
set -euo pipefail
base_url="${R2_PUBLIC_BASE_URL%/}"
for metadata in latest.yml latest-mac.yml; do
content="$(curl --fail --silent --show-error \
"$base_url/updates/latest/$metadata?noCache=${GITHUB_RUN_ID}")"
grep -F "version: ${RELEASE_TAG#v}" <<< "$content"
grep -F "../${RELEASE_TAG}/" <<< "$content"
done
- name: Upload versioned installers to R2
shell: bash
run: |