I am using appleboy/SSH drone plug-in to execute my test in a remote machine and generate a test report the issue When the test in remote machine fails it shows test failed, but in the drone server it shows integration passed. Is it possible to fail the drone integration based on the results of test cases?
For drone to fail a step it needs to return 1. I assume the SSH plugin does not do that.
You could parse stdout for a string that indicates failure and return 1 yourself. This could be an additional step in the CI pipeline or a single command you call after the SSH session.
Related
When I want to run a script in Inline Script mode on SSH Deployment Task on Azure Devops Version Dev17.M153.5, that one goes on hang as below. There is no problem that we have checked the authorizations of the user running the command. Operating system version on target Solaris 11.4.Is there a method to solve this problem?
##[debug]inline=cd /home/userstfs/workspaces/*****/src;pwd
##[debug]No script header detected. Adding: #!/bin/bash
##[debug]Agent.TempDirectory=D:****_temp
##[debug]failOnStdErr=true
Trying to establish an SSH connection to #...***:22
Successfully connected.
##[debug]remoteScriptPath = "./sshscript_1596017258623._unix"
##[debug]Copying script to remote machine
You have to update the agent in the deployment pools from:
Organization setting - Deployment pools - Update targets
TLDR
I want to run only one instance of a build at a time that shares a resource that can only handle one execution at a time while still being able to run multiple agents at a time on other builds. Another option is to run an Azure SQL database instance within the build, if that is even possible.
1.) How can I restrict builds that share a resource to 1 agent at a time? I was looking for a named azure agent that can be limited or add some sort of namespace that can only be used one at a time.
2.) What would be a better approach to testing a SQL install script as part of a build pipeline.
Details
I have several build pipelines and release pipelines setup in Azure. One of my pipelines is testing a large SQL script for initializing new instances of a database. This is performed using the Azure SQL Execute Query task. Any errors encountered when running the SQL is supposed to kick back to Github as a failed build. However, when I increased the number of agents from 1 to 2 I encounter an issue every now and then where a build is triggered before the previous one finishes. This breaks the first build.
Here are the agents I am using
To limit one agent to builds, if i understand you correctly. You can try below steps.
First go to your build pipeline, Edit your pipeline. Specify the demands for your pipeline. Then the pipeline will only run on the agent that satisfy the demands.
For example, if i specify the demands like below pic. Then the pipeline will only run on the agent named agentname.
And you can find detailed capabilities of your agent and define custom capabilities. go agent pools under Pipelines in your Project Settings page.
Select your agent pool, select your agent and Add a new capablity to add custom capabilities. You can then use the custom defined capabilities as demands.
Update:
In yaml style pipeline, You can specify which agent to run your pipeline by define vmImage, Check here for details
pool:
name: string # name of the pool to run this job in
demands: string | [ string ] ## see below
vmImage: string # name of the vm image you want to use
You can aslo try using Azure Pipelines agent pool, where you can point a specific agent to run your pipeline.
Hope you can find this helpful.
I user SSH to execute robot framework testcases (selenium), but there is no browser opened, the testcases is executed in the background? How can I solve this issue?
I want to execute robot framework testcases on win10, and I want to start the test via Jenkins which is installed on Linux, so I installed a SSH plugin in the Jenkins, then I create a job in Jenkins and execute below command via SSH
pybot.bat --argumentfile E:\project\robot_framework\Automation\logs\argfile1.txt E:\project\robot_framework\Automation
when I start the job, the testcase is executed in the background, but I need the test case to open the browser in the front.
ssh by definition executes commands in a different session than the current user's.
Especially considering your target is a Windows machine - imagine if you were logged in and working with desktop apps, and someone starts an app through ssh in your session - would be a little surprising (mildly put :), wouldn't it?
To get what you want - being able to monitor the execution, you could try runas /user:username command, but a satisfactory end result is not guaranteed (plus you have to provide the target user's password).
Another option is to use psexec, available on TechNet, but YMMV - you have to provide the target session id, some programs might not show up - or might not be maximizable, etc. The call format would be
psexec.exe -i 2 pybot.bat the_rest_of_the_args
I.e. a lot of effort and uncertainties, with minimal ROI :)
I have a windows instance set up on AWS. I have Jmeter and Ant installed on that machine to run API test cases.So I can successfully run tests on remote server. I need to set up a job on corporate Jenkins to run those test cases on aws server. I have server's IP address and username and password to log in to aws server.
How do I set up a job on corporate Jenkins which will run my test cases on remoter aws server? (Execute windows command)
Thank you.
did you connect this AWS machine as a slave to the master ? or you can't do it ?
I think that the best is connect this machine as a slave and create a dedicated job to run on the windows machine
Setting up a new Ant task to run JMeter test in Jenkins is fairly easy, here is a simple Pipeline script which executes Ant task using build.xml file in the "extras" folder of JMeter installation and publishes resulting HTML report on the build artifacts page:
node {
ws('c:\\jmeter\\extras') {
stage 'Run JMeter Test with Apache Ant'
def antHome = tool 'ant'
bat "pushd c:\\jmeter\\extras && ${antHome}\\bin\\ant -f build.xml"
step([$class: 'ArtifactArchiver', artifacts: 'Test.html', fingerprint: true])
}
}
You will need to define ant tool so Jenkins would know what is "ant" and where it lives. See Running a JMeter Test via Jenkins Pipeline - A Tutorial article for details.
Alternative options are:
If you have Jenkins admin access or your user has "Job - Configure" role you have "Configure" button where you can see (and change) all the build steps
You can copy the whole Jenkins installation over to your corporate intranet (don't forget JENKINS_HOME folder)
Thank you both for your response. I have set it my windows AWS machine as Slave. And I was able to run the job on AWS server from corporate jenkins.
Are there any way, to prevent the internet access of the tester application under the test whit Test Complete? I'd like to test the application's reaction of the lost of the internet connection, but I have to perform this whith a CI tool, which means the Test Complete have to block and unblock to connection.
You can do this using WMI directly from a script (see Working With WMI Objects in Scripts) or by executing a PowerShell script (see Running PowerShell Scripts From TestComplete).
For example, see this question to get a sample PS script:
Command/Powershell script to reset a network adapter