@@ -58,14 +58,15 @@ async function validate(args: string[]) {
58
58
const runTest = createTestRunner ( tmpDir , skeleton . config . testRunner ) ;
59
59
60
60
// setup
61
+ console . info ( "* Setup" ) ;
61
62
if ( commits . INIT ) {
62
63
// load commits
63
- console . info ( "Loading setup commits..." ) ;
64
+ console . info ( "-- Loading commits..." ) ;
64
65
await cherryPick ( commits . INIT ) ;
65
66
66
67
// run commands
67
68
if ( skeleton . config ?. testRunner ?. setup ?. commands ) {
68
- console . info ( "Running setup commands..." ) ;
69
+ console . info ( "-- Running commands..." ) ;
69
70
70
71
await runCommands (
71
72
skeleton . config ?. testRunner ?. setup ?. commands ,
@@ -76,30 +77,32 @@ async function validate(args: string[]) {
76
77
}
77
78
78
79
for ( const level of skeleton . levels ) {
80
+ console . info ( `* ${ level . id } ` ) ;
79
81
if ( level ?. setup ) {
80
82
// load commits
81
83
if ( commits [ `${ level . id } ` ] ) {
82
- console . log ( `Loading ${ level . id } commits...` ) ;
84
+ console . log ( `-- Loading commits...` ) ;
83
85
await cherryPick ( commits [ level . id ] ) ;
84
86
}
85
87
// run commands
86
88
if ( level . setup ?. commands ) {
87
- console . log ( `Running ${ level . id } commands...` ) ;
89
+ console . log ( `-- Running commands...` ) ;
88
90
await runCommands ( level . setup . commands ) ;
89
91
}
90
92
}
91
93
// steps
92
94
if ( level . steps ) {
93
95
for ( const step of level . steps ) {
96
+ console . info ( `** ${ step . id } ` ) ;
94
97
// load commits
95
98
const stepSetupCommits = commits [ `${ step . id } Q` ] ;
96
99
if ( stepSetupCommits ) {
97
- console . info ( `Loading ${ step . id } setup commits...` ) ;
100
+ console . info ( `--- Loading setup commits...` ) ;
98
101
await cherryPick ( stepSetupCommits ) ;
99
102
}
100
103
// run commands
101
104
if ( step . setup . commands ) {
102
- console . info ( `Running ${ step . id } setup commands...` ) ;
105
+ console . info ( `--- Running setup commands...` ) ;
103
106
await runCommands ( step . setup . commands ) ;
104
107
}
105
108
@@ -109,47 +112,49 @@ async function validate(args: string[]) {
109
112
// ignore running tests on steps with no solution
110
113
if ( hasSolution ) {
111
114
// run test
112
- console . info ( "Running setup test" ) ;
115
+ console . info ( "--- Running setup test... " ) ;
113
116
// expect fail
114
117
const { stdout, stderr } = await runTest ( ) ;
115
118
if ( stdout ) {
116
119
console . error (
117
- `Expected ${ step . id } setup tests to fail, but passed`
120
+ `--- Expected ${ step . id } setup tests to fail, but passed`
118
121
) ;
122
+ // log tests
119
123
console . log ( stdout ) ;
120
124
}
121
125
}
122
126
123
127
if ( stepSolutionCommits ) {
124
- console . info ( `Loading ${ step . id } solution commits...` ) ;
128
+ console . info ( `--- Loading solution commits...` ) ;
125
129
await cherryPick ( stepSolutionCommits ) ;
126
130
}
127
131
128
132
// run commands
129
133
if ( step ?. solution ?. commands ) {
130
- console . info ( `Running ${ step . id } solution commands...` ) ;
134
+ console . info ( `--- Running solution commands...` ) ;
131
135
await runCommands ( step . solution . commands ) ;
132
136
}
133
137
134
138
if ( hasSolution ) {
135
139
// run test
136
- console . info ( "Running solution test" ) ;
140
+ console . info ( "--- Running solution test... " ) ;
137
141
// expect pass
138
142
const { stdout, stderr } = await runTest ( ) ;
139
143
if ( stderr ) {
140
144
console . error (
141
- `Expected ${ step . id } solution tests to pass, but failed`
145
+ `--- Expected ${ step . id } solution tests to pass, but failed`
142
146
) ;
147
+ // log tests
143
148
console . log ( stderr ) ;
144
149
}
145
150
}
146
151
}
147
152
}
148
153
}
149
154
150
- // log level/step
151
- // on error, show level/step & error message
155
+ console . info ( `\n✔ Success!` ) ;
152
156
} catch ( e ) {
157
+ console . error ( "\n✘ Fail!" ) ;
153
158
console . error ( e . message ) ;
154
159
} finally {
155
160
// cleanup
0 commit comments