Skip to content

Commit ca8660d

Browse files
committed
debugging :(
1 parent 244dc92 commit ca8660d

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

dist/index.js

Lines changed: 11 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/grading/graders/OverlayGrader.ts

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
268268
artifacts: []
269269
}
270270
}
271-
// const tmpDir = await mkdtemp(path.join(tmpdir(), 'pawtograder-'));
272-
console.log('Beginning grading')
271+
this.logger.log('visible', 'Beginning grading')
273272
const tmpDir = path.join(process.cwd(), 'pawtograder-grading')
274273
await io.mkdirP(tmpDir)
275274
const solutionFiles = await readdir(this.solutionDir)
@@ -282,19 +281,19 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
282281
}
283282
})
284283
)
285-
console.log('Copying student files')
284+
this.logger.log('visible', 'Copying student files')
286285
await this.copyStudentFiles('files')
287286
await this.copyStudentFiles('testFiles')
288287

289-
console.log('Setting up virtual environment')
288+
this.logger.log('visible', 'Setting up virtual environment')
290289

291290
if (this.config.build.venv?.cache_key && this.config.build.venv?.dir_name) {
292291
const venv_dir = this.config.build.venv.dir_name
293292
const cache_key = this.config.build.venv.cache_key
294293
await this.builder.setupVenv(venv_dir, cache_key)
295294
}
296295

297-
console.log('Linting student submission')
296+
this.logger.log('visible', 'Linting student submission')
298297
const lintResult = await this.builder.lint()
299298
if (this.config.build.linter?.policy === 'fail') {
300299
if (lintResult.status === 'fail') {
@@ -313,13 +312,17 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
313312
}
314313
}
315314

316-
console.log('Resetting to run instructor tests on student submission')
315+
this.logger.log(
316+
'visible',
317+
'Resetting to run instructor tests on student submission'
318+
)
317319
await this.resetSolutionFiles()
318320
await this.copyStudentFiles('files')
319321
const gradedParts = this.config.gradedParts || []
320322

321323
try {
322-
console.log(
324+
this.logger.log(
325+
'visible',
323326
'Building project with student submission and running instructor tests'
324327
)
325328
await this.builder.buildClean({
@@ -436,12 +439,13 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
436439
this.config.submissionFiles.testFiles.length > 0 &&
437440
this.config.build.student_tests?.instructor_impl?.run_tests
438441
) {
439-
console.log(
442+
this.logger.log(
443+
'visible',
440444
'Resetting to have student tests with the instructor solution'
441445
)
442446
await this.resetSolutionFiles()
443447
await this.copyStudentFiles('testFiles')
444-
console.log('Building solution and running student tests')
448+
this.logger.log('visible', 'Building solution and running student tests')
445449
try {
446450
await this.builder.buildClean({
447451
timeoutSeconds:
@@ -495,7 +499,10 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
495499
mutantFailureAdvice +=
496500
'\n\nPlease fix the above errors and resubmit for grading.'
497501
} else {
498-
console.log('Running student tests against buggy solutions')
502+
this.logger.log(
503+
'visible',
504+
'Running student tests against buggy solutions'
505+
)
499506
try {
500507
mutantResults = await this.builder.mutationTest({
501508
timeoutSeconds:
@@ -514,7 +521,10 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
514521
this.config.build.student_tests?.student_impl?.run_tests) &&
515522
this.config.submissionFiles.testFiles.length > 0
516523
) {
517-
console.log('Running student tests against student implementation')
524+
this.logger.log(
525+
'visible',
526+
'Running student tests against student implementation'
527+
)
518528
try {
519529
await this.resetSolutionFiles()
520530
await this.copyStudentFiles('testFiles')
@@ -534,7 +544,7 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
534544
this.logger.log('visible', msg)
535545
}
536546
}
537-
console.log('Wrapping up')
547+
this.logger.log('visible', 'Wrapping up')
538548
const testFeedbacks = gradedParts
539549
.map((part) =>
540550
this.gradePart(part, testResults, mutantResults, mutantFailureAdvice)

0 commit comments

Comments
 (0)