Using Buildbot, how do I change "shell_1" to something else? - buildbot

Before my build starts, each of my ShellCommand steps are labelled shell_\d+. It would be nice if Buildbot used the step description instead of the auto generated shell label. Also when we get an email notification, as it says BUILD FAILED: failed shell_3 but it would be nicer if it said BUILD FAILED: unit test xyz failed.
Is there a way to change this shell ID id something else? Perhaps by creating a custom build step and overriding a function? I'm not sure where this ID comes from exactly.

You give the step a name in the addStep method for example:
f = buildbot.process.factory.BuildFactory()
f.addStep(buildbot.steps.shell.ShellCommand((name = 'Hello',
cmd = ['echo', 'Hello World']))
I'd implement the second part as a log observer

Related

CICS: can SYSIDNT be echoed in GMTEXT at startup?

I'm a newbie at this. In my CICS startup JCL I am setting a SYSIDNT of SYSIDNT=Hip1. Is it possible to echo this out to the terminal on startup just like I have found I can do with other things like &SYSUID and &APPLID?
If I have something like this:
SYSIDNT=Hip1
GMTEXT='CICS: &SYSUID, &APPLID, &RELEASE at'
Then I see something like this:
CICS: HIPPO01, IJCKBCDM, 730 at 10:47:11
But I cannot get Hip1 echoed out... and I'd like to know if that is possible to achieve. I see Hip1 echoed to screen once CICS is up and running and I'm using various transactions, so I'm positive it's set correctly - it's just that I can't see to tag it onto the GMTEXT.
I believe I got something I'm happy with by using an EXPORT and a SET statement for a new Symbol - I called SYSTEMID - and then assigned that to SYSIDNT and included it within the GMTEXT via &SYSTEMID.
//MYEXP EXPORT SYMLIST=(SYSTEMID)
//STEP1 SET SYSTEMID=HIP1

How to reset VSTS counter?

We have a need to reset VSTS counter. I do not see any way to do this through UI. There is a way to do it by directly invoking reset build counter REST API, but in order to do this, you need to know the counter id, which you should be able to find out by invoking get a definition REST API. Unfortunately, no matter what I do get a definition call does not return build definition counter.
What am I missing?
Scott Dallamura from Microsoft wrote this thread:
the counters feature was experimental and removed back in March of
this year. I'm not sure how it even got into the documentation, but
I'll make sure it gets cleaned up.
I also didn't success to get the counterId in an API call.
At workaround, you can reset the revision of the build number if you change the build definition name, you can just add/remove a character.
Instead of trying to reset the counter variable, you could create a new variable with a GUID prefix.
This solution creates duplicate counters which might not be ideal but this gives you the ability to revert back to the previous counter values, if necessary.
Please see the following YAML code snippet
variables:
...
#Change this Guid if you require a reset seed on the same value.
resetCounterGuid: 'efa9f3f5-57fb-4254-8a7a-06d5bb365173'
buildrevision: $[counter(format('{0}\\{1}',variables['resetCounterGuid'],variables['YOUR_DEFINED_VARIABLE']),0)]
...

how to verify text present in placeholder in selenium IDE

I want to verify the text present in placeholder. I have located the element and i am using Assert text command. I've entered the same string in value. On executing it is showing actual value did not match
Use assertAttribute or verifyAttribute command.
Example:
verifyAttribute | css=#search#placeholder | Sample String
Notes:
In the Target column of Selenium IDE, you need to provide the proper path of the element followed by an # sign
and then the name of the attribute. (placeholder in your case)
Using
verifyAttibute will still continue running the test case once an
error is detected while using assertAttribute doesn't.
You need to understand that assertText function can only check static text on your webpage.
You must be getting an error message.
This is perfectly normal.
What can help in this situation is using the assertAttribute or verifyAttribute functions.
Both these functions perform the same task; the former stops the test after receiving an error message in the text box while verifyValue just records the error in the log and runs the next commands.
While giving the target, either specify the XPath or refer by using the name=name#placeholder format.
You can find the name value by inspecting the box with a firefox addon called Firepath which runs with another firefox tool called Firebug. Install them if you don't already have.
Hope this helps!
Xpath contains() is the best way.
driver.find_element_by_xpath('//input[contains(#placeholder,"email")]')
Format : '//tag[contains(#attribute,"value")]'

Jenkins Multi-Configuration Build - How do I specify the value of a multi-configuration axis in Email-Ext (Editable Email Notification)?

I've searched and have not found what content token that I would use to note the value of an axis that is used on a multi-configuration build for the email?
This shows up in the normal email but is a blocker for us getting to the better email notifications?
I will accept that this is in an ENV variable somewhere, but have been unable to locate it yet.
For reference
We'd typically add an axis of a label, slaves or user-defined (image below):
Then we would add values:
Those values show up in the normal email notification (note the >> to signify all axes of the multi-configuration build that passed or failed:
I can not seem to get to them in email. I've tried looking for environment specific values and I've tried ${ruby} as a content token, but have been unable to find any information on this thus far.
This was due to not selecting Trigger for each configuration in the Trigger for matrix jobs. When defining an axis like ruby, one would get ahold of it by ${ruby} or possibly ${ENV,"ruby"}.
Have you tried ${axis}?
Also, looks like env vars for axis config are exposed like this:
https://github.com/jenkinsci/jenkins/pull/701

When running multiple tags with NUnit Console Runner and SpecFlow I get incorrect results

This is a follow up to my earlier questions on setting up tags: Can I use tags in SpecFlow to determine the right environment to use? and setting up variables from those tags: How to set up a URL variable to be used in NUnit/SpecFlow framework
I've set up some variables to aid in populating my NUnit Tests, but I find that when the NUnit runner finds the test that fits the first tag the test runs it with the settings of the second tag. Since the tags are important to me to not only know what test to run, but what variables to use, this is causing me problems.
So if I have the following tags:
#first
#first #second
#second
If I run #second everything is fine. If I run #first I get any scenario that has only #first fine, but when it comes to scenarios where I have both #first #second the scenario is run, because #first is there, however, it uses the parameters for #second. Since I am running the DLL through the NUnit-Console and the Tests are written through SpecFlow I am not sure where the issue may lie.
Does anyone have advice on setting up tests to run like this?
You've not been very specific, but it sounds like you have a feature file like this:
#first
Scenario: A - Something Specific happens under the first settings
Given ...etc...
#second
Scenario: B - Something Specific happens under the second settings
Given ...etc...
#first #second
Scenario: C - Something general happens under the first and second settings
Given ...etc...
It looks like you are selecting tests to run in NUnit by running all the tests in the "first" category.
If you set up event definitions like this:
[BeforeFeature("first")]
public static string FirstSettings()
{ ... }
[BeforeFeature("second")]
public static string SecondSettings()
{ ... }
If you execute scenario C then FirstSettings() and SecondSettings() will be executed before it. This is regardless of whether you used the #second category to select the test to run under NUnit.
This is almost certainly the reason that you are seeing the second settings applied to your test with both tags - I expect the second settings overwrite the first ones, right?
My only advice for setting up tests like this, is that binding events and so on to specific tags can be useful but should be used as little as possible. Instead make your individual step definitions reusable, and set up your test environment, where possible, with Given steps.