Unable to start the VSCode debugger with the Gauge Framework - vscode-debugger

Software Versions:
Python: 3.9.7
Gauge: 1.4.1
Visual Studio Code: 1.60.0
Gauge plugin for VSCode (getgauge.gauge): v0.0.21
Pylance (ms-python.vscode-pylance): v2021.9.0
I have a Gauge framework based on Python setup. I have a spec file, with scenarios installed. I also have a break point set at point in the glue code. When I click on the Debug Spec hyperlink, I get an error message that says the following:
Failed to start debugger: The debugger does not work for a stand alone file. Please open the folder c:\Projects\IAS_Desktop_Automation\ias_desktop_automation.
Error GIF
Please advise how I could get the debugger to work.
Update: I've got log file results too as well from gauge.log
09-09-2021 11:06:34.700 [Gauge] [DEBUG] Created gauge_screenshots_dir at c:\Projects\GaugeFramework\ias_net_automation\reports\html-report\screenshots
09-09-2021 11:06:34.701 [Gauge] [INFO] Compatible version of plugin python not found. Installing plugin python...
09-09-2021 11:06:34.701 [Gauge] [DEBUG] Gathering metadata for python
09-09-2021 11:06:34.703 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.105 [Gauge] [DEBUG] Plugin python 0.3.17 is already installed.
09-09-2021 11:06:35.106 [Gauge] [DEBUG] Plugin html-report is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Plugin screenshot is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Parsing started.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Started concepts parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 38 concepts parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Started specifications parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 1 specifications parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Parsing completed.
09-09-2021 11:06:35.504 [Gauge] [DEBUG] Checking updates...
09-09-2021 11:06:35.505 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.675 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.696 [python] [INFO] Python: 3.9.7
09-09-2021 11:06:35.696 [python] [DEBUG] Loading step implementations from c:\Projects\GaugeFramework\ias_net_automation\step_impl dirs.
09-09-2021 11:06:35.771 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.978 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/xml-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:41.804 [python] [INFO] Runner Ready for Debugging
Here's one from lsp.log with maybe some more revealing information:
09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: --> request #7: textDocument/codeLens: {"textDocument":{"uri":"file:///c%!!(MISSING)A(MISSING)/Projects/GaugeFramework/ias_net_automation/specs/testData.spec"}}
09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: <-- result #7: textDocument/codeLens: [{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":12}},"command":{"title":"Run Scenario","command":"gauge.execute","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec:3"]}},{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":14}},"command":{"title":"Debug Scenario","command":"gauge.debug","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec:3"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run Spec","command":"gauge.execute","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":10}},"command":{"title":"Debug Spec","command":"gauge.debug","arguments":["c:\\Projects\\GaugeFramework\\ias_net_automation\\specs\\testData.spec"]}}]

This issue was introduced by the latest gauge extension update (version 0.0.21)
Change your Auto Update Extensions to None
Down rev your gauge extension in vscode to 0.0.20
You can get version 20 from here under the Version History tab:
https://marketplace.visualstudio.com/items?itemName=getgauge.gauge#install-from-source
Place the download in your workspace than run the following command in the terminal:
code --install-extension getgauge.gauge-0.0.20.vsix

I reverted the Gauge plugin for VSCode to v0.0.20 and the debugger worked as expected.
enter image description here
There is an issue raised in github to look at the issue in the latest version: https://github.com/getgauge/gauge-vscode/issues/726

Related

Can't publish results to Sonarqube server

I've set up a jenkins-sonarqube-github integration workflow where a pull request in the git repository triggers a webhook which starts a jenkins job that starts SonarQube Scanner. The issue is that I can't get it to publish to the SonarQube front-end, instead of Github.
Github results only show up to 10 top issues, and my team needs to be able to see the whole analysis result. As far as I know, that is only possible through the front-end.
The problem : I've set up two separate analysis jobs. One triggers the github commenting behavior(Sonarqube Github plugin), but I can't get the other to simply publish to the server. I've deleted all github-related configs in the latter job, but it just ends with "Success" and doesn't report anywhere. Any help would be appreciated.
Fig1. Working SonarQube Scanner properties that publish to github instead of server
sonar.projectKey=${componentName}
sonar.projectVersion=0.1
sonar.sourceEncoding=UTF-8
sonar.analysis.mode=issues
sonar.profile=My_Analysis_Profile
sonar.github.repository=${repository}
sonar.github.endpoint=https://customossendpoint/api/v3
sonar.github.login=someusername
sonar.github.oauth=somehashkey123
sonar.login=id
sonar.password=pass
sonar.github.pullRequest=${pr}
sonar.host.url=http://sonarserver:19000
sonar.issuesReport.console.enable=true
sonar.github.disableInlineComments=false
sonar.sources=.
sonar.exclusions=
sonar.java.binaries=**/target/classes
Fig2. Not working config that I tried to tweak to stop sending result to github and instead publish(send) to sonarqube server(sonar.analysis.mode=publish doesn't exist at least in sonar 6.x)
sonar.projectKey=${componentName}
sonar.projectVersion=0.1
sonar.sourceEncoding=UTF-8
sonar.analysis.mode=issues
sonar.profile=My_Analysis_Profile
sonar.login=id
sonar.password=pass
sonar.host.url=http://sonarserver:19000
sonar.issuesReport.console.enable=false
sonar.sources=.
sonar.exclusions=
sonar.java.binaries=**/target/classes
Fig3. Logs : (sorry I can't just paste the whole log here because of... corporate issues. I'll add the whole thing after censoring it if it's needed.)
...
INFO: Issues mode
WARN: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
INFO: Load global settings
INFO: Load global settings (done) | time=68ms
INFO: Server id: asdfasdf
INFO: User cache: /home1/irteam/.sonar/cache
INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
INFO: Load plugins index
INFO: Load plugins index (done) | time=59ms
INFO: SonarQube server 6.7.1
INFO: Default locale: "ko_KR", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
WARN: Project doesn't exist on the server. All issues will be marked as 'new'.
...
INFO: Unit Test Coverage Sensor is started
INFO: 888/888 source files have been analyzed
INFO: Integration Test Coverage Sensor is started
INFO: Overall Coverage Sensor is started
INFO: Sensor JavaScript Squid Sensor [javascript] (done) | time=72434ms
INFO: Performing issue tracking
INFO: 19822/19822 components tracked
INFO: ANALYSIS SUCCESSFUL
INFO: Task total time: 4:31.750 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4:33.207s
INFO: Final Memory: 72M/1513M
INFO: ------------------------------------------------------------------------
Finished: SUCCESS
As you can see, it says WARN: Project doesn't exist on the server. - it means it should create a new one and then publish it. However, it doesn't publish anything and just ends with "Success". No link or any report file to view, it just somehow analyzed it for itself and died without telling anyone about it. What am I doing wrong here?
I found out the reason : Sonarqube Github plugin installed on the server prevents the server from storing any analysis results, because it doesn't allow sonar.analysis.mode=publish. The plugin needs to be disabled if anyone wants to see the report from the sonar server.
I had a similar issue, and reason for it was that i had set sonar.analysis.mode=preview, and the goal is to run an analysis without publishing results. You can either remove if you using this mode or set to an appropriate one.
Removing this solved my issue.

Unable to install gradle plugin in RAD 8

When trying to install Gradle plugin in RAD 8 (JDK 1.7) using "`Help->Install New Software->http://dist.springsource.com/release/TOOzLS/gradle -> Extensions ->Gradle IDE.
The installation fails with below error. How can I fix it?
An error occurred while collecting items to be installed
session context was:(profile=bootProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.core,3.6.3.201411271013-RELEASE.
Error reading signed content:C:\Users\<name>\AppData\Local\Temp\signatureFile6349333368928430899.jar
An error occurred while processing the signatures for the file: C:\Users\<name>\AppData\Local\Temp\signatureFile6349333368928430899.jar
Problems downloading artifact: org.eclipse.update.feature,org.springsource.ide.eclipse.gradle.feature,3.6.3.201411271013-RELEASE.
Error reading signed content:C:\Users\<name>\AppData\Local\Temp\signatureFile3533168071782523038.jar
An error occurred while processing the signatures for the file: C:\Users\<name>\AppData\Local\Temp\signatureFile3533168071782523038.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.toolingapi,3.6.3.201411271013-RELEASE.
Error reading signed content:C:\Users\<name>\AppData\Local\Temp\signatureFile6100590399698741916.jar
An error occurred while processing the signatures for the file: C:\Users\<name>\AppData\Local\Temp\signatureFile6100590399698741916.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.ui,3.6.3.201411271013-RELEASE.
Error reading signed content:C:\Users\<name>\AppData\Local\Temp\signatureFile5626455591177320598.jar
An error occurred while processing the signatures for the file: C:\Users\<name>\AppData\Local\Temp\signatureFile5626455591177320598.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.ui.taskview,3.6.3.201411271013-RELEASE.
Error reading signed content:C:\Users\<name>\AppData\Local\Temp\signatureFile4681470222750675595.jar
An error occurred while processing the signatures for the file: C:\Users\<name>\AppData\Local\Temp\signatureFile4681470222750675595.jar
This sounds like the same type of problem encountered here:
Problems downloading artifact - error reading signed content
The explanation there (uncheck the 'only show latest' box on the installation option) implies a version mismatch between the version of Eclipse you are using under the covers of Rational Application Developer 8, and the version required by the Gradle IDE plugin provided by Spring Source. You probably need to investigate what version of Eclipse you are using and compare it to the requirements of Gradle IDE.

Jenkins "POM_VERSION" variable does not reset from build to build

Following Jenkins documentation jenkins docs
I can use the POM_VERSION environment variable to take the current version from the pom file.
But for some reason the POM_VERSION environment variable is not being refreshed from build to build. for example:
I changed the version number manually but the build number that exported was the last from the previous build.
From my python script:
print 'Current version is ' + os.environ['POM_VERSION']
which gives the following log Current version is 0.1.5 which is clearly wrong because i changed it. you can further see it in my maven versions goal output:
[INFO]
[INFO] --- versions-maven-plugin:2.1:set (default-cli) # ep-reporter ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: /var/lib/jenkins/jobs/exchange-planner- reporter/workspace
[INFO] Processing com.exelate:ep-reporter
[INFO] Updating project com.company:ep-reporter
[INFO] from version 0.1.8 to 0.1.6
Props: {project.version=0.1.6, project.artifactId=ep-reporter, project.groupId=com.company}
note that it went from 0.1.5 because i have a script that advances it. but maven clearly states that its changing it from 0.1.8 to 0.1.6 which is not what POM_VERSION says
Thanks.
That environment variable is set at the time Jenkins first reads your POM file. You are clearly changing it during the build.
If you are changing it during the build, you know what you are changing to, and you should use the same mechanism to display it later.
I had the same problem and I resolved it by setting "Check-out Strategy" option to "Always checkout a fresh copy" in Source Code Management section.

Maven downloading dependencies into project root instead of home/.m2

Whenever I run mvn in my project dir it always downloads the dependencies into that dir... I want it to download them into the main repo (home/.m2 )
After a quick google search : how-to-get-the-maven-local-repo.
Run mvn -X and check on the first the line the one that start with:
[DEBUG] Using local repository at *YOUR_LOCAL_REPOSITORY*
If it is not the folder you want, you can change the value in your global settings or your user settings.
[DEBUG] Reading global settings from *YOUR_GLOBAL_SETTINGS*
[DEBUG] Reading user settings from *YOUR_USER_SETTINGS*
To change the value you have to add or update the element "localRepository" in one or both of the above settings file.
<localRepository>/path/to/local/repo/</localRepository>
Maven - Guide to Configuring Maven

Sonar-runner fails due to missing cxx-language plugin, although installed

I am very new to Sonar and in the process of setting up my first server/project.
Environment:
OS: Windows Server 2008 R2 / amd64 / 6.1
App Server: Tomcat/7.0.40I, deployed the Sonar WAR file (3.5.1).
DB: MySQL 5.6.11
(relevant) Plugins:
Sonar C++ Community Plugin (0.2)
The plugin is visible under General Settings --> Sonar C++ Community Plugin
sonar-project.properties
# Required metadata
sonar.projectKey=test:pmc
sonar.projectName=PMC
sonar.projectVersion=1.0
sonar.language=c++
# Comma-separated paths to directories with sources (required)
sonar.sources=c:/SVN/Development/test/PMC/trunk/AppServer,c:/SVN/Development/test/PMC/trunk/PmcShared,c:/SVN/Development/test/PMC/trunk/WebServer,c:/SVN/Development/test/PMC/trunk/Tools
# Optional path to the CppCheck program required to activate some CppCheck rules
sonar.cpp.cppcheck.path=C:/Program Files (x86)/Cppcheck/cppcheck.exe
# Encoding of the source files
sonar.sourceEncoding=UTF-8
The thing I do not understand is that it cannot find a plugin that supports the 'cxx' language:
C:\Users\Administrator\Documents\sonar-projects\PMC>sonar-runner
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
15:20:54.231 INFO - Load batch settings
15:20:54.794 INFO - User cache: C:\Users\Administrator\.sonar\cache
15:20:54.797 INFO - Install plugins
15:20:55.742 INFO - ------------- Executing Project Scan
15:20:56.482 INFO - Install JDBC driver
15:20:56.487 INFO - Apply project exclusions
15:20:56.493 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
15:20:56.771 INFO - Initializing Hibernate
15:20:59.229 INFO - ------------- Inspecting PMC
15:20:59.229 INFO - Load module settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 6.162s
Final Memory: 13M/221M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must install a plugin that supports the language 'cxx'
ERROR:
ERROR: To see the full stack trace of the errors, re-run Sonar Runner with the -e switch.
ERROR: Re-run Sonar Runner using the -X switch to enable full debug logging.
I do have the Sonar C++ Community Plugin installed so I guess I am missing the obvious...could someone please help me getting started?
It seems I made a mistake in the configuration file. I re-created it and now the job runs! This issue is closed and the configurations above will work.
I had a similar error with the C# plugin:
ERROR: Caused by: You must install a plugin that supports the language 'cs '
Please remark the 'cs '
After long time I spotted the extra ' ' after 'cs'. When removing the extra space in the configuration file it worked. It seems like sonar-runner don't use "trim".
For new users, if you still getting this error (SonarQube 4+) start the server, go to the 'Settings' ( top right ) then search for 'Update center' there you add missing modules , next restart Server. it should works
Source: Link from official project website
To find the string required to activate any given SonarQube language plugin, go to "Settings" -> "System" -> "Update Center". For each plugin, the short name will be in square brackets to the right of the human-readable name.
C / C++ / Objective-C [cpp]
In this example, "cpp" is the name to use in the sonar.language property in your sonar-project.properties.

Resources