Skip to content

Commit 436ac47

Browse files
committed
Print debug messages
1 parent 77bf3d3 commit 436ac47

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

.github/workflows/test-installers.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ jobs:
124124
test: time-to-first-query
125125

126126
runs-on: ${{ matrix.runs-on }}
127+
env:
128+
DEBUG: compass:smoketests:*
127129
steps:
128130
- name: Checkout
129131
uses: actions/checkout@v2

packages/compass-smoke-tests/src/downloads.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function downloadFile({
1919
targetFilename,
2020
clearCache,
2121
}: DownloadFileOptions): Promise<string> {
22+
debug('Fetching', { url });
2223
const response = await fetch(url);
2324

2425
assert(
@@ -40,7 +41,7 @@ export async function downloadFile({
4041
if (clearCache) {
4142
fs.rmSync(cacheDirectoryPath, { recursive: true, force: true });
4243
} else {
43-
debug('Skipped downloading', url, '(cache existed)');
44+
debug('Skipped downloading (cache existed)', { url });
4445
return outputPath;
4546
}
4647
}
@@ -51,11 +52,11 @@ export async function downloadFile({
5152

5253
// Write the response to file
5354
assert(response.body, 'Expected a response body');
54-
debug('Downloading', url);
55+
debug('Downloading', { url, outputPath });
5556
await stream.promises.pipeline(
5657
response.body,
5758
fs.createWriteStream(outputPath)
5859
);
59-
60+
debug('Download completed', { url, outputPath });
6061
return outputPath;
6162
}

packages/compass-smoke-tests/src/installers/linux-deb.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import assert from 'node:assert/strict';
22
import fs from 'node:fs';
33
import path from 'node:path';
4+
import createDebug from 'debug';
45

56
import type { InstalledAppInfo, InstallablePackage } from './types';
67
import { execute } from '../execute';
78
import * as apt from './apt';
89

10+
const debug = createDebug('compass:smoketests:linux-deb');
11+
912
export function installLinuxDeb({
1013
kind,
1114
filepath,
@@ -18,6 +21,7 @@ export function installLinuxDeb({
1821
const appPath = path.resolve(installPath, appName);
1922

2023
function uninstall() {
24+
debug('Uninstalling %s', filepath);
2125
execute('sudo', ['apt', 'remove', '--yes', '--purge', packageName]);
2226
}
2327

packages/compass-smoke-tests/src/installers/linux-rpm.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import assert from 'node:assert/strict';
22
import cp from 'node:child_process';
33
import path from 'node:path';
44
import fs from 'node:fs';
5+
import createDebug from 'debug';
56

67
import type { InstalledAppInfo, InstallablePackage } from './types';
78
import { execute } from '../execute';
9+
10+
const debug = createDebug('compass:smoketests:linux-rpm');
11+
812
/**
913
* Call dnf to get the package name
1014
*/
@@ -48,6 +52,7 @@ export function installLinuxRpm({
4852
const appPath = path.resolve(installPath, appName);
4953

5054
function uninstall() {
55+
debug('Uninstalling %s', filepath);
5156
execute('sudo', ['dnf', 'remove', '-y', packageName]);
5257
}
5358

packages/compass-smoke-tests/src/installers/windows-msi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function installWindowsMSI({
2121
const appPath = path.resolve(installDirectory, `${appName}.exe`);
2222

2323
function uninstall() {
24+
debug('Uninstalling %s', filepath);
2425
execute('msiexec', ['/uninstall', filepath, '/passive']);
2526
}
2627

packages/compass-smoke-tests/src/installers/windows-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function installWindowsSetup({
3535
}
3636

3737
function uninstall({ expectMissing = false }: UninstallOptions = {}) {
38+
debug('Uninstalling %s', filepath);
3839
const entry = queryRegistry();
3940
if (entry) {
4041
const {

0 commit comments

Comments
 (0)