Skip to content

Commit

Permalink
add trace logs
Browse files Browse the repository at this point in the history
  • Loading branch information
m5r committed Jul 1, 2024
1 parent 1402640 commit 0900742
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/e2e/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const takeDownCHT = () => new Promise((resolve, reject) => {
childProcess.on('close', resolve);
});

const time = async (fn, label) => {
const before = Date.now();
const res = await fn();
const took = Date.now() - before;
console.log(`${label} took ${took}ms`);

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 50 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement
return res;
};

before(async () => {
console.log('before');

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 55 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Expand All @@ -51,18 +59,18 @@ before(async () => {
}

if (!fs.existsSync(dockerHelperScript)) {
await downloadDockerHelperScript();
await time(downloadDockerHelperScript, 'download docker helper script');
}

await spinUpCHT();
await time(spinUpCHT, 'spin up cht');

console.log('cht up');

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 67 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement
});

after(async () => {
console.log('after');

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 71 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

await takeDownCHT();
await time(takeDownCHT, 'take down cht');

console.log('cht down');

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected console statement

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 18.x

Unexpected console statement

Check warning on line 75 in test/e2e/hooks.js

View workflow job for this annotation

GitHub Actions / Build for Node version 20.x

Unexpected console statement
});
Expand Down

0 comments on commit 0900742

Please sign in to comment.