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 solution commits
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jun 13, 2020
commit 6f1c7fffe7431f8e3855ae62cbcd99546c1b6c57
33 changes: 24 additions & 9 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function validate(args: string[]) {
for (const level of skeleton.levels) {
if (level.setup) {
// load commits
if (level.setup.commits) {
if (commits[`${level.id}`]) {
console.log(`Loading ${level.id} commits...`);
await cherryPick(commits[level.id]);
}
Expand All @@ -93,21 +93,36 @@ async function validate(args: string[]) {
// steps
if (level.steps) {
for (const step of level.steps) {
console.log(step);
// load commits
if (step.setup.commits) {
console.log(`Loading ${step.id} commits...`);
await cherryPick(commits[step.id]);
const stepSetupCommits = commits[`${step.id}Q`];
if (stepSetupCommits) {
console.info(`Loading ${step.id} setup commits...`);
await cherryPick(stepSetupCommits);
}
// run commands
if (step.setup.commands) {
console.log(`Running ${step.id} commands...`);
console.info(`Running ${step.id} setup commands...`);
await runCommands(step.setup.commands);
}

// run test
console.info("Running test");
await runTest();
// ignore runnning tests on steps with no solution
if (step.solution) {
// run test
console.info("Running test");
// await runTest();
}

const stepSolutionCommits = commits[`${step.id}A`];
if (stepSolutionCommits) {
console.info(`Loading ${step.id} solution commits...`);
await cherryPick(stepSolutionCommits);
}

// run commands
if (step?.solution?.commands) {
console.info(`Running ${step.id} solution commands...`);
await runCommands(step.solution.commands);
}
}
}
}
Expand Down