Terminate whole build process tree on Cancel - google-app-engine

Example, with these GAE build settings:
{
"cmd": ["c:/python27/python", "C:/Program Files/Google/google_appengine/dev_appserver.py", "./"],
"working_dir": "$file_path",
"selector": "source.python",
"name": "Google App Engine: App Server"
},
When I launch this build system, here are processes connected to ST:
When I terminate build (Tools > Cancel Build), ST terminates just top process, leaving ghost child process running:
I need to terminate those processes by hand, or they'll still run in background, and if left unnoticed any other launch of GAE build will result in error at some point.
I run build schemes with shell ("shell": true), but also without shell result is same - child processes are left running in background. So, does anyone knows how to configure ST build system that will clean it's state on Cancel?

I ran into this as well, so I decided that instead of using a build system, I would just open up a command prompt and let the GAE dev server run on it's own, outside of ST2. st2-gae-python.
The plugin is a work in progress, I just got it to where I could run the GAE dev server quickly, but it works for what it was intended for so far.
Right-click on your app's main folder.
Select `GAE.py - Create dev settings.` to generate `.gaedevserver-settings` file.
Edit `.gaedevserver-settings` file to your needs.
Right-click on your app's main folder.
Select `GAE.py - Start dev server.`
The GAE.py - Start dev server. selection opens a command prompt that runs up dev_appserver.py

Related

Multiple terminal window in Jenkins?

Recenlty I have started with some Jenkins tutorials to learn about this tool.
As an excersise I would like to start my Angular project and run some protractor e2e tests on it.
Normally I would open terminal window, type : npm install, npm start and run protractor tests. I have one issue though to execute this on Jenkins.
Command 'npm start' will run my angular application on localhost:4200. That require some time and after that this terminal window is "frozen" there is information that my application is running on localhost but if I want to run tests I need to open another terminal window and type command there.
I don't know how to do this in Jenkins because when I run my project and observe logs, I can see that my project is running and everything is OK, but I cannot type any command to run test because this terminal window is busy with info:
webpack: compiled successfully.
Can I somehow open another terminal window during Jenkins build and run command there?
Use & at the end of the command that will run it in background and didn't freeze the terminal.
But As per me I don't think if you are running cmd through Jenkins will froze the terminal.
Each build step is a separate process that Jenkins spawns off. They don't share anything, neither current directory, nor environment variables set/changed within the build step in-spite you hard coded the location. Each new build step starts by spawning a new process off the parent process (the one running Jenkins)
Please share some screenshot if & didn't work for you.

Error in Selenium tests triggered from batch script in TFS Build step

Step 1. I have written selenium tests and bundled it into executable jar.
Step 2. When I execute this jar tests runs normally. Invokes New browser and execute all steps.
Step 3. I created bat file to execute this jar. In this case also test execution happens normally.
Step 4. TFS Build integration. (TFS 2015)
- I created new build definition in TFS
- Added build step "Batch Script"
- Entered path of bat file created in step 3 in build step
- When I Queue this build. bat file gets called and test execution starts. But It does not open new browser..console says Started IE driver...it starts driver internal to build agent. and execution fails on setting value in textbox.
Click to see TFS Build Cosole
I can't use Visual studio tests. Requirement is to selenium tests should be triggered from jar created on Step 1.
Make sure the build agent is running in interactive mode.
First you could try to RDP to the remote build server(the build agent located) and manually run the batch file to see if it works.
If it's also not work then the issue may related the IE browser on the server.
If it works then maybe the TFS build service account don't have enough permission to run the IE driver. Please make sure the build service account has local Admin permission on the build server.

TeamCity - start tomcat

I'm trying to start tomcat with a teamcity deployment build step. The steps below all work with no issues when ran directly, but do not work in a teamcity step. The java window appears and closes, as though the build step kills all child processes when completed. I have tried all of the following:
batch (command line running a batch in sources, or right in teamcity script, and command line, and process build types):
call "%env.CATALINA_HOME%\bin\startup.bat"
start "%env.CATALINA_HOME%\bin\startup.bat"
cmd /k "%env.CATALINA_HOME%\bin\startup.bat"
start "DEV server" "%env.CATALINA_HOME%\bin\startup.bat"
powershell:
# wasnt sure if env var was being carried over, not relevant
$env:CATALINA_HOME = %env.CATALINA_HOME%
Start-Process "%env.CATALINA_HOME%\bin\startup.bat"
is there some way to tell TeamCity 10 build step 'hey, leave whatever was started running'?
CATALINA_HOME is an environment variable in the teamcity parameters (env.CATALINA_HOME) and is set to "C:\apache-tomcat" which is correct.
Some additional information: the TC server and agent is running as a user account, the user account has access to all folders (and is local admin) as well.
in tomcat bin\setenv.bat I had CATALINA_OPTS -XmX and -Xms parameters which were very large and required 64 bit java.
When doing this specific build parameter (which I recommend for debugging, it will block the TC build)
%env.CATALINA_HOME%\bin\catalina.bat
(argument: run)
I then got an exit code 1 build failure with a useful error message (but no tomcat logs):
[08:25:24]Error: Could not create the Java Virtual Machine.
[08:25:24]Error: A fatal exception has occurred. Program will exit.
[08:25:24]Invalid maximum heap size: -Xmx32768m
[08:25:24]The specified size exceeds the maximum representable size.
[08:25:24]Process exited with code 1
If you need large Xmx and Xms of a child process, the BUILD AGENT executing the build needs to be running from 64 bit as well! In my case, I had, eg
C:\Teamcity_BuildAgent_Deploy\jre
I copy pasted my 64 bit jre installation in there as well per TC docs and then it could start processes with large Xmx and Xms. I did not adjust TEAMCITY_AGENT_MEM_OPTS or any batches.

Why Installer made with installshield hangs when deployed using ReleaseManagementBuild.exe?

I have a build definition in TFS that compile my code, then using a post build event, I create a Setup.exe file using Installshield.
Using Release Management I am able to deploy the installer to a machine and start the installation process using the tool RunCommandLine, I add the required parameters to the setup.exe so it will install the application silently (using an answer file to avoid user interaction). This process works smoothly!!!
I want to go far, so I tried to launch a release from a gated check-in....change the build template, install the release management client in the build agent, configure my build definition......I performed a small change in my code, then a check-in.....it compiles in the server, and start the release process: deploy the installer and start the installation process using the tool RunCommandLine, I add the required parameters to the setup.exe so it will install the application silently.....but I got a timeout so the release was rejected. I check the machine and found that the setup.exe was still running 0% CPU usage.....very strange.
Checking the build log I found that the command line used by msbuild to launch the release process is something like this:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Release Management\Client\bin\ReleaseManagementBuild.exe -tfs "http://tfs:8080/tfs/Mycollection" -tp "Project1" -bd "Mybuild" -bn "Mybuild_20150623_15.1.0.9" -ts "QA" -nologo
I ran it, and the behavior was the same: the installer got stuck...0% CPU Usage.....Release rejected by timeout.....
So...I open Release Management Client look for the recently created release, and click in the option "Retry failed deployment"....It works!!!! the installer install!!! it does not hangs!!!
I was able to reproduce this behavior several times:
Release launched from Release Management Console......Works
Release launched from ReleaseManagementBuild.exe .......Does not works (Setup.exe hangs)
Any suggestion??

X11: Start desktop manager inside daemon

What I'm trying to do:
Make screenshots of desktop and running program (Firefox Webdriver with Selenium, if it's important) in daemon (celeryd) in auto mode.
And I need desktop manager to be running, this is mandatory requirement. Currently I'm trying to use Fluxbox but I can switch to any other manager.
Current progress:
I can start X-server (Xvfb) in daemon and start Selenium Webdriver. Fluxbox start succeeds when I try to make it from terminal, but fails in daemon with following errors in log:
Can't create directory
Failed to load database:
Failed to load database:/init
Retrying with: /etc/X11/fluxbox/init
I tried to specify init-file directly, but Can't create directory error still exists and Fluxbox fails to start.
This might be daemon-mode restriction.
Question:
Is it possible to run any desktop manager inside daemon?
If yes, then how can I do this?

Resources