Skip to content

Feature/validate #34

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 13, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
load step commits/commands
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jun 13, 2020
commit 37b3d50ef550532416965e1cd5ec7beec64ea4d3
38 changes: 36 additions & 2 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,48 @@ async function validate(args: string[]) {
const runCommands = createCommandRunner(tmpDir);

// VALIDATE TUTORIAL TESTS

// setup
if (commits.INIT) {
// load commits
console.info("Loading setup commits...");
cherryPick(commits.INIT);
await cherryPick(commits.INIT);

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

console.log(skeleton.levels);
for (const level of skeleton.levels) {
if (level.setup) {
// load commits
if (level.setup.commits) {
console.log(`Loading ${level.id} commits...`);
await cherryPick(commits[level.id]);
}
// run commands
if (level.setup.commands) {
console.log(`Running ${level.id} commands...`);
await runCommands(level.setup.commands);
}
}
// steps
if (level.steps) {
for (const step of level.steps) {
// load commits
if (step.setup.commits) {
console.log(`Loading ${step.id} commits...`);
await cherryPick(commits[step.id]);
}
// run commands
if (step.setup.commands) {
console.log(`Running ${step.id} commands...`);
await runCommands(step.setup.commands);
}
}
}
}

Expand Down