Skip to content

Commit b4bf96c

Browse files
committed
More progress
1 parent 428077c commit b4bf96c

File tree

7 files changed

+382
-49
lines changed

7 files changed

+382
-49
lines changed

benchmark/harness/package-lock.json

Lines changed: 241 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmark/harness/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
"private": true,
55
"scripts": {
66
"build": "cd ../.. && npm run build",
7-
"compile": "tsc -p tsconfig.json",
7+
"compile": "rm -rf out && tsc -p tsconfig.json",
88
"lint": "eslint src --ext ts",
99
"check-types": "tsc --noEmit",
1010
"dev": "npm run compile && npx dotenvx run -f .env.integration -- node ./out/run.js"
1111
},
1212
"devDependencies": {
1313
"@vscode/test-electron": "^2.4.0",
1414
"tsx": "^4.19.3",
15-
"typescript": "^5.4.5"
15+
"typescript": "^5.4.5",
16+
"yargs": "^17.7.2"
1617
}
1718
}

benchmark/harness/src/run.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
import * as path from "path"
22

3+
import yargs from "yargs"
4+
import { hideBin } from "yargs/helpers"
35
import { runTests } from "@vscode/test-electron"
46

57
async function main() {
8+
const argv = await yargs(hideBin(process.argv))
9+
.option("exercise", {
10+
alias: "e",
11+
type: "string",
12+
description: "Path to the exercise directory",
13+
required: true,
14+
})
15+
.help().argv
16+
617
const extensionDevelopmentPath = path.resolve(__dirname, "../../../")
718
const extensionTestsPath = path.resolve(__dirname, "./runExercise")
19+
const testWorkspace = path.resolve(__dirname, "..", argv.exercise)
820

921
await runTests({
1022
extensionDevelopmentPath: extensionDevelopmentPath,
1123
extensionTestsPath: extensionTestsPath,
12-
launchArgs: ["foo", "bar", "baz"],
24+
launchArgs: [testWorkspace, "--disable-extensions"],
25+
extensionTestsEnv: {
26+
prompt: `
27+
Your job is to complete a coding exercise described by \`.docs/instructions.md\`.
28+
A file with the implementation stubbed out has been created for you, along with a test file.
29+
To successfully complete the exercise, you must pass all the tests in the test file.
30+
To confirm that your solution is correct, run the tests with \`yarn test\`.
31+
Before running the test make sure your environment is set up by running \`corepack enable\` to enable yarn and \`yarn install\` to install the dependencies.
32+
`
33+
.trim()
34+
.split("\n")
35+
.map((line) => line.trim())
36+
.join("\n"),
37+
},
1338
})
1439
}
1540

0 commit comments

Comments
 (0)