VSCode or Delve issue - Unable to test at all - testing

I have two projects on GitHub (https://github.com/NlaakStudios) (gowaf and ezgo). Debugging and Testing with VSCode and Delve work perfectly with the gowaf repo using the default launch.json. It does not work with ezgo which is just the config from gowaf moved into a different repo.
With gowaf I get the "Run Packed test" and "Run file Test" options above the package and test functions. With ezgo I do not. gowaf was created and was being debugged and tested pre-last VSCode update and ezgo after update.
Both are frameworks with no main package, so I need test enabled for non-main binaries (as I have been doing). Below is the output from the config package in gowaf (working) and ezgo (not working)
gowaf/config/
Running tool: D:\Go\bin\go.exe test
-coverprofile=C:\Users\Nlaak\AppData\Local\Temp\go-code-cover -timeout 30s
PASS coverage: 91.8% of statements ok
/d/GO_Projects/src/github.com/NlaakStudios/gowaf/config 0.059s
Success: Tests passed.
ezgo/config/
API server listening at: 127.0.0.1:27828 not an executable file could
not remove
d:\GO_Projects\src\github.com\NlaakStudios\ezgo\config\debug.test:
remove
d:\GO_Projects\src\github.com\NlaakStudios\ezgo\config\debug.test: The
system cannot find the file specified. Process exiting with code: 1
My current focus is on code coverage and this is just killing me. Complete stop and I cannot figure it out for the life of me. Any help would be appreciated. I have TeamViewer if you want to actually get your hands dirty with it as i monitor.
Thanks in advance...
Environment Information & Versions
------------------------------------------------------------
Windows 10 Home (all updates)
------------------------------------------------------------
Delve Debugger
Version: 1.0.0
Build: $Id: c98a142125d0b17bb11ec0513bde346229b5f533 $
------------------------------------------------------------
go version go1.10.3 windows/amd64
------------------------------------------------------------
VSCode Version Info
Version: 1.25.0
Commit: 0f080e5267e829de46638128001aeb7ca2d6d50e
Date: 2018-07-05T13:11:58.697Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64

Related

The server exited prematurely with exit code 1 GlassFish 4

I've been trying to start the glassfish server domain with the following command asadmin start-domain domain1 but the result wasn't the expected. This what the outputs is throwing out:
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Command start-domain failed.
Btw I've already tried changing the network-listener-port number located inside glassfish folders C:\glassfish4\glassfish\domains\domain1\config\domain.xml from port 8080 to 4949 and it didn't work. Besides I also tried running the start-domain domain1 command in the asadmin batch file and nothing happened, the output still the same.
Any idea how can I fix this out?
I tried to start it with asadmin.sh and it worked on Windows 10

How to get WSL2 working with IntelliJ IDEA 2021.1

I have no idea how to get IntelliJ IDEA 2021.1 working with WSL. I spent two days searching trough internet but I wasn't able to get it running. I am able to create new project with JDK located in WSL but when I press "play button" I receive this:
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Cannot assign requested address: bind
Synchronizing output directories...
4/16/2021 7:57 PM - Build completed with 1 error and 0 warnings in 77 ms
What I tried was also to use maven from WSL but that also didn't help. Does anyone has idea what I am doing wrong?
Jetbrains added an option to work around the issue (has to do with your WLS2 /etc/resolv.conf being modified due to VPNs, etc.):
https://youtrack.jetbrains.com/issue/IDEA-265522#focus=Comments-27-4808360.0-0
From the issue link:
Thanks, the issue with generateResolvConf=false in /etc/wsl.conf is reproduced. The fix will be available in 2021.1.x builds, exact fix version will be available later (see "Available in" field).
After updating to a version with the fix, please do the following to change how Windows host IP is obtained:
Open "Help | Find Action...", locate "Registry..." there and open it.
In the opened "Registry" dialog, find wsl.obtain.windows.host.ip.alternatively registry key (disabled by default) and enable it.
Restart IDE to apply the changes.

Protractor on offline machine

Angular 4 cli project
We have private network with private npm repository.
(There is no connection to the internet).
so after all modules are downloaded I want to run e2e tests.
Protractor use webdriver-manager to download the latest chrome driver.
but he can't download the driver so I get this error :
etaddrinfo ENOTFOUND chromedriver.storage.googleapis.com chromedriver.storage.googleapis.com:443
I tried to download the driver manually, and inside the protactor-config :
{
chromeDriver: "../../chromedriver.exe", // I also tried with "./chromedriver_2.30.exe"
....
}
(I don't know if the chromedriver is relative path to the protractor.config or to the webdriver-manager module inside protractor)
But I keep getting this error, how can I treat this error without an internet connection at all?
btw, something to consider, we develop on windows, but how can our ci/cd server (linux) will get a driver suitable for linux??
I had a similar issue. After trying different approaches like manually copying the driver or changing the protractor module, I found that the best workaround is to install a local Web server and provide the required driver for download through that local server. This solution worked and is also useful to provide other files (e.g. files that are directly downloaded during "npm install"). Steps are listed below.
Install Apache on the offline system or any other system accessible to that offline system.
On an online system, download the driver from (https://chromedriver.storage.googleapis.com/ - the site that the update command tries to access). Accessing this site in the browser displays a file (download.xml) that lists different versions of the web driver for different platforms. You can download the required version by appending the "Key" shown in that file to the end of the URL e.g. (https://chromedriver.storage.googleapis.com/2.33/chromedriver_win32.zip) to download version 2.33 of the chrome driver for windows. I tried newer versions but found that 2.33 worked on Win 10 (64 bit)/Chrome 61.
Manually copy the downloaded zip file to the offline system in the Apache htdocs folder using the same path as in the key e.g. (c:\\htdocs\2.33\chromedriver_win32.zip)
Make a download.xml file similar to the one on the actual site (https://chromedriver.storage.googleapis.com) but only list one entry for the driver version that you need.
Modify your Apache config file (conf\httpd.conf) to make download.xml as DirectoryIndex file
Run Apache (bin\httpd.exe)
Change your windows hosts file to add an entry to map (chromedriver.storage.googleapis.com) to the IP of the system where Apache is running.
Run "ng e2e". "webdriver-manager update" will download this local driver and tests will continue.
I had a similar issue. Found this answer with googling and I tried it. Seems to work.
With recent changes in protractor you can use:
ng e2e --webdriver-update=false
I had the same problems and my solution it's not the best, but it works.
Locally:
run webdriver-manager update in my example I had to run it with -ignore_ssl
go to the \node_modules\protractor\node_modules\webdriver-manager\selenium\and copy all files (except update-config.json) to some root folder
commit and push changes (I know, we are pushing web drivers to the repo which is not the best solution)
On Offline Machine - TFS in my case
run npm install
copy webdrivers back to the folder node_modules\protractor\node_modules\webdriver-manager\selenium\
I use Angular CLI so run ng e2e --no-webdriver-update
The best way is to put it in your angular.json:
"e2e": {
"builder": "#angular-devkit/build-angular:protractor",
"options": {
"webdriverUpdate": false,
"protractorConfig": "e2e/protractor.conf.ts",
"devServerTarget": "myproject:serve"
},

Running JHipster Gradle task from Intellij IDEA

This error happens when I run with Gradle through from Intellij IDEA.. but from console everything works fine... someone knows why?
Executing external task 'run --stacktrace'... :compileJava UP-TO-DATE
:compileScala UP-TO-DATE :bower FAILED
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':bower'.
Caused by: java.io.IOException: Cannot run program "bower" (in
directory "/Users/eduardo/Development/projects/jhipster"): error=2, No
such file or directory
I contacted JetBrains support about this. The one thing they suggested was running IntelliJ from the command line, which is working for me:
open -a "/Applications/IntelliJ IDEA 15.app"
At a guess, you are running IntelliJ on OSX, maybe with a brew install of bower?
Recent versions of OSX (at least 10.10.1) don't let you easily set the PATH for graphical applications (launchctl seems to have a bug in regards to PATH). Combined with there being no way to modify the current environment PATH for launching subprocesses in Java, this results in being unable to find the bower executable. A Complete rundown of the root problem can be seen here (Setting the environment for ProcessBuilder), but essentially IntelliJ must have your PATH set correctly in order for non standard PATHs to be searched.
My solution for now is a complete hack taken from https://apple.stackexchange.com/a/51737 - essentially, create a wrapper script:
create /Application/IntelliJ\ IDEA\ 14.app/Contents/MacOS/idea.sh with contents of:
#!/bin/sh
. ~/.bash_profile
logger "`dirname \"$0\"`/idea"
exec "`dirname \"$0\"`/idea" $#
then chmod +x /Application/IntelliJ\ IDEA\ 14.app/Contents/MacOS/idea.sh
then edit /Application/IntelliJ\ IDEA\ 14.app/Contents/Info.plist and set CFBundleExecutable to idea.sh
lastly, run /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/IntelliJ\ IDEA\ 14.app
It's a hack, but it works... and until Apple fixes launchctl, it's the only solution I've come up with.

Selenium Testing in Hudson question

I'm having some trouble running a simple selenium test through Hudson.
I've installed the SeleniumHQ plugin for Hudson and configured a job to run a simple test suite which consists of two tests which run fine from the Selenium IDE and from the TestNG plugin in Eclipse.
However, when I try to run them through Hudson, the testing just seems to stall at the end of the first test (regardless of which test it is, I've tried many different ones which are all valid when ran in other enviornments).
The Console Output from Hudson reads as follows:
11:48:09.543 INFO - Java: Sun Microsystems Inc. 14.2-b01
11:48:09.544 INFO - OS: Windows Vista 6.0 x86
11:48:09.559 INFO - v1.0.1 [2696], with Core v#VERSION# [#REVISION#]
11:48:09.655 INFO - Version Jetty/5.1.x
11:48:09.656 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:48:09.657 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:48:09.657 INFO - Started HttpContext[/,/]
11:48:09.670 INFO - Started SocketListener on 0.0.0.0:4444
11:48:09.670 INFO - Started org.mortbay.jetty.Server#c40c80
11:48:09.825 INFO - Preparing Firefox profile...
11:48:12.046 INFO - Launching Firefox...
11:48:12.919 INFO - Checking Resource aliases
The strange thing is, I can see the first test being ran, and it passes but selenium then doesnt skip onto the next one, and if I create a test suite with just the one test, it simply hangs there indefinitely. Please note that I have an AssertVisible action in the test to check the validity of the results. Do I need to return anything else for Hudson to run the test properly?
Thanks in advance for any help on this...
Could you check if the command line stated by the SeleniumHQ plugin is correct?
In a command window, paste the command and run it
Check if the test start, execute and end normally
Check the result file
I've had this problem. You can get around it by installing compatible versions of selenium and firefox. See if they work together outside Hudson.
The issue comes because you have given TestCase file, instead use TestSuite html file for testing.
After registering the script in seleniumhq , choose save TestSuite as menu to save as TestSuite.