Invoking ActivateBuildFailureTarget only on a build failure - f#

Working with FAKE 4 (Legacy), I am not able to identify documentation on the properly use of ActivateBuildFailureTarget. My end goal is that the BuildFailureTarget that I've defined only gets called when the build fails within a specific Target. As alluded to, I have already created a BuildFailureTarget.

Related

How to take screenshots only for failure step in geb using athaydes plugin

I am using athaydes plugin to create HTML reports with step wise screen shots. It's working fine and capturing screenshots for all steps. However my requirement is that, how to capture screen shots only for failed steps. Is there any provision there or do I need to use any specific keyword in athaydes properties file. I am using below property file "com.athaydes.spockframework.report.IReportCreator.properties"
# Name of the implementation class of the report creator
com.athaydes.spockframework.report.IReportCreator=com.athaydes.spockframework.report.template.TemplateReportCreator
# Output directory (where the spock reports will be created) - relative to working directory
com.athaydes.spockframework.report.outputDir=target/reports
com.athaydes.spockframework.report.testSourceRoots=src/test/groovy
com.athaydes.spockframework.report.showCodeBlocks=false
# Set properties specific to the TemplateReportCreator
com.athaydes.spockframework.report.template.TemplateReportCreator.specTemplateFile=/templates/spec-template.html
com.athaydes.spockframework.report.template.TemplateReportCreator.reportFileExtension=html
com.athaydes.spockframework.report.template.TemplateReportCreator.summaryTemplateFile=/templates/summary-template.html
com.athaydes.spockframework.report.template.TemplateReportCreator.summaryFileName=index.html
Can anyone please help me on this. Thanks!
This is not directly related to spock-reports. As you are using Geb, you can configure it to only report failures via the following setting in your GebConfig.groovy:
reportOnTestFailureOnly = true
See the official Geb documentation for more information.

xText: doGenerate method is not called

I'm developing a DSL using xText (version 2.10.0) and i would like to add also a code generator.
When running the plug-ins, as I understood, the code generator should be invoked automatically upon a change in a file.
This is not happening.
Using a debugger I've noticed that the doGenerate function is not invoked.
What can I do so the doGenerate function will be invoked automatically?
Thanks.
Your file needs the right file extension (case sensitive) the project needs xtext nature and build automatically needs to be enabled. Then the generator will be called upon save of error free models

During iOS application tests, how can I access a singleton instance in the host application?

I'm writing an iOS app with Swift, and we are using Parse for our backend. I'm working on some acceptance tests, and have mocked the Parse API using OHHTTPStubs.
I'm writing a test that taps through our login form and logs in a given user. In the view controller, we are calling the PFUser.logInWithUsernameInBackground function. Inside the completion block, I'm calling println(PFUser.currentUser()), and I can see that it is set correctly.
However, when I call println(PFUser.currentUser()) from my test case, it is still nil. I want to make sure that the user is being signed in, and that their username is correct.
The tests are application tests which are injected into the host application, and are written with KIF. So I think the tests may contain their own separate PFUser singleton instance, instead of accessing it on the host application. So I need to figure out how to gain access to the currentUser() inside the main app.
Is there any way I can tell my tests to use the PFUser class from the main app?
If you think this should normally work out of the box, what kind of mistakes should I look for in my code? (e.g. bridging headers, build settings, etc.)
I figured out the solution. I needed to access the class from the main bundle, and I did so by adding this line to a helper file in my test target:
let AppUser: AnyClass! = NSBundle.mainBundle().classNamed("PFUser")
This lets me perform checks such as AppUser.currentUser() == nil, and call functions like AppUser.signOut() on the main bundle, instead of in the test bundle.
The reason is that the main bundle and test bundle are separate, and classes are not shared between them. This OHHTTPStubs wiki page goes into more depth about the difference between hosted and non-hosted tests in Xcode.

TFS 2013 build activity GetLocalPath not working

It seems that no matter what I pass into the Microsoft.TeamFoundation.Build.Activities.Core.GetLocalPath build activity it always returns the same thing as a result.
I have tried passing in both full file paths and just directories.
Below are two example activity logs which show this incorrect behavior:
Directory path
Full path
I have verified that the server directory is mapped in the build definition and everything should be set up correctly.
Am I doing something wrong or is this just a bug? If so, is there any way to work around this? In the past it was possible to use ConvertWorkspaceItem but the Workspace variable is no longer available.
I was also getting the same error. GetLocalPath just returning whatever you give as output. I resolved it by placing the GetLocalPath activity inside Run on Agent scope and it started working fine.
Placing the same activity outside Run on Agent reproduced the error.

TFS2010 - Logging inside custom build activity

We have a custom build activity, which performs the execution of our build. We use a custom activity, because the compilers we use are very special and the system is quite old and we do not want to rewrite the whole thing so that it works with MSBuild. However, the repository is managed by TFS and the build shall be triggered by TFS.
Inside the custom build activity, I would like to log the status. Currently, I'm doing this with this piece of C# code:
private void LogMessage(String message, CodeActivityContext context)
{
BuildInformationRecord<BuildMessage> record =
new BuildInformationRecord<BuildMessage>()
{
Value = new BuildMessage()
{
Importance = BuildMessageImportance.High,
Message = message,
},
};
context.Track(record);
}
It works, however there is one big problem: Our custom build activity takes about 6 hours for execution (as I said, it's an old and also large software project). The problem is that the log messages only appear inside TFS build summary once the build action has completed. So after 6 hours of building, all the log messages appear at once.
What we would like to have is that the messages are shown as they are logged. So that the build guy can see where the build currently is, and also see what happened.
One workaround I implemented so far is to have the custom build activity use a Queue of Messages which is shared with the workflow foundation part. Then, inside workflow foundation, I created a parallel statement which executes the build and at the same time empties the queue of messages and displays them. Here is a screenshot of that construct:
However, the result is pretty disappointing. This is what comes out:
The red one is the actual build log message, everything around it is just the while loop and the other things...
Is it possible to switch those log messages off?
You could try setting the following attribute on the Build Process Template XAML (cannot be done via the designer) to suppress the messages:
mtbwt:BuildTrackingParticipant.Importance="None"
example from my template:
<InvokeMethod DisplayName="Delete File" mtbwt:BuildTrackingParticipant.Importance="None" ... />
mtbwt:BuildTrackingParticipant.Importance="Low"/"None" only controls the call (I guess). Instead use mtbwt:BuildTrackingParticipant.TrackingOption="None", which seems to get completely rid of all tracking messages in the call.

Resources