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

[plugins] Cannot read property 'getExtension' of vscode.extensions #19172

Closed
5 of 22 tasks
svor opened this issue Mar 1, 2021 · 4 comments
Closed
5 of 22 tasks

[plugins] Cannot read property 'getExtension' of vscode.extensions #19172

svor opened this issue Mar 1, 2021 · 4 comments
Assignees
Labels
area/plugins kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/current

Comments

@svor
Copy link
Contributor

svor commented Mar 1, 2021

Describe

This task is to investigate the problem why it is not possible to get extensions when trying to run tests of a vscode extension on top of che-theia, in other wordsvscode.extensions.getExtension(id) returns Cannot read property 'getExtension' of undefined.

It is needed for #18219.

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Create a workspace from
apiVersion: 1.0.0
metadata:
  name: che-helloworld-test-sample
components:
  - mountSources: true
    memoryLimit: 3Gi
    type: dockerimage
    image: 'quay.io/eclipse/che-theia-dev:next'
    alias: che-dev
  - type: chePlugin
    reference: 'https://raw.githubusercontent.com/svor/che-vscode-extension-tests/main/meta.yaml'
  - id: timonwong/shellcheck/latest
    type: chePlugin
  - id: eclipse/che-theia/next
    memoryLimit: 1024Mi
    type: cheEditor
  1. Open theia-ide terminal and clone https://github.com/timonwong/vscode-shellcheck.git into /tmp
  2. Go to /tmp/vscode/shellcheck and compile the extension (yarn install, yarn compile)
  3. Copy /tmp/vscode/shellcheck into /projects (cp -r /tmp/vscode/shellcheck /projects)
  4. Try to run tests from the extension by executing Run VS Code extension tests command (F1 -> Run VS Code extension tests)

Another way with vscode extension:

  1. Create a workspace from
apiVersion: 1.0.0
metadata:
  name: extension-test-sample
projects:
  - name: extension-tests-runner
    source:
      location: 'https://github.com/svor/extension-tests-runner.git'
      type: git
components:
  - mountSources: true
    memoryLimit: 3Gi
    type: dockerimage
    image: 'quay.io/eclipse/che-theia-dev:next'
    alias: che-dev
  - type: chePlugin
    reference: 'https://raw.githubusercontent.com/svor/extension-tests-runner/main/meta.yaml'
  - id: ms-vscode/node-debug2/latest
    type: chePlugin
  1. Open theia-ide terminal and go to /projects/extension-tests-runner
  2. Run yarn and yarn compile
  3. Run tests from /projects/extension-tests-runner by executing a command: F1 -> Run VSCode Extension's Tests From /projects

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

screenshot-che-dogfooding apps che-dev x6e0 p1 openshiftapps com-2021 03 01-14_20_08

Installation method

  • chectl
    • provide a full command that was used to deploy Eclipse Che (including the output)
    • provide an output of chectl version command
  • OperatorHub
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify

Eclipse Che Logs

Additional context

@svor svor added kind/task Internal things, technical debt, and to-do tasks to be performed. team/plugins area/plugins labels Mar 1, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Mar 1, 2021
@benoitf
Copy link
Contributor

benoitf commented Mar 1, 2021

if it's from inside a .theia plug-in I think it's plugins.getPlugin(id) no ?

@svor
Copy link
Contributor Author

svor commented Mar 1, 2021

@benoitf It's inside .theia plug-in that collects and runs tests from VSCode extension which contain vscode.extensions.getExtension(id), like https://github.com/timonwong/vscode-shellcheck/blob/master/test/suite/extension.test.ts#L22.

Maybe it should be another VSCode extension to collect and run tests not Theia plugin.

@Katka92 Katka92 added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Mar 1, 2021
@svor
Copy link
Contributor Author

svor commented Mar 2, 2021

I tried to run tests from VSCode extension and from Theia plugin and in both cases it is not possible to read extensions

Extension-Host:FAILURE: Shellcheck extension Extension should be activated on shell script files -- error: Cannot read property 'getExtension' of undefined
Extension-Host:FINISH: 0/1
Extension-Host:Error: 1 tests failed.
    at /tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/out/extension.js:48:23
    at done (/tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/mocha.js:843:7)
    at Runner.<anonymous> (/tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/runner.js:918:5)
    at Runner.emit (events.js:326:22)
    at /tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/runner.js:903:12
    at /tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/runner.js:772:9
    at next (/tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/runner.js:362:14)
    at Immediate._onImmediate (/tmp/vscode-unpacked/Red Hat.Smoke-Test-Plugin.0.0.1.obeqavuoxx.test-runner-0.0.1.vsix/extension/node_modules/mocha/lib/runner.js:425:5)
    at processImmediate (internal/timers.js:461:21)

I'm keep investigating

@ericwill ericwill mentioned this issue Jun 16, 2021
30 tasks
@ericwill ericwill removed this from the 7.32 milestone Jun 16, 2021
@svor svor mentioned this issue Sep 23, 2021
25 tasks
@svor
Copy link
Contributor Author

svor commented Oct 13, 2021

Related PR: eclipse-theia/theia#10199

@svor svor closed this as completed Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P2 Has a minor but important impact to the usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

5 participants