Skip to content

Commit

Permalink
Refactor starter code tester: move dockerfile processing before prepa…
Browse files Browse the repository at this point in the history
…ring repository directory for language. Remove unnecessary code for changing

ownership of starter repo directory. Restore changes to .sh files as a workaround for precompilation step.
  • Loading branch information
rohitpaulk committed Aug 16, 2024
1 parent eeaaec6 commit bea867a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/testers/starter-code-tester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default class StarterCodeTester extends BaseTester {
}

async doTest() {
this.copiedStarterDir = await this.course.prepareRepositoryDirForLanguage(this.language, this.testerDir);
await this.dockerfile!.processContents();
this.copiedStarterDir = await this.course.prepareRepositoryDirForLanguage(this.language, this.testerDir);

Logger.logHeader(`Testing starter: ${this.course.slug}-${this.language.slug}`);

Expand Down Expand Up @@ -80,10 +80,10 @@ export default class StarterCodeTester extends BaseTester {

Logger.logInfo("Checking if there are no uncommitted changes to compiled templates");

if (process.env.CI === "true") {
Logger.logInfo("Making starter repo directory owned by current user");
await ShellCommandExecutor.execute(`sudo chown -R $(id -u):$(id -g) ${this.copiedStarterDir}`); // Hack to fix GitHub actions permissions issue?
}
// if (process.env.CI === "true") {
// Logger.logInfo("Making starter repo directory owned by current user");
// await ShellCommandExecutor.execute(`sudo chown -R $(id -u):$(id -g) ${this.copiedStarterDir}`); // Hack to fix GitHub actions permissions issue?
// }

Logger.logInfo("Restoring changes to .sh files");
await ShellCommandExecutor.execute(`git -C ${this.copiedStarterDir} restore *.sh`); // Hack to work around our precompilation step mangling .sh files
Expand Down

0 comments on commit bea867a

Please sign in to comment.