diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index ca27bdf..5923dbd 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -23,15 +23,14 @@ jobs: - name: E2E tests run: | - # Start backend + frontend in background, run cypress, then cleanup + # Start backend DB_PATH=/tmp/ci_oil_test.db FRONTEND_DIR=/dev/null \ /tmp/ci-venv/bin/uvicorn backend.main:app --port 8000 & - BACKEND_PID=$! - cd frontend && npx vite --port 5173 & - FRONTEND_PID=$! + # Start frontend (in subshell to not change cwd) + (cd frontend && npx vite --port 5173) & - # Wait for servers + # Wait for both servers for i in $(seq 1 30); do if curl -sf http://localhost:8000/api/version > /dev/null 2>&1 && \ curl -sf http://localhost:5173/ > /dev/null 2>&1; then @@ -41,13 +40,17 @@ jobs: sleep 1 done - # Run cypress + # Run cypress from frontend dir + cd frontend SPECS=$(ls cypress/e2e/*.cy.js | grep -v demo | grep -v visual | grep -v check | tr '\n' ',') - npx cypress run --spec "$SPECS" --config video=false || true + npx cypress run --spec "$SPECS" --config video=false + EXIT_CODE=$? # Cleanup - kill $BACKEND_PID $FRONTEND_PID 2>/dev/null || true + pkill -f "uvicorn backend" || true + pkill -f "node.*vite" || true rm -f /tmp/ci_oil_test.db + exit $EXIT_CODE build-check: runs-on: test diff --git a/frontend/src/views/MyDiary.vue b/frontend/src/views/MyDiary.vue index e23291c..01b1cb0 100644 --- a/frontend/src/views/MyDiary.vue +++ b/frontend/src/views/MyDiary.vue @@ -2,7 +2,6 @@
-
@@ -216,7 +215,7 @@ const oils = useOilsStore() const diaryStore = useDiaryStore() const ui = useUiStore() -const activeTab = ref('diary') +const activeTab = ref('brand') const pasteText = ref('') const selectedDiaryId = ref(null) const selectedDiary = ref(null) diff --git a/frontend/src/views/RecipeManager.vue b/frontend/src/views/RecipeManager.vue index a102e25..90f8524 100644 --- a/frontend/src/views/RecipeManager.vue +++ b/frontend/src/views/RecipeManager.vue @@ -90,8 +90,8 @@
- -
+ +

🌿 公共配方库 ({{ publicRecipes.length }})