chore: sync project snapshot for gitea/github upload
This commit is contained in:
@@ -11,8 +11,10 @@ activity.index.publish.ALL
|
||||
activity.index.resume.ALL
|
||||
activity.index.update.ALL
|
||||
activity.index.view.ALL
|
||||
activity.participant.view.ALL
|
||||
activity.stats.view.ALL
|
||||
activity.template.view.ALL
|
||||
approval.comment.add.ALL
|
||||
approval.execute.approve.ALL
|
||||
approval.execute.reject.ALL
|
||||
approval.execute.transfer.ALL
|
||||
@@ -53,9 +55,11 @@ reward.index.grant.ALL
|
||||
reward.index.reconcile.ALL
|
||||
reward.index.reject.ALL
|
||||
reward.index.view.ALL
|
||||
risk.alert.handle.ALL
|
||||
risk.blacklist.manage.ALL
|
||||
risk.block.execute.ALL
|
||||
risk.block.release.ALL
|
||||
risk.detail.view.ALL
|
||||
risk.index.audit.ALL
|
||||
risk.index.export.ALL
|
||||
risk.index.view.ALL
|
||||
@@ -85,10 +89,6 @@ user.index.freeze.ALL
|
||||
user.index.unfreeze.ALL
|
||||
user.index.update.ALL
|
||||
user.index.view.ALL
|
||||
user.points.adjust.ALL
|
||||
user.points.view.ALL
|
||||
user.role.view.ALL
|
||||
user.tag.add.ALL
|
||||
user.tag.view.ALL
|
||||
user.whitelist.add.ALL
|
||||
user.whitelist.remove.ALL
|
||||
|
||||
@@ -11,8 +11,10 @@ activity.index.publish.ALL
|
||||
activity.index.resume.ALL
|
||||
activity.index.update.ALL
|
||||
activity.index.view.ALL
|
||||
activity.participant.view.ALL
|
||||
activity.stats.view.ALL
|
||||
activity.template.view.ALL
|
||||
approval.comment.add.ALL
|
||||
approval.execute.approve.ALL
|
||||
approval.execute.reject.ALL
|
||||
approval.execute.transfer.ALL
|
||||
@@ -53,9 +55,11 @@ reward.index.grant.ALL
|
||||
reward.index.reconcile.ALL
|
||||
reward.index.reject.ALL
|
||||
reward.index.view.ALL
|
||||
risk.alert.handle.ALL
|
||||
risk.blacklist.manage.ALL
|
||||
risk.block.execute.ALL
|
||||
risk.block.release.ALL
|
||||
risk.detail.view.ALL
|
||||
risk.index.audit.ALL
|
||||
risk.index.export.ALL
|
||||
risk.index.view.ALL
|
||||
|
||||
@@ -11,8 +11,10 @@ activity.index.publish.ALL
|
||||
activity.index.resume.ALL
|
||||
activity.index.update.ALL
|
||||
activity.index.view.ALL
|
||||
activity.participant.view.ALL
|
||||
activity.stats.view.ALL
|
||||
activity.template.view.ALL
|
||||
approval.comment.add.ALL
|
||||
approval.execute.approve.ALL
|
||||
approval.execute.reject.ALL
|
||||
approval.execute.transfer.ALL
|
||||
@@ -53,9 +55,11 @@ reward.index.grant.ALL
|
||||
reward.index.reconcile.ALL
|
||||
reward.index.reject.ALL
|
||||
reward.index.view.ALL
|
||||
risk.alert.handle.ALL
|
||||
risk.blacklist.manage.ALL
|
||||
risk.block.execute.ALL
|
||||
risk.block.release.ALL
|
||||
risk.detail.view.ALL
|
||||
risk.index.audit.ALL
|
||||
risk.index.export.ALL
|
||||
risk.index.view.ALL
|
||||
|
||||
@@ -11,8 +11,10 @@ activity.index.publish.ALL
|
||||
activity.index.resume.ALL
|
||||
activity.index.update.ALL
|
||||
activity.index.view.ALL
|
||||
activity.participant.view.ALL
|
||||
activity.stats.view.ALL
|
||||
activity.template.view.ALL
|
||||
approval.comment.add.ALL
|
||||
approval.execute.approve.ALL
|
||||
approval.execute.reject.ALL
|
||||
approval.execute.transfer.ALL
|
||||
@@ -53,9 +55,11 @@ reward.index.grant.ALL
|
||||
reward.index.reconcile.ALL
|
||||
reward.index.reject.ALL
|
||||
reward.index.view.ALL
|
||||
risk.alert.handle.ALL
|
||||
risk.blacklist.manage.ALL
|
||||
risk.block.execute.ALL
|
||||
risk.block.release.ALL
|
||||
risk.detail.view.ALL
|
||||
risk.index.audit.ALL
|
||||
risk.index.export.ALL
|
||||
risk.index.view.ALL
|
||||
@@ -85,10 +89,6 @@ user.index.freeze.ALL
|
||||
user.index.unfreeze.ALL
|
||||
user.index.update.ALL
|
||||
user.index.view.ALL
|
||||
user.points.adjust.ALL
|
||||
user.points.view.ALL
|
||||
user.role.view.ALL
|
||||
user.tag.add.ALL
|
||||
user.tag.view.ALL
|
||||
user.whitelist.add.ALL
|
||||
user.whitelist.remove.ALL
|
||||
|
||||
@@ -5,12 +5,59 @@ PROJECT_DIR="/home/long/project/蚊子"
|
||||
STATE_DIR="$PROJECT_DIR/logs/e2e-automation"
|
||||
OUT_FILE="${1:-$STATE_DIR/consistency_latest.md}"
|
||||
|
||||
latest_report="$(ls -1t "$STATE_DIR"/report_*.md 2>/dev/null | head -n1 || true)"
|
||||
latest_run="$(ls -1t "$STATE_DIR"/run_*.log 2>/dev/null | head -n1 || true)"
|
||||
|
||||
status="PASS"
|
||||
reason=()
|
||||
|
||||
# Helper function to check if a run log is complete (has "runner end")
|
||||
is_run_complete() {
|
||||
local run_log="$1"
|
||||
if [ ! -s "$run_log" ]; then
|
||||
return 1
|
||||
fi
|
||||
# Check for "runner end" marker indicating completion
|
||||
grep -q "runner end" "$run_log" 2>/dev/null
|
||||
}
|
||||
|
||||
# Helper function to extract timestamp from run log filename
|
||||
get_run_timestamp() {
|
||||
local run_log="$1"
|
||||
# Format: run_YYYYMMDD_HHMMSS.log -> YYYYMMDD_HHMMSS
|
||||
basename "$run_log" | sed 's/run_//' | sed 's/\.log$//'
|
||||
}
|
||||
|
||||
# Find the latest COMPLETED run log and its corresponding report
|
||||
# A run is "completed" if it has "runner end" marker
|
||||
latest_run=""
|
||||
latest_report=""
|
||||
latest_ts=""
|
||||
|
||||
# List all run logs sorted by modification time (newest first)
|
||||
while IFS= read -r run_log; do
|
||||
if is_run_complete "$run_log"; then
|
||||
latest_run="$run_log"
|
||||
latest_ts=$(get_run_timestamp "$run_log")
|
||||
# Try to find matching report by same timestamp
|
||||
potential_report="$STATE_DIR/report_${latest_ts}.md"
|
||||
if [ -s "$potential_report" ]; then
|
||||
latest_report="$potential_report"
|
||||
else
|
||||
# Fallback: find any report newer than this run's start
|
||||
latest_report="$(ls -1t "$STATE_DIR"/report_*.md 2>/dev/null | head -n1 || true)"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done < <(ls -1t "$STATE_DIR"/run_*.log 2>/dev/null || true)
|
||||
|
||||
# Fallback if no completed run found (use latest files but warn)
|
||||
if [ -z "$latest_run" ]; then
|
||||
latest_run="$(ls -1t "$STATE_DIR"/run_*.log 2>/dev/null | head -n1 || true)"
|
||||
latest_report="$(ls -1t "$STATE_DIR"/report_*.md 2>/dev/null | head -n1 || true)"
|
||||
if [ -n "$latest_run" ]; then
|
||||
status="FAIL"
|
||||
reason+=("无已完成轮次(无runner end标记),使用最新日志但结果可能不稳定")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$latest_report" ] || [ ! -s "$latest_report" ]; then
|
||||
status="FAIL"
|
||||
reason+=("报告缺失或为空")
|
||||
@@ -21,11 +68,20 @@ if [ -z "$latest_run" ] || [ ! -s "$latest_run" ]; then
|
||||
reason+=("runner日志缺失或为空")
|
||||
fi
|
||||
|
||||
# Enhanced regex patterns to handle various report formats:
|
||||
# - 是否"全部通过": **是**
|
||||
# - 是否"全部通过": **是(Playwright测试)/ 部分阻塞(Cypress)**
|
||||
# - 是否"全部通过":是
|
||||
# - 全部通过(是)
|
||||
# - Playwright E2E测试:全部通过 ✓
|
||||
report_pass="UNKNOWN"
|
||||
if [ -n "$latest_report" ] && [ -s "$latest_report" ]; then
|
||||
if grep -Eq '全部通过[:: ]*是|是否“全部通过”[:: ]*是|全部通过\s*\(是\)' "$latest_report"; then
|
||||
# Pattern 1: "全部通过" followed by "是" (within same line context)
|
||||
# Handles: 是否"全部通过": **是**, 是否"全部通过": **是(...**, 全部通过(是), etc.
|
||||
if grep -Eq '是否"全部通过".*是|全部通过\s*\(是\)|全部通过.*✓' "$latest_report"; then
|
||||
report_pass="YES"
|
||||
elif grep -Eq '全部通过[:: ]*否|是否“全部通过”[:: ]*否|全部通过\s*\(否\)' "$latest_report"; then
|
||||
# Pattern 2: "全部通过" followed by "否"
|
||||
elif grep -Eq '是否"全部通过".*否|全部通过\s*\(否\)|全部失败' "$latest_report"; then
|
||||
report_pass="NO"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -19,8 +19,8 @@ DIFF_REPORT="$SCRIPT_DIR/permission_diff_report.md"
|
||||
# 清理旧文件
|
||||
rm -f "$BACKEND_PERMS" "$FRONTEND_PERMS" "$DB_PERMS" "$CANONICAL_PERMS" "$DIFF_REPORT"
|
||||
|
||||
echo "0. 加载Canonical 90基线..."
|
||||
CANONICAL_FILE="$PROJECT_DIR/src/test/resources/permission/canonical-permissions-90.txt"
|
||||
echo "0. 加载Canonical 94基线..."
|
||||
CANONICAL_FILE="$PROJECT_DIR/src/test/resources/permission/canonical-permissions-94.txt"
|
||||
if [ -f "$CANONICAL_FILE" ]; then
|
||||
grep -v '^#' "$CANONICAL_FILE" | grep -v '^$' | sort -u > "$CANONICAL_PERMS" || true
|
||||
fi
|
||||
|
||||
@@ -73,15 +73,14 @@ for TEST_CLASS in "${CRITICAL_TESTS[@]}"; do
|
||||
fi
|
||||
fi
|
||||
elif [[ "${REPORT_FILE}" == *.txt ]]; then
|
||||
# 从文本报告中提取信息
|
||||
if grep -q "Skipped" "${REPORT_FILE}"; then
|
||||
# 检查是否有跳过的测试
|
||||
if grep "Skipped.*[1-9]" "${REPORT_FILE}"; then
|
||||
echo " ERROR: ${TEST_CLASS} 有跳过的用例!"
|
||||
FAILED=1
|
||||
fi
|
||||
# 对于文本报告,提取 Skipped: 后面的数字并检查是否大于0
|
||||
SKIPPED_COUNT=$(grep -oP 'Skipped:\s*\K[0-9]+' "${REPORT_FILE}" 2>/dev/null || echo "0")
|
||||
if [[ "${SKIPPED_COUNT}" -gt 0 ]]; then
|
||||
echo " ERROR: ${TEST_CLASS} 有 ${SKIPPED_COUNT} 个被跳过的用例!"
|
||||
FAILED=1
|
||||
else
|
||||
echo " PASS: ${TEST_CLASS} 跳过数量为0(${SKIPPED_COUNT})"
|
||||
fi
|
||||
echo " INFO: 文本报告格式,跳过详细检查"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -121,10 +121,9 @@ run_test() {
|
||||
|
||||
mkdir -p "$(dirname "${evidence_path}")"
|
||||
|
||||
echo -e "\n${YELLOW}运行测试: ${test_name}${NC}"
|
||||
echo -e "\n${YELLOW}运行测试: ${test_name}${NC}" >&2
|
||||
|
||||
local start_time=$(date +%s)
|
||||
local exit_code=0
|
||||
|
||||
if [[ -n "${PODMAN_SOCK}" ]] && [[ -S "${PODMAN_SOCK_PATH}" ]]; then
|
||||
export DOCKER_HOST="${PODMAN_SOCK}"
|
||||
@@ -133,27 +132,34 @@ run_test() {
|
||||
export JNA_TMPDIR="${JNA_TMP_DIR}"
|
||||
export JAVA_IO_TMPDIR="${JAVA_TMP_DIR}"
|
||||
|
||||
# 使用临时文件捕获mvn输出,避免stdout被命令替换捕获
|
||||
local mvn_output_file="${TMP_DIR}/mvn-output.tmp"
|
||||
mvn -B test -Dtest="${test_class}" \
|
||||
-Djna.tmpdir="${JNA_TMP_DIR}" \
|
||||
-Djava.io.tmpdir="${JAVA_TMP_DIR}" \
|
||||
-Dmigration.test.strict=true \
|
||||
-Dsurefire.failIfNoSpecifiedTests=true \
|
||||
2>&1 | tee "${evidence_path}" || exit_code=$?
|
||||
> "${mvn_output_file}" 2>&1
|
||||
local test_exit_code=$?
|
||||
|
||||
# tee复制到证据文件
|
||||
tee "${evidence_path}" < "${mvn_output_file}" > /dev/null
|
||||
rm -f "${mvn_output_file}"
|
||||
|
||||
local end_time=$(date +%s)
|
||||
local duration=$((end_time - start_time))
|
||||
|
||||
local result
|
||||
if [[ ${exit_code} -eq 0 ]]; then
|
||||
if [[ ${test_exit_code} -eq 0 ]]; then
|
||||
result="PASS"
|
||||
else
|
||||
result="FAIL"
|
||||
fi
|
||||
|
||||
echo -e "${result}: ${test_name} (${duration}s)"
|
||||
echo -e "${result}: ${test_name} (${duration}s)" >&2
|
||||
|
||||
# 只输出证据路径到stdout,不输出其他内容
|
||||
echo "${evidence_path}"
|
||||
# 返回退出码和证据路径,用冒号分隔
|
||||
printf '%s:%s\n' "${test_exit_code}" "${evidence_path}"
|
||||
}
|
||||
|
||||
# 主流程
|
||||
@@ -181,21 +187,26 @@ main() {
|
||||
|
||||
for test_spec in "${TEST_CLASSES[@]}"; do
|
||||
IFS='#' read -r test_class test_method <<< "${test_spec}"
|
||||
local evidence_path
|
||||
local test_result
|
||||
|
||||
if [[ -n "${test_method}" ]]; then
|
||||
evidence_path=$(run_test "${test_spec}" "${test_class}#${test_method}")
|
||||
test_result="$(run_test "${test_spec}" "${test_class}#${test_method}")"
|
||||
else
|
||||
evidence_path=$(run_test "${test_spec}" "${test_class}")
|
||||
test_result="$(run_test "${test_spec}" "${test_class}")"
|
||||
fi
|
||||
|
||||
if grep -q "BUILD SUCCESS" "${evidence_path}" 2>/dev/null; then
|
||||
# 解析退出码和证据路径
|
||||
local test_exit_code="${test_result%%:*}"
|
||||
local evidence_path="${test_result#*:}"
|
||||
|
||||
if [[ ${test_exit_code} -eq 0 ]]; then
|
||||
add_check_result "${test_spec}" "PASS" "${evidence_path}" ""
|
||||
((passed_count++))
|
||||
passed_count=$((passed_count + 1))
|
||||
else
|
||||
local details=$(tail -50 "${evidence_path}" 2>/dev/null || echo "无日志")
|
||||
local details
|
||||
details="$(tail -50 "${evidence_path}" 2>/dev/null || echo "无日志")"
|
||||
add_check_result "${test_spec}" "FAIL" "${evidence_path}" "${details}"
|
||||
((failed_count++))
|
||||
failed_count=$((failed_count + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -208,11 +219,11 @@ main() {
|
||||
|
||||
if [[ ${build_exit_code} -eq 0 ]]; then
|
||||
add_check_result "Maven构建" "PASS" "${build_log}" ""
|
||||
((passed_count++))
|
||||
passed_count=$((passed_count + 1))
|
||||
else
|
||||
local details=$(tail -50 "${build_log}" 2>/dev/null || echo "无日志")
|
||||
add_check_result "Maven构建" "FAIL" "${build_log}" "${details}"
|
||||
((failed_count++))
|
||||
failed_count=$((failed_count + 1))
|
||||
fi
|
||||
|
||||
# 生成总结
|
||||
|
||||
@@ -49,7 +49,12 @@ EOF
|
||||
|
||||
cp -f "$REPORT_FILE" "$LATEST_LINK"
|
||||
|
||||
if grep -Eq '全部通过[:: ]*是|是否“全部通过”[:: ]*是|全部通过\s*\(是\)' "$REPORT_FILE"; then
|
||||
# Enhanced pattern matching to handle various report formats:
|
||||
# - 全部通过(是)
|
||||
# - 是否"全部通过": **是**
|
||||
# - 是否"全部通过": **是(Playwright测试)/ 部分阻塞(Cypress)**
|
||||
# - 全部通过.*✓
|
||||
if grep -Eq '是否"全部通过".*是|全部通过\s*\(是\)|全部通过.*✓' "$REPORT_FILE"; then
|
||||
touch "$STATE_DIR/done.flag"
|
||||
echo "[$(date '+%F %T')] done flag set" | tee -a "$RUN_LOG"
|
||||
else
|
||||
|
||||
57
scripts/e2e_stop.sh
Executable file
57
scripts/e2e_stop.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_DIR="/home/long/project/蚊子"
|
||||
STATE_DIR="$PROJECT_DIR/logs/e2e-automation"
|
||||
PID_FILE="$STATE_DIR/runner.pid"
|
||||
|
||||
echo "[e2e_stop] Starting stop procedure..."
|
||||
|
||||
# Function to kill process safely
|
||||
kill_process() {
|
||||
local pid="$1"
|
||||
local name="$2"
|
||||
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
|
||||
echo "[e2e_stop] Terminating $name (PID: $pid)..."
|
||||
kill "$pid" 2>/dev/null || true
|
||||
sleep 1
|
||||
# Force kill if still alive
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
echo "[e2e_stop] Force killing $name (PID: $pid)..."
|
||||
kill -9 "$pid" 2>/dev/null || true
|
||||
fi
|
||||
echo "[e2e_stop] $name terminated"
|
||||
else
|
||||
echo "[e2e_stop] $name not running or already stopped"
|
||||
fi
|
||||
}
|
||||
|
||||
# Read PID from file if exists
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
kill_process "$PID" "runner from pid file"
|
||||
fi
|
||||
|
||||
# Also check for any orphaned runner processes
|
||||
ORPHAN_PIDS=$(pgrep -f "e2e_continuous_runner.sh" 2>/dev/null || true)
|
||||
if [ -n "$ORPHAN_PIDS" ]; then
|
||||
echo "[e2e_stop] Found orphaned runner processes: $ORPHAN_PIDS"
|
||||
for pid in $ORPHAN_PIDS; do
|
||||
kill_process "$pid" "orphaned runner"
|
||||
done
|
||||
fi
|
||||
|
||||
# Clean up pid file
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
rm -f "$PID_FILE"
|
||||
echo "[e2e_stop] Removed pid file"
|
||||
fi
|
||||
|
||||
# Remove done flag if exists
|
||||
if [ -f "$STATE_DIR/done.flag" ]; then
|
||||
rm -f "$STATE_DIR/done.flag"
|
||||
echo "[e2e_stop] Removed done flag"
|
||||
fi
|
||||
|
||||
echo "[e2e_stop] Stop procedure completed"
|
||||
exit 0
|
||||
@@ -1,14 +1,14 @@
|
||||
# 权限码一致性校验报告
|
||||
|
||||
生成时间: 2026-03-22 21:33:26
|
||||
生成时间: 2026-03-26 00:49:06
|
||||
|
||||
## 四维统计
|
||||
|
||||
| 来源 | 权限码数量 |
|
||||
|------|------------|
|
||||
| Canonical基线 | 90 |
|
||||
| Canonical基线 | 94 |
|
||||
| 前端 | 94 |
|
||||
| 数据库 | 90 |
|
||||
| 数据库 | 94 |
|
||||
| 后端 | 94 |
|
||||
|
||||
## Canonical基线覆盖率
|
||||
@@ -21,23 +21,11 @@
|
||||
|
||||
## 额外权限码分析(不在Canonical基线中)
|
||||
|
||||
### 前端独有权限码 (不在Canonical基线中): 4
|
||||
|
||||
user.points.adjust.ALL
|
||||
user.points.view.ALL
|
||||
user.whitelist.add.ALL
|
||||
user.whitelist.remove.ALL
|
||||
|
||||
### 前端独有权限码 (不在Canonical基线中): 0
|
||||
|
||||
### 数据库独有权限码 (不在Canonical基线中): 0
|
||||
|
||||
### 后端独有权限码 (不在Canonical基线中): 4
|
||||
|
||||
user.points.adjust.ALL
|
||||
user.points.view.ALL
|
||||
user.whitelist.add.ALL
|
||||
user.whitelist.remove.ALL
|
||||
|
||||
### 后端独有权限码 (不在Canonical基线中): 0
|
||||
|
||||
## Canonical基线缺失项
|
||||
|
||||
|
||||
Reference in New Issue
Block a user