Skip to content

Commit 37b3d50

Browse files
committed
load step commits/commands
Signed-off-by: shmck <[email protected]>
1 parent b7acb67 commit 37b3d50

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/validate.ts

+36-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,48 @@ async function validate(args: string[]) {
5353
const runCommands = createCommandRunner(tmpDir);
5454

5555
// VALIDATE TUTORIAL TESTS
56+
57+
// setup
5658
if (commits.INIT) {
5759
// load commits
5860
console.info("Loading setup commits...");
59-
cherryPick(commits.INIT);
61+
await cherryPick(commits.INIT);
6062

6163
// run commands
6264
if (skeleton.config?.testRunner?.setup?.commands) {
63-
runCommands(skeleton.config?.testRunner?.setup?.commands);
65+
console.info("Running setup commands...");
66+
await runCommands(skeleton.config?.testRunner?.setup?.commands);
67+
}
68+
}
69+
70+
console.log(skeleton.levels);
71+
for (const level of skeleton.levels) {
72+
if (level.setup) {
73+
// load commits
74+
if (level.setup.commits) {
75+
console.log(`Loading ${level.id} commits...`);
76+
await cherryPick(commits[level.id]);
77+
}
78+
// run commands
79+
if (level.setup.commands) {
80+
console.log(`Running ${level.id} commands...`);
81+
await runCommands(level.setup.commands);
82+
}
83+
}
84+
// steps
85+
if (level.steps) {
86+
for (const step of level.steps) {
87+
// load commits
88+
if (step.setup.commits) {
89+
console.log(`Loading ${step.id} commits...`);
90+
await cherryPick(commits[step.id]);
91+
}
92+
// run commands
93+
if (step.setup.commands) {
94+
console.log(`Running ${step.id} commands...`);
95+
await runCommands(step.setup.commands);
96+
}
97+
}
6498
}
6599
}
66100

0 commit comments

Comments
 (0)