Skip to content

Commit 114dcb6

Browse files
committed
chore: update gitignore with test dirs
1 parent 1bff916 commit 114dcb6

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

.github/workflows/ci.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
uses: ./ci/images/debian10
3030
with:
3131
args: ./ci/steps/test-unit.sh
32-
3332
test-e2e:
3433
needs: linux-amd64
3534
runs-on: ubuntu-latest
@@ -47,15 +46,17 @@ jobs:
4746
run: |
4847
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
4948
- uses: microsoft/playwright-github-action@v1
50-
- name: Install dependencies and run tests
51-
with:
52-
args: ./ci/steps/test-e2e.sh
49+
- name: Install dependencies and run end-to-end tests
50+
run: |
51+
./release-packages/code-server*-linux-amd64/bin/code-server --home $CODE_SERVER_ADDRESS/healthz &
52+
yarn --frozen-lockfile
53+
yarn test:e2e
5354
- name: Upload test artifacts
5455
if: always()
5556
uses: actions/upload-artifact@v2
5657
with:
5758
name: test-videos
58-
path: ./test/e2e//videos
59+
path: ./test/e2e/videos
5960
- name: Remove release packages and test artifacts
6061
run: rm -rf ./release-packages ./test/e2e/videos
6162

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ node-*
1616
.home
1717
coverage
1818
**/.DS_Store
19-
test/videos
20-
test/screenshots
19+
test/e2e/videos
20+
test/e2e/screenshots

ci/steps/test-e2e.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44
main() {
55
cd "$(dirname "$0")/../.."
66

7-
./release-packages/code-server*-linux-amd64/bin/code-server --home $CODE_SERVER_ADDRESS/healthz &
7+
"./release-packages/code-server*-linux-amd64/bin/code-server" --home "$CODE_SERVER_ADDRESS"/healthz &
88
yarn --frozen-lockfile
99
yarn test:e2e
1010
}

test/utils/integration.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as express from "express"
2+
import { createApp } from "../../src/node/app"
3+
import { parse, setDefaults, parseConfigFile, DefaultedArgs } from "../../src/node/cli"
4+
import { register } from "../../src/node/routes"
5+
import * as httpserver from "./httpserver"
6+
7+
export async function setup(
8+
argv: string[],
9+
configFile?: string,
10+
): Promise<[express.Application, express.Application, httpserver.HttpServer, DefaultedArgs]> {
11+
argv = ["--bind-addr=localhost:0", ...argv]
12+
13+
const cliArgs = parse(argv)
14+
const configArgs = parseConfigFile(configFile || "", "test/integration.ts")
15+
const args = await setDefaults(cliArgs, configArgs)
16+
17+
const [app, wsApp, server] = await createApp(args)
18+
await register(app, wsApp, server, args)
19+
20+
return [app, wsApp, new httpserver.HttpServer(server), args]
21+
}

0 commit comments

Comments
 (0)