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

TestNG suport for Theia #19828

Closed
akhilajayakumar opened this issue May 20, 2021 · 6 comments
Closed

TestNG suport for Theia #19828

akhilajayakumar opened this issue May 20, 2021 · 6 comments
Assignees
Labels
area/plugins kind/question Questions that haven't been identified as being feature requests or bugs. sprint/current
Milestone

Comments

@akhilajayakumar
Copy link

We have been working with Eclipse che theia 7.31 version and have done "deploy plugin by id" to add the Java test runner plugin to enable TestNg support for the projects. We could see the Run| Debug option for java but not for @test annotations from Junit/TestNG libraries. Could you please guide us where we are going wrong?

image
image

We also tried adding vscode extension in theia following the instructions from the below document,

https://www.eclipse.org/che/docs/che-7/end-user-guide/adding-a-vs-code-extension-to-a-workspace/

We have used below meta.yamal as reference to add vscode plugin, but no luck
https://github.com/eclipse-che/che-plugin-registry/blob/7.24.x/v3/plugins/cdr/code-server/3.6.2/meta.yaml

Setup details:
Che version: latest (7.31.0)
Deployed on Azure Kubernetes (AKS) Using helm chart
Kubernetes version: 1.18.17, 16Gb 4CPU
Storage for a workspace -10GB

@akhilajayakumar akhilajayakumar added the kind/question Questions that haven't been identified as being feature requests or bugs. label May 20, 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 May 20, 2021
@ericwill
Copy link
Contributor

https://github.com/eclipse-che/che-plugin-registry/blob/7.24.x/v3/plugins/cdr/code-server/3.6.2/meta.yaml is an editor meta.yaml to use VS Code as an editor in Che.

To use the Java plugin (with test runner support), you can use the existing redhat/java11 plugin from the plugin registry -- it should have everything you need. Do you have a devfile you can share?

@akhilajayakumar
Copy link
Author

Hi Eric,

Please find the devfile.

apiVersion: 1.0.0
metadata:
name: java-maven-sd9rm
projects:

  • name: TAF-Scripting
    source:
    location: 'https://github.com/USTQE/NoSkriptTrial.git'
    type: git
    branch: dev
    components:
  • id: redhat/java11/latest
    preferences:
    java.server.launchMode: Standard
    type: chePlugin
  • mountSources: true
    endpoints:
    • attributes:
      public: 'false'
      name: debug
      port: 5005
      memoryLimit: 512Mi
      type: dockerimage
      volumes:
    • name: m2
      containerPath: /home/user/.m2
      image: 'quay.io/eclipse/che-java11-maven:nightly'
      alias: maven
      env:
    • value: ''
      name: MAVEN_CONFIG
    • value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/user'
      name: MAVEN_OPTS
    • value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom'
      name: JAVA_OPTS
    • value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom'
      name: JAVA_TOOL_OPTIONS
      commands:
  • name: maven build
    actions:
    • workdir: '${CHE_PROJECTS_ROOT}/TAF-Scripting'
      type: exec
      command: mvn clean install
      component: maven
  • name: maven build and run
    actions:
    • workdir: '${CHE_PROJECTS_ROOT}/TAF-Scripting'
      type: exec
      command: mvn clean install && java -jar ./target/*.jar
      component: maven

We have used java11, still its not showing the Run debugg option. Thanks for the support

@rhopp rhopp added area/plugins and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels May 21, 2021
@spvece
Copy link

spvece commented May 28, 2021

Hi Eric,

On Behalf of Akhil, any update on the above issue?

@ericwill
Copy link
Contributor

Hi Eric,

On Behalf of Akhil, any update on the above issue?

Not yet, this is something we'll look at next sprint (June 15th and onward).

@sunix
Copy link
Contributor

sunix commented Jun 16, 2021

Hi @akhilajayakumar @spvece , do you have a public git project where this issue could be reproduced? I cannot access to https://github.com/USTQE/NoSkriptTrial.git

@ericwill ericwill mentioned this issue Jun 30, 2021
22 tasks
@svor svor modified the milestones: 7.33, 7.34 Jul 9, 2021
@svor svor mentioned this issue Jul 22, 2021
34 tasks
@svor svor removed the sprint/next label Jul 27, 2021
@svor svor modified the milestones: 7.34, 7.35 Aug 11, 2021
@svor svor mentioned this issue Aug 12, 2021
30 tasks
@nickboldt nickboldt removed this from the 7.35 milestone Aug 24, 2021
@nickboldt nickboldt added this to the 7.36 milestone Aug 24, 2021
@vitaliy-guliy vitaliy-guliy assigned vitaliy-guliy and unassigned sunix Sep 1, 2021
@vitaliy-guliy
Copy link
Contributor

vitaliy-guliy commented Sep 3, 2021

I have tried to write a small test with TestNG and can say, that it works. But there is an issue, that needs to be fixed (see below).

Try create a workspace with this devfile

apiVersion: 1.0.0
metadata:
  name: testng-example
projects:
  - name: testng-example
    source:
      location: 'https://github.com/vitaliy-guliy/testng-example.git'
      type: git
components:

  - id: redhat/java/latest
    preferences:
      java.server.launchMode: Standard
    type: chePlugin

  - mountSources: true
    endpoints:
      - attributes:
          public: 'false'
        name: debug
        port: 5005
    memoryLimit: 512Mi
    type: dockerimage
    volumes:
      - name: m2
        containerPath: /home/user/.m2
    alias: maven
    image: 'quay.io/eclipse/che-java11-maven:next'
    env:
      - value: ''
        name: MAVEN_CONFIG
      - value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/user'
        name: MAVEN_OPTS
      - value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom'
        name: JAVA_OPTS
      - value: '-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom'
        name: JAVA_TOOL_OPTIONS

commands:
  - name: maven build
    actions:
      - workdir: '${CHE_PROJECTS_ROOT}/testng-example'
        type: exec
        command: mvn clean install
        component: maven

After workspace startup go to My Workspace view and run maven build. Then open a test java file and wait for java language server being initialized. Run Test and Debug Test controls should appear under @Test annotation.
Click Run Test to open a Debug Console and launch the test.

Screenshot from 2021-09-03 14-38-30

It should be as on the screenshot, but..
There is a bug, which needs to be fixed #20410

Clicking on Run Test opens an empty Debug Console and nothing happens.
The browser console says, that there is something wrong running LinkProviderAdapter.provideLinks(...)
To have the test running it needs to refresh the browser and to run the test again.

See the issue for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/question Questions that haven't been identified as being feature requests or bugs. sprint/current
Projects
None yet
Development

No branches or pull requests

9 participants