Post build task not working [Jenkins] - selenium

Can someone please help. I am trying to trigger a post-build action using the post-build action plugin. The log text that I inputted is returning false, hence not performing a post-build action. When I don't enter any text, it returns true.
This is a simple freestyle project that should print test if it matches the text
Post build setting
This is the console output returning false
Console output returning false
This is the output with no text
Output with no text
Any help will be appreciated. All I want to do is perform a post-build action depending on if my build fails or passes. Alternate solution is welcomed
Thanks

The root cause is your job has no any log out in Job Build Stage, please see Post build task plugin's help, this plugin will search job build log to find the text you specified in plugin.
A quick way to re-try is add a Build Step to print out something:
1. Execture shell (if job executed on Linux machine)
2. Execute windows batch (if job execute on Window machine)
A Job configure example:

Related

Intellij IDEA - stop gradle run tool window from filtering console logs?

I find that when I'm running a failing Gradle task from within IDEA, the "Run" tool window automatically selects the most recent "node" in the tool window, which filters out all the console logs except from that "node" - IDEA tries help by showing only the logs relating to the failing task.
The problem is that the console output of just the last task never shows useful output.
It doesn't show the exception that caused the failure, and it doesn't show any logs leading up to the failure.
For example, when running a JavaExec task, by default IDEA shows this when the task ends:
In order to see the info that's actually relevant to debugging the issue, I need to manually select a node higher in the tree:
The question:
Is there any way to tell IDEA to automatically select the "task node" for a failing Gradle task (which usually contains the usable information), instead of the "command" node which almost never shows useful information?
IntelliJ: 2022.1.3
Gradle: 7.4.1
As per comment from Andrey - there is no such option for IDEA 2022.1.

Jenkins how to manage workspace file

I am doing a simple screenshot compare Jenkins build.
The idea is very simple:
1, run build with "generate" parameter to generate screenshot and save in workspace.
2, run build with "compare" parameter to take screenshot and compare with the saved screenshot in above step.
To make the captured screenshot carry over to next build: I use the option of "Force polling using workspace". That works fine when build success. But, once the build failed, the workspace is clean up. And the generated screenshot in step one are lost.
Is there a better why to handle the screenshot? There is a solution to put the screenshot to separate server. But, is there a simpler way?

MSBuild task silent execution

I have msbuild script that perfectly working. But when it runs when build task executed I'm seeing all output of building progress.
Is there a way to just write :
Building project ... OK.
instead of 1000 rows of text?
Use verbosity parameter to set log to the level you'd like, e.g.:
msbuild myScript.proj /verbosity:quiet
UPD:
Sorry, that was not clear from the original question, but (from the comments) it looks like you want to have different verbosity levels for different Tasks. I don't think this is supported out-of-the box. You could try 2 solutions:
Run your task using Exec task (see this question for details)
Implement a custom logger and filter messages by task name.

How to get MSBuild to print command output in post-build task?

I have a Visual Studio 2005 solution/vcproj which has a post-build task that runs unit tests. I want to build it using msbuild.exe.
However, when the tests fail, I do not see any output logged to the console (I've verified that output is logged when executed at the command line.) I can see the output if I use the /v:detailed parameter. Is there a better way to do this? Ideally, I only want to see the output if a test fails.
Thanks.
To answer my own question, the best way I've found is to call msbuild and pass parameters down to vcbuild:
msbuild ... /p:VCBuildAdditionalOptions="/M /logfile:logfile.log" || type logfile.log
So if the build fails, the errors that were logged will be output at the end of the build which is sufficient for me.

How to stop TFS Build when custom task fails

I am calling a custom task (derived from Microsoft.Build.Utilities.Task) from the AfterDropBuild target in my TFSBuild.proj. If my Execute override returns false, the build log shows the task as FAILED, but I still get a successful build, which means that I do not realise there is a problem with the build. How do I ensure that the build as a whole also fails?
Edit: This is TFS 2008.
You've created a mismatch between logged errors and your task result. You need to first log an error, with Log.LogError. Then return !Log.HasLoggedErrors from your tasks, always. (from trick #2 in the book "MSBuild Trickery").