Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
test(e2e): harden the e2e tooling and CI freshness checks
Sergey Kozyrenkob16d4a8b4af1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 17ccbdff..08052f23 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -67,6 +67,15 @@ jobs:working-directory: frontendrun: pnpm run typescript+ # The app ships the operations compiled into src/graphql/types.ts; regenerate and+ # diff so it can't drift from graphql-schema.graphql (the codegen input the stand's+ # schema-compat pre-flight validates against).+ - name: Frontend - GraphQL codegen is fresh+ working-directory: frontend+ run: |+ pnpm run graphql:generate+ git diff --exit-code src/graphql/types.ts+- name: Frontend - Testworking-directory: frontendrun: pnpm run testdiff --git a/frontend/e2e/mock-llm/server.mjs b/frontend/e2e/mock-llm/server.mjsindex d156fd90..a02f90f3 100644--- a/frontend/e2e/mock-llm/server.mjs+++ b/frontend/e2e/mock-llm/server.mjs@@ -124,6 +124,12 @@ createServer(async (request, response) => {try {payload = JSON.parse((await readBody(request)) || '{}');++ // JSON.parse('null')/'42' succeed, but reading payload.tools/.stream below would+ // then throw outside this try and kill the process — reject non-objects here.+ if (typeof payload !== 'object' || payload === null || Array.isArray(payload)) {+ throw new Error('body must be a JSON object');+ }} catch (error) {respondError(response, 400, `mock-llm: invalid JSON body: ${error}`);diff --git a/frontend/e2e/playwright.config.ts b/frontend/e2e/playwright.config.tsindex 3d117d2a..9f936482 100644--- a/frontend/e2e/playwright.config.ts+++ b/frontend/e2e/playwright.config.ts@@ -122,7 +122,8 @@ export default defineConfig<BackendOptions>({// binaries — it serves a pre-built dist with plain Node.command: isVisual ? 'node e2e/tools/serve-dist.mjs' : 'pnpm run build && pnpm exec vite preview',cwd: fileURLToPath(new URL('..', import.meta.url)),- env: { VITE_PORT: '8000', VITE_USE_HTTPS: 'false' },+ // Pin PORT so an ambient PORT can't move serve-dist off the port Playwright waits on.+ env: { PORT: String(PREVIEW_PORT), VITE_PORT: '8000', VITE_USE_HTTPS: 'false' },// Never reuse a listener on the port: the build runs inside// this command, so a reused (possibly orphaned) preview// silently serves a previous commit's dist as the gate.diff --git a/frontend/package.json b/frontend/package.jsonindex e4c24c81..69c67360 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -11,7 +11,7 @@"e2e:visual": "./e2e/tools/run-visual.sh","e2e:visual:update": "./e2e/tools/run-visual.sh --update","graphql:generate": "graphql-codegen --config graphql-codegen.ts",- "lint": "eslint \"{src,e2e}/**/*.{ts,tsx,js,jsx,mjs}\"",+ "lint": "eslint --max-warnings 0 \"{src,e2e}/**/*.{ts,tsx,js,jsx,mjs}\"","lint:fix": "eslint \"{src,e2e}/**/*.{ts,tsx,js,jsx,mjs}\" --fix","prettier": "prettier --check \"{src,e2e}/**/*.{ts,tsx,js,jsx,mjs,json,css,scss}\"","prettier:fix": "prettier --write \"{src,e2e}/**/*.{ts,tsx,js,jsx,mjs,json,css,scss}\"",