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

Tests without WebGL Context #4972

Open
AmitMY opened this issue Dec 11, 2024 · 3 comments
Open

Tests without WebGL Context #4972

AmitMY opened this issue Dec 11, 2024 · 3 comments

Comments

@AmitMY
Copy link

AmitMY commented Dec 11, 2024

@google/model-viewer v4.0.0 (also tried v3.5.0)

When running tests in CI (GitHub Actions, without a screen), there seems to be an issue i was not having before:

TypeError: this.threeRenderer is undefined thrown

and

Uncaught TypeError: Cannot read properties of undefined (reading 'xr') thrown

which come together with (it seems):

Chrome Headless 131.0.0.0 (Mac OS 10.15.7) WARN: Error: Error creating WebGL context.
Error: Error creating WebGL context.
    at new WebGLRenderer (http://localhost:9876/_karma_webpack_/webpack:/node_modules/three/build/three.module.js:14906:13)
    at new Renderer (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/three-components/Renderer.js:73:34)
    at Function.singleton (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/three-components/Renderer.js:103:31)
    at new LoadingModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/loading.js:177:22)
    at new ARModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/ar.js:58:13)
    at new ControlsModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/controls.js:178:13)
    at new EnvironmentModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/environment.js:37:13)
    at new StagingModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/staging.js:42:13)
    at new SceneGraphModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/scene-graph.js:41:13)
    at new AnnotationModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/annotation.js:35:13)
@elalish
Copy link
Contributor

elalish commented Dec 11, 2024

Hmm, I haven't seen that - I'm guessing something else is different, since our CI is not having this problem. Would you mind sending a PR to see if you can trigger the problem here on our CI?

@AmitMY
Copy link
Author

AmitMY commented Dec 12, 2024

Seems like you were having the same issue: karma-runner/karma-chrome-launcher#263
Unfortunately, using Angular, it seems like I can't easily migrate off of Karma.

We're currently evaluating Web Test Runner, Vitest, and Jest as candidates for a new test runner for Angular projects while preserving Jasmine as assertion library to not break existing tests.

So it might be a problem of the test runner rather than the library

@elalish
Copy link
Contributor

elalish commented Dec 12, 2024

Oh yeah, Karma is dead. We moved to web-test-runner; it's way better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants