We have continuous integration on our build server. The program which is automatic tested after every checkin sends some emails. We want to send these emails to the user who made the checkin. Is there any way to get the name uf the user who made the checkin when starting the unit tests.
Best would be, if we can access somehow the name of that user who made the checkin in the AssemblyInitialize Method.
Note: This request is not about sending the test report, it is about changing an email in the configuration file of the application before running all unittests.
You can change the build process workflow to get from the current Shelveset (the type is defined in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll) the OwnerDisplayName (currently it is only the login name with domain so you should do some AD lookup to get the plain name and EMail from AD).
Once you have this information you can check if the test outcome was gree or not. If not an exception is raised in the default template. Catch it and send mail to the user and rethrow the exception.
At test level it is not possible to see it since TFS has test agents which
Can run on another machine thant the build agent (no source code, no sourc control, ...)
Can run distributed on several machines in parallel (send failure mail 6 times from your tester?)
You are trying to solve a problem at the wrong level (inside tests). You can change the Build Process template with no issues quite easy.
Related
A customer is running one of our programs, usually run as a service, as an application. The customer is getting the following error on CoRegisterClassObject():
The class is configured to run as a security id different from the caller.
It looks like some type of session 0 error, but why should CoRegisterClassObject() care about session 0? COM should allow both services (session 0) and apps (session > 0) and not care what registers what, shouldn't it?
Also, I don't like the fact that it's not in the list of errors returnable by CoRegisterClassObject(), as per the Microsoft doc webpage.
The error code in question is CO_E_WRONG_SERVER_IDENTITY (0x80004015).
Per this page:
COM security frequently asked questions
Q6 Why does CoRegisterClassObject return CO_E_WRONG_SERVER_IDENTITY? When launching my ATL 1.1 server service as an .exe file, I receive CO_E_WRONG_SERVER_IDENTITY from CoRegisterClassObject. (The class is configured to run as a security ID different from the caller.) This seems to occur whether I skip the CoInitializeSecurity or not. It fails running as a service or as an .exe file.
A. Many services are debugged by running them as console applications in the interactive user identity. Because the service is already registered to run in a different identity (configurable by the Services control panel applet), OLE fails the CoRegisterClassObject and RunningObjectTable::Register(ROTFLAGS_ALLOWANYCLIENT) calls by returning CO_E_WRONG_SERVER_IDENTITY to enforce security and to prevent malicious servers from spoofing the server. To debug by running in the interactive user's identity, make the following changes in the server's registry entries to prevent these failures:
• To prevent CoRegisterClassObject failure, remove the following named value:
[HKEY_CLASSES_ROOT\APPID\{0bf52b15-8cab-11cf-8572-00aa00c006cf}]
"LocalService"="HelloOleServerService"
• To prevent a IRunningObjectTable::Register(ROTFLAGS_ALLOWANYCLIENT) failure, follow these steps:
Remove the following named value:
[HKEY_CLASSES_ROOT\APPID\{0bf52b15-8cab-11cf-8572-00aa00c006cf}]
"LocalService"="HelloOleServerService"
Then add the following named value:
[HKEY_CLASSES_ROOT\APPID\{0bf52b15-8cab-11cf-8572-00aa00c006cf}]
"RunAs"="Interactive User"
You muist restore the modified registry entries after debugging.
I am assuming you would have to replace {0bf52b15-8cab-11cf-8572-00aa00c006cf} with your COM object's actual CLSID instead.
We have TFS 2015 setup with team build alerts. If I create a team alert for Check-ins, all members of the team successfully get an email on code checked-in. If I create a build failure alert and then get the build to fail, no alerts are received by the team. I don't understand why one would work and the other doesn't. SMTP must be setup fine as are team permissions. What could it be? Is there any where i can see logs?
It turns out to be a bug in the version of TFS that we are using (SP1) which is fixed in a later update (SP2 or 3). The issue was build events were not being raised by the TfsJobAgent due to an error:
Exception Message: TF10121: The path '$(SourcePath)' is not found or not supported. Type or select a different path. (type InvalidPathException)
The $(SourcePath) TFS variable is apparently broken but can be bypassed if updated to the SourcePath in the Variables Tab:
I have updated our builds with so they are using this qualified SourcePath. Build Failure notification emails now being received if you break the build. Apparently Slack integration is now also working!
This is apparently an issue in SP1 and is fixed in later service packs
To narrow down this issue, you can try with below ways:
Set alerts just for yourself to see if you can get an e-mail when the
build fail. Detail ways please refer Set alerts, get notified when
changes occur
Double check the query which the alert is based on, there is a default template, you can use it directly such as below picture
Try to use other build alters such as a build completes to see
whether it works
Look for if there are some related errors in Event Log
I have stop and restart services(Sharepoint Administration & Sharepoint Timer Service)
I cleaned the Configuration Cache by using mentioned steps.
Summary of the steps to clear the timer job:
Stop SharePoint Timer service on all servers in the farm.
Browse to C:\ProgramData\Microsoft\SharePoint\Config{GUID} where the {GUID} folder contains a bunch of XML files and NOT the files with a “.PERSITEDFILE” extension.
Delete all the XML files
Update the contents of the Cache.ini file to just say “1” (without quotes).
Restart the SharePoint Timer service on each server
Reanalyze the issue in Health Analyzer
Does anyone know why this keeps occurring and how I can stop it?
First of all try and check your ULS Logs and see if there is any error that arise.
Secondly try and maybe check the event viewer on your SharePoint server to see if any errors are shown and make sure you have enough disk space available.
and also you might want to check this :Clearing Timer Services
Let me know if you see any error post it here.
hope it helps.
Yotam.
I need to completely disable the SwiftMailer spooling functionality for some of my unit tests.
I have methods that implement application-specific functionality on top of SwiftMailer and I have unit tests for them.
Unfortunately, it appears that SwiftMailer's listener that sends mail spooled to memory at the end of a request is not run during unit testing.
This means that messages spooled to memory are lost. If I spool to a file then I have to manually run the console/swiftmailer:spool:send command. Yes. I know that I could run that command from within my test, but that really doesn't seem very clean and is subject to failure if the syntax of the send command is ever changed.
I have tried removing the swiftmailer.spool configuration from config.yml and specifying it only in config_dev.yml and config_prod.yml, leaving it out of config_test.yml. This has had no effect.
In fact, I have been utterly unable to get rid of the default spool configuration.
I have been using the console config:debug swiftmailer --env=[whetever] to test after each change and the spool configuration is always there with type:memory unless I explicitly set the type to file.
Suggestions?
Many thanks.
I'm attempting to set up some build controllers and agents in our TFS infrastructure. Our TFS server is setup as a build controller, and I have a few build agents set up as well.
When I queue a new build on my system, all appears to be well. No error messages appear, and the build appears in the queue on my system. However, that's all that ever happens. When I go to the page for the build in Visual Studio, it states it's been "Running for 0 seconds". Looking at the admin console on our TFS server, the controller states it's "Ready", but nothing more. All the agents are similarly listed as 'Ready'.
I'm not aware of any logs I can use to diagnose this issue. I've set the Logging Verbosity to 'Diagnostic', but options in the Diagnostics dropdown are greyed out. The activity is completely blank, as well.
Looking in the database on the build controller, the dbo.tbl_BuildController table does list the build. What I find odd, though, is the StartTime is NULL. If I stop the build in VS, the start time and the end time are set to the same thing in the database.
So, I know that the build is registering with the build controller, and that there's not a communication issue; the build just never starts, and never give an error. How can I resolve this? (or, at least get an error that I can chase down).
EDIT: The issue appears to be related to the TFS server. Here's what I uncovered in the event log:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/10411892
Exception: System.ServiceModel.ServiceActivationException: The service '/tfs/queue/GPA/Services/v4.0/MessageQueueService2.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
--- End of inner exception stack trace ---
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
Process Name: w3wp
Process ID: 3756
I would start looking in the Event Log.
Control Panel -> Administrative Tools
Event Viewer
I am assuming that there will be some sort or error appearing in there. If your build agents are on a different machine, make sure you look in the event log there too.
Update from original posters comments
There was an exception in the Event Log which pointed us to here: TFS2012 Build Service offline
Go check the security settings of the user that is used for the build service properties. I've had almost the same issue and it was because I changed some security settings for that specific user where he suddenly could not build anymore.
To find the user:
Go to your TFS server
Open Team Foundation Server Administration Console
Open Build Configuration
Open Properties of the Build Service
This worked for me, password of the user account which was used to access TFS hosted on different Server expired.
Password reset fixed it for me.
The build controller and agent must run the same version of Team Foundation Build.
(Buid Service version is something like v4.0 or v4.1 and it is different from tfs product version which is some thing like 11.0.50727.1)
So, if the build Agent and controller are deployed in different machines, check the build service version on both machines. it must be the same.
TFS prevents to assign a build agent to a build controller with different build service version. However, you are allowed to upgrade one of the build machines to a different version (for example visual studio update 2) without detaching the controller and agent
in some cases the build service version stay unchanged (for example inspite of upgrading to update 2 the version stay v4.0)
in this situation if you want to apply the new version of build service
in tfs 2012 or 2013 to check the build service version:
Go to Build Machine
Open Team Foundation Server Administration Console
Open Build Configuration
Open Build Service properties (click on the properties link next to the unregister
link)
"Listen for build agent communication on" text box
to apply change of the build service version
stop the service
Click the "Change" button
set a different port number
reset the previous port number
immediately the build service version will change from v4.0 to v4.1