When my CodedUi tests (VS 2012) are run as part of TFS build process, they are run under a BuildUser account. The BuildUser account is used to run builds.
I expected that given the Test Agent is running under a TestUser account, the tests too should be run under the TestUser account.
Is there are a way to run tests as a TestUser, even though the tests are run as part of a TFS build-deploy process?
Thanks.
When you are running your tests as a part of build the tests are run under the context of the build account. While there is no existing configuration such an ask you can achieve this via
Modifying the build process template to run the test activity under testUser cred
Schedule the run on a test controller which has an agent configured under the testUser cred. This can be done by specifying a .testsettings file with your tests in the build process template. The .testsettings UI in VS will allow you to point to a remote test controller.
When you run your tests as a part of the build-deploy-test workflow using labdefaulttemplate then the tests are executed on the environment in the context of the test agent which can be configured as a testUser
Related
We are running selenium E2E tests as part of VSTS Release. We're using Visual Studio Test task which runs vstest.console.exe as a NT AUTHORITY\SYSTEM user. How can we specify a different account?
Sorry, this could not be achieved for now. Please take a look at this thread: Test agent, Test Controller and MSTEST FAQ (Qustion 21), it should be also applied to VS test.
Will Test Agents allow you to impersonate another user? Or does the
Test Agent always kick of tests as the user its configured start up
as?
There is no built in support for impersonation, so by default tests
run under the identity of the test agent. If this is something you
really need, you could write a unit test extension that does the
impersonation for you.
We could not specify the user in the "Visual Studio Test" step, the test will running with the agent.
As a workaround, you can try to change the agent service account to the specific account of the user. Or just deploy a new agent to run with the specific account, a sample for your reference : Running Unit Tests on different machine during TFS 2015 build
I have several test cases in TFS. I would like to run those test cases using MTM(Microsoft test manager) automatically and update the test results. How to connect or configure MTM with TFS so that I can automate all the test cases.
Connecting TFS from MTM is easy, just enter the TFS name or URL and choose your team project:
Details of Automate a test case in Microsoft Test Manager, check: https://msdn.microsoft.com/en-us/library/dd380741(v=vs.120).aspx
If you use TFS 2015.2 and later versions, then it's not needed to use MTM, you can use new build system and Run Functional Tests task to executing automated tests, check: https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/31/executing-automated-tests-in-build-vnext-using-test-plan-test-suites/
I have a .Net WebApi project and continuous integration is setup using Bamboo. I am using spec flow tests and some of the tests are tagged to run on bamboo remote agent as they are slow in nature. Other tests supposed to be run on multiple local agents. I have setup multiple stages in Bamboo build plan as stages get run in parallel with each stage is set to run specifically tagged tests suits.
My question is what is the general practice to setup a Bamboo plan to run on multiple agents (local and remote) and how can I share one MS Build output (dlls and config) across multiple agents.
If you need to split build and test phase then usually you have Build stage with one job which produces artifact with build output.
Then you create another stage and put several jobs there. Jobs may be configured to download produced artifact from Build stage and execute tests against your build.
If you want to run some of your jobs at remote agent, you can add some Job requirement which only remote agent can satisfy.
I was wondering if it is possible for Jenkins to be notified after TFS finishes a build.
I'm trying to make a system where, after the TFS build, Jenkins is used to run automated selenium tests.
Thanks in advance!
You have a few options:
You could use a GenericTest to trigger Jenkins and include as part of the Build Definition. This also allows your script to communicate pass/fail information back to the build.
You could just include an InvokeProcess workflow activity to trigger Jenkins. The process would be similar to this or this.
Or you could use a tool that would trigger after a Team Build has finished. Normally people would use tools that then deploy stuff. Most of these tools trigger a Powershell script at some point, which would allow you to trigger the test run:
Octopus Deploy
TFS Deployer
We use Hudson for our build/CI needs. In addition to unit tests (running during build) I have a staging environment that runs additional integration tests. Basically the build happens and then build artifacts are submitted the external system. I do not wish to block a Hudson build to wait for integration tests (as that locks the station into idle, and prevents it from building anything else). What I want is to update the the result of the build with the result of the external tests (and attach some logs back to the build, if possible).
Now because the staging environment is asynchronous to the build system (i.e. other systems/people can submit tests), Hudson can't be just monitoring what goes on there right after the build. Hudson build just goes into a test queue. So, I need to notify Hudson, it can't be polling something for updates.
Does Hudson support such behaviour, and if so, how can I achieve it?
I would suggest using the hudson users mailing list [1]
[1] http://java.net/projects/hudson/lists/users/archive
To solve the asynchronous wait issue, you can use the build triggering with an authentication token, and use it in a script.
The Build Triggers section has a Trigger Builds Remotely (e.g. from scripts), which when selected allows you to enter an Authentication Token (which has the descriptive text from your question).
You can thus, remotely trigger the build from a script, i.e., have it as part of the integration test script and trigger the build job using this authentication token.
..
You can have a downstream project just for result collection that integrates the results from various tests and report it to the master and aggregate them all. This project can be triggered using the authentication token, or if there is a single integration test job, you can tie it up as a downstream project.