From bc32d6fecb2ebdf0174e13aba01a5b5adaee4401 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Fri, 13 Jun 2025 00:35:35 +0800 Subject: [PATCH] fix: ci crash due to no dugite binary, due to NODE_ENV=test not set --- .github/workflows/test.yml | 4 ++-- features/stepDefinitions/application.ts | 4 +++- package.json | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8777259c..ea0025ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ on: jobs: test: - runs-on: macos-latest + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -83,7 +83,7 @@ jobs: with: name: application-logs path: | - ~/Library/Logs/TidGi/ + ~/.local/share/TidGi/ userData-dev/logs/ retention-days: 7 continue-on-error: true diff --git a/features/stepDefinitions/application.ts b/features/stepDefinitions/application.ts index 39477d1c..dc129a87 100644 --- a/features/stepDefinitions/application.ts +++ b/features/stepDefinitions/application.ts @@ -105,7 +105,9 @@ When('I launch the TidGi application', async function(this: ApplicationWorld) { const windowTimeout = process.env.CI ? 45000 : 10000; this.mainWindow = await this.app.firstWindow({ timeout: windowTimeout }); } catch (error) { - throw new Error(`Failed to launch TidGi application: ${error as Error}. You should run \`pnpm run package:dev\` before running the tests to ensure the app is built.`); + throw new Error( + `Failed to launch TidGi application: ${error as Error}. You should run \`pnpm run package\` before running the tests to ensure the app is built, and build with binaries like "dugite" and "tiddlywiki", see scripts/afterPack.js for more details.`, + ); } }); diff --git a/package.json b/package.json index f5fadd68..e7d9299c 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,10 @@ "start:dev:debug-main": "cross-env NODE_ENV=development DEBUG_MAIN=true electron-forge start", "start:dev:debug-react": "cross-env NODE_ENV=development DEBUG_REACT=true electron-forge start", "build:plugin": "zx scripts/compilePlugins.mjs", - "test": "pnpm run test:unit && pnpm run package:dev && pnpm run test:e2e", + "test": "pnpm run test:unit && pnpm run package && pnpm run test:e2e", "test:unit": "jest", "test:e2e": "cross-env NODE_ENV=test cucumber-js --config features/cucumber.config.js", - "package": "pnpm run build:plugin && electron-forge package", - "package:dev": "pnpm run build:plugin && cross-env NODE_ENV=test electron-forge package", + "package": "pnpm run build:plugin && cross-env NODE_ENV=test electron-forge package", "make": "pnpm run build:plugin && cross-env NODE_ENV=production electron-forge make", "init:git-submodule": "git submodule update --recursive && git submodule update --remote", "lint": "eslint ./src --ext js,ts,tsx,json",