Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

breaking - changes to testRunner.setup#70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromtestRunner-setup
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionpackage-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

5 changes: 3 additions & 2 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@coderoad/cli",
"version": "0.5.1",
"version": "0.6.0",
"description": "A CLI to build the configuration file for Coderoad Tutorials",
"keywords": [
"coderoad",
Expand All@@ -15,8 +15,9 @@
"url": "git+https://github.com/coderoad/coderoad-cli.git"
},
"license": "SEE LICENSE IN LICENSE.md",
"author": "Argemiro Neto",
"author": "Shawn McKay",
"contributors": [
"Argemiro Neto",
"Shawn McKay"
],
"files": [
Expand Down
22 changes: 22 additions & 0 deletionssrc/schema/meta.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -47,6 +47,25 @@ export default {
type: "string",
},
},
vscode_command_array: {
type: "array",
description:
"An array of VSCode commands that can be called using the vscode commands API.",
items: {
anyOf: [
{
type: "string",
description: "A VSCode command without params",
},
{
type: "array",
description: "A VSCode command with params",
minLength: 2,
maxLength: 2,
},
],
},
},
commit_array: {
type: "array",
description:
Expand DownExpand Up@@ -105,6 +124,9 @@ export default {
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
watchers: {
type: "array",
items: {
Expand Down
30 changes: 21 additions & 9 deletionssrc/schema/skeleton.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,14 +52,25 @@ export default {
description: "An optional folder for the test runner",
examples: ["coderoad"],
},
setup: {
$ref: "#/definitions/setup_action_without_commits",
description:
"Setup actions or commands used for setting up the test runner on tutorial launch",
},
},
required: ["command", "args"],
},
setup: {
type: "object",
description:
"Setup commits or commands used for setting up the test runner on tutorial launch",
properties: {
commits: {
$ref: "#/definitions/commit_array",
},
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
},
repo: {
type: "object",
description: "The repo holding the git commits for the tutorial",
Expand All@@ -84,10 +95,11 @@ export default {
type: "object",
description: "Configuration options for resetting a tutorial",
properties: {
command: {
type: "string",
description: "An optional command to run on reset",
examples: ["npm install"],
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
additionalProperties: false,
Expand Down
30 changes: 21 additions & 9 deletionssrc/schema/tutorial.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -71,14 +71,25 @@ export default {
description: "An optional folder for the test runner",
examples: ["coderoad"],
},
setup: {
$ref: "#/definitions/setup_action",
description:
"Setup commits or commands used for setting up the test runner on tutorial launch",
},
},
required: ["command", "args"],
},
setup: {
type: "object",
description:
"Setup commits or commands used for setting up the test runner on tutorial launch",
properties: {
commits: {
$ref: "#/definitions/commit_array",
},
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
},
repo: {
type: "object",
description: "The repo holding the git commits for the tutorial",
Expand All@@ -103,10 +114,11 @@ export default {
type: "object",
description: "Configuration options for resetting a tutorial",
properties: {
command: {
type: "string",
description: "An optional command to run on reset",
examples: ["npm install"],
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
additionalProperties: false,
Expand Down
4 changes: 2 additions & 2 deletionssrc/utils/parse.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,8 +153,8 @@ export function parse(params: ParseParams): any {
// add init commits
if (params.commits.INIT && params.commits.INIT.length) {
// @ts-ignore
parsed.config.testRunner.setup = {
...(parsed.config?.testRunner?.setup || {}),
parsed.config.setup = {
...(parsed.config?.setup || {}),
commits: params.commits.INIT,
};
}
Expand Down
8 changes: 2 additions & 6 deletionssrc/validate.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,14 +74,10 @@ async function validate(args: string[]) {
await cherryPick(commits.INIT);

// run commands
if (skeleton.config?.testRunner?.setup?.commands) {
if (skeleton.config?.setup?.commands) {
console.info("-- Running commands...");

await runCommands(
skeleton.config?.testRunner?.setup?.commands,
// add optional setup directory
skeleton.config?.testRunner?.directory
);
await runCommands(skeleton.config?.setup?.commands);
}
}

Expand Down
22 changes: 11 additions & 11 deletionstests/parse.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -987,9 +987,9 @@ Description.
tap: "--reporter=mocha-tap-reporter",
},
directory: "coderoad",
setup: {
commands: [],
},
},
setup: {
commands: [],
},
appVersions: {
vscode: ">=0.7.0",
Expand All@@ -999,7 +999,7 @@ Description.
branch: "aBranch",
},
reset: {
command:"some command",
commands: ["some command"],
},
dependencies: [
{
Expand All@@ -1026,16 +1026,16 @@ Description.
tap: "--reporter=mocha-tap-reporter",
},
directory: "coderoad",
setup: {
commands: [],
},
},
setup: {
commands: [],
},
repo: {
uri: "https://path.to/repo",
branch: "aBranch",
},
reset: {
command:"some command",
commands: ["some command"],
},
dependencies: [
{
Expand DownExpand Up@@ -1101,9 +1101,9 @@ Description.
tap: "--reporter=mocha-tap-reporter",
},
directory: "coderoad",
setup: {
commits: ["abcdef1", "123456789"],
},
},
setup: {
commits: ["abcdef1", "123456789"],
},
repo: {
uri: "https://path.to/repo",
Expand Down
7 changes: 4 additions & 3 deletionstests/skeleton.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,15 +8,16 @@ const validJson = {
config: {
testRunner: {
directory: "coderoad",
setup: {
commands: [],
},

args: {
filter: "--grep",
tap: "--reporter=mocha-tap-reporter",
},
command: "./node_modules/.bin/mocha",
},
setup: {
commands: [],
},
repo: {
uri: "http://github.com/somePath/toRepo.git",
branch: "codeBranch",
Expand Down
8 changes: 4 additions & 4 deletionstests/tutorial.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,10 +13,10 @@ const validJson: Partial<T.Tutorial> = {
tap: "tap",
},
directory: "coderoad",
setup: {
commits: ["abcdef1"],
commands: ["npm install"],
},
},
setup: {
commits: ["abcdef1"],
commands: ["npm install"],
},
repo: {
uri: "https://github.com/some-repo.git",
Expand Down
2 changes: 1 addition & 1 deletiontypings/tutorial.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ export type TutorialConfig = {
repo: TutorialRepo;
dependencies?: TutorialDependency[];
reset?: ConfigReset;
setup?: StepActions;
};

/** Logical groupings of tasks */
Expand DownExpand Up@@ -69,7 +70,6 @@ export interface TestRunnerConfig {
command: string;
args: TestRunnerArgs;
directory?: string;
setup?: StepActions;
}

export interface TutorialRepo {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp