Skip to content

Commit 9ee2556

Browse files
committed
chore: update gitignore with test dirs
1 parent aeaf11c commit 9ee2556

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
@@ -35,7 +35,6 @@ jobs:
3535
uses: ./ci/images/debian10
3636
with:
3737
args: ./ci/steps/test-unit.sh
38-
3938
test-e2e:
4039
needs: linux-amd64
4140
runs-on: ubuntu-latest
@@ -53,15 +52,17 @@ jobs:
5352
run: |
5453
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
5554
- uses: microsoft/playwright-github-action@v1
56-
- name: Install dependencies and run tests
57-
with:
58-
args: ./ci/steps/test-e2e.sh
55+
- name: Install dependencies and run end-to-end tests
56+
run: |
57+
./release-packages/code-server*-linux-amd64/bin/code-server --home $CODE_SERVER_ADDRESS/healthz &
58+
yarn --frozen-lockfile
59+
yarn test:e2e
5960
- name: Upload test artifacts
6061
if: always()
6162
uses: actions/upload-artifact@v2
6263
with:
6364
name: test-videos
64-
path: ./test/e2e//videos
65+
path: ./test/e2e/videos
6566
- name: Remove release packages and test artifacts
6667
run: rm -rf ./release-packages ./test/e2e/videos
6768

.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)