Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce frontend tests output #1353

Closed
deboer-tim opened this issue Feb 18, 2025 · 0 comments · Fixed by #1354
Closed

Reduce frontend tests output #1353

deboer-tim opened this issue Feb 18, 2025 · 0 comments · Fixed by #1354
Assignees
Labels

Comments

@deboer-tim
Copy link
Contributor

Is your enhancement related to a problem? Please describe

When running the frontend tests there is a lot of extraneous console output/errors, which makes it hard to debug other issues or new tests.

stderr | src/lib/disk-image/DiskImageDetailsBuild.spec.ts
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at /Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/common/Color.ts:127:24
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/common/Color.ts:118:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32)
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/browser/renderer/dom/DomRendererRowFactory.ts:11:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32)
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/browser/renderer/dom/DomRenderer.ts:6:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32) undefined

 ✓ src/lib/disk-image/DiskImageActions.spec.ts (3 tests) 91ms
stderr | src/Build.spec.ts > If inspectImage fails, do not select any architecture / make them available
Error inspecting image: Error
Error inspecting image: Error

 ✓ src/lib/disk-image/DiskImageDetailsBuild.spec.ts (2 tests) 87ms
stderr | src/Build.spec.ts > Show the image if isManifest: true and Labels is empty
Error inspecting manifest: TypeError: Cannot read properties of undefined (reading 'filter')
    at findImagesAssociatedToManifest (/Users/deboer/git/pd-extension-bootc/packages/frontend/src/Build.svelte:110:17)
    at detectFedoraImageFilesystem (/Users/deboer/git/pd-extension-bootc/packages/frontend/src/Build.svelte:486:24)

stderr | src/lib/disk-image/DiskImageDetails.spec.ts
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/Users/deboer/git/pd-extension-bootc/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at /Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/common/Color.ts:127:24
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/common/Color.ts:118:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32)
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/browser/renderer/dom/DomRendererRowFactory.ts:11:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32)
    at Object.call (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/src/browser/renderer/dom/DomRenderer.ts:6:1)
    at i (/Users/deboer/git/pd-extension-bootc/node_modules/@xterm/xterm/lib/webpack:/@xterm/xterm/webpack/bootstrap:19:32) undefined

 ✓ src/lib/BootcStatusIcon.spec.ts (5 tests) 64ms
 ✓ src/lib/disk-image/DiskImageConnectionStatus.spec.ts (2 tests) 47ms
 ✓ src/lib/disk-image/columns/Folder.spec.ts (1 test) 48ms
 ✓ src/lib/disk-image/DiskImageDetails.spec.ts (1 test) 52ms
 ✓ src/lib/disk-image/DiskImageDetailsSummary.spec.ts (1 test) 30ms
stderr | src/Build.spec.ts > have amd64 and arm64 NOT disabled if inspectManifest contains both architectures / child images
Error inspecting manifest: TypeError: Cannot read properties of undefined (reading 'filter')
    at findImagesAssociatedToManifest (/Users/deboer/git/pd-extension-bootc/packages/frontend/src/Build.svelte:110:17)
    at detectFedoraImageFilesystem (/Users/deboer/git/pd-extension-bootc/packages/frontend/src/Build.svelte:486:24)

 ✓ src/lib/disk-image/columns/Actions.spec.ts (1 test) 71ms
 ✓ src/lib/upstream/Util.spec.ts (3 tests) 2ms
stderr | src/Build.spec.ts > if a manifest is created that has the label "6.8.9-300.fc40.aarch64" in associated digest images, xfs should be selected by default
Error inspecting image: Error
Error inspecting image: Error

Describe the solution you'd like

Mock canvas using the same solution as Podman Desktop, and clean up a couple of the other mocking/failures.

Describe alternatives you've considered

No response

Additional context

No response

@deboer-tim deboer-tim self-assigned this Feb 18, 2025
deboer-tim added a commit to deboer-tim/podman-desktop-extension-bootc that referenced this issue Feb 18, 2025
The frontend test output is getting long and hard to scroll and find test output,
partially due to mocking issues.

Use the same fix as podman-desktop/podman-desktop#9287 to
mock HTML canvas.

Fixes podman-desktop#1353.

Signed-off-by: Tim deBoer <[email protected]>
@deboer-tim deboer-tim moved this to 🚥 In Review in Podman Desktop Planning Feb 18, 2025
@github-project-automation github-project-automation bot moved this from 🚥 In Review to ✔️ Done in Podman Desktop Planning Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

1 participant