Skip to content

Commit cf5eda6

Browse files
mtorpjdalton
authored andcommitted
backport Socket fix improvements - PR 796
1 parent 071e575 commit cf5eda6

File tree

13 files changed

+667
-36
lines changed

13 files changed

+667
-36
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['*']
7+
pull_request:
8+
branches: [main]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
e2e-tests:
16+
runs-on: ${{ matrix.os }}
17+
timeout-minutes: 20
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
node-version: [20, 22, 24]
22+
os: [ubuntu-latest]
23+
# os: [ubuntu-latest, windows-latest] - Windows tests disbaled (see project https://linear.app/socketdev/project/autofixes-windows-support-fc2f2a45f759)
24+
steps:
25+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@51be85d39d3b4a42dd9d4712948b9d30a2e04794
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Build
30+
run: pnpm run build
31+
32+
- name: Run e2e tests
33+
env:
34+
SOCKET_CLI_API_TOKEN: ${{ secrets.SOCKET_CLI_API_TOKEN }}
35+
run: pnpm run e2e-tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ Thumbs.db
1515
*.d.ts
1616
*.d.ts.map
1717
*.tsbuildinfo
18+
test/fixtures/commands/fix/e2e-test-js-temp-*
19+
test/fixtures/commands/fix/e2e-test-py-temp-*
1820

1921
!/.vscode/extensions.json

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ You are a **Principal Software Engineer** responsible for:
3333
- **Test multiple files**: ✅ CORRECT: `pnpm test:unit file1.test.mts file2.test.mts`
3434
- **Test with pattern**: ✅ CORRECT: `pnpm test:unit src/commands/specific/cmd-file.test.mts -t "pattern"`
3535
- ❌ WRONG: `pnpm test:unit -- src/commands/specific/cmd-file.test.mts -t "pattern"`
36+
- **Run E2E socket fix tests**: ✅ CORRECT: Run `pnpm run e2e-tests`
3637
- **Update snapshots**:
3738
- All tests: `pnpm testu` (builds first, then updates all snapshots)
3839
- Single file: ✅ CORRECT: `pnpm testu src/commands/specific/cmd-file.test.mts`

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"prepare": "dotenvx -q run -f .env.local -- husky",
7373
"bs": "dotenvx -q run -f .env.local -- pnpm build:dist:src; pnpm exec socket --",
7474
"s": "dotenvx -q run -f .env.local -- pnpm exec socket --",
75+
"e2e-tests": "dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
7576
"test": "run-s check test:*",
7677
"test:prepare": "dotenvx -q run -f .env.test -- pnpm build && del-cli 'test/**/node_modules'",
7778
"test:unit": "dotenvx -q run -f .env.test -- vitest run",

socket.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: 2
2+
3+
projectIgnorePaths:
4+
- "test/fixtures/commands/fix"

0 commit comments

Comments
 (0)