TAP plugin for Jenkins - perl

I am trying to get the TAP plugin for jenkins working to consume a stream from perl/prove. I have the TAP plugin installed and also the junit plugin. I am not sure where or how to install the tap4j jar and I am not sure how to tell the TAP plugin where the stream files are written.
Following the documentation for the TAP plugin I am calling "prove t/ --archive output" which is writing the stream to a file in output/t:
1..73
ok 1 - use Records;
ok 2 - An object of class 'Relationship' isa 'Relationship'
ok 3 - Relationship->can('rel_insert')
ok 4 - Relationship->can('rel_get')
ok 5 - An object of class 'Records' isa 'Records'
ok 6 - Records->can('IPND_read_file')
ok 7 - Records->can('IPND_read_all_files')
ok 8 - Records->can('IPND_get_our_numbers')
ok 9 - Records->can('IPND_get_tpg_names')
ok 10 - Records->can('IPND_get_tpg_addresses')
ok 11 - Records->can('IPND_sentence_records')
ok 12 - Records->can('IPND_sentence_a_record')
ok 13 - Records->can('IPND_analyse_count')
ok 14 - Records->can('IPND_match_numbers')
ok 15 - Records->can('IPND_dump_to_json')
ok 16 - Records->can('IPND_read_from_json')
ok 17 - Records->can('IPND_dump_sentence')
ok 18 - Records->can('IPND_report_sentence')
ok 19 - Records->can('IPND_report_categories')
ok 20 - Testing listing status: no bits set
ok 21 - Testing listing status: directory bit set
ok 22 - Testing listing status: directory and suppress bits set
ok 23 - Testing listing status: suppress bit set
ok 24 - Testing Installed status: not a number
ok 25 - Testing Installed status: 0
ok 26 - Testing Installed status: just below range
ok 27 - Testing Installed status: range boundary
ok 28 - Testing Installed status: just above range boundary
ok 29 - Testing Installed status: middle of range
ok 30 - Testing Installed status: just before end of range
ok 31 - Testing Installed status: end of range
ok 32 - Testing Installed status: just after range
ok 33 - Testing Installed status: after range
ok 34 - Testing pair exists: both exist
ok 35 - Testing pair exists: first exists
ok 36 - Testing pair exists: second exists
ok 37 - Testing pair exists: neither exists
ok 38 - Testing pair exists: empty hash
ok 39 - Testing cmp_numbers: same number
ok 40 - Testing cmp_numbers: different number
ok 41 - Testing cmp_strings: same string
ok 42 - Testing cmp_strings: different strings
ok 43 - Testing cmp_strings: same string, different case
ok 44 - Testing cmp_strings: different strings, different case
ok 45 - Testing cmp_strings: same string, different case
ok 46 - Testing cmp_strings: different strings, different case
ok 47 - Testing cmp_strings: same string, different case
ok 48 - Testing _cmp_date: first is undef
ok 49 - Testing _cmp_date: second is undef
ok 50 - Testing _cmp_date: both undef
ok 51 - Testing _cmp_date: first is 0
ok 52 - Testing _cmp_date: second is 0
ok 53 - Testing _cmp_date: both 0
ok 54 - Testing _cmp_date: first dashes
ok 55 - Testing _cmp_date: second dashes
ok 56 - Testing _cmp_date: both dashes
ok 57 - Testing _cmp_date: neither dashes
ok 58 - Testing _cmp_date: dieing on first string
ok 59 - Testing _cmp_date: dieing on second string
ok 60 - Testing _cmp_date: dieing on both strings
ok 61 - Testing _cmp_date: less than
ok 62 - Testing _cmp_date: more than
ok 63 - Testing _cmp_date: equal
ok 64 - Testing _bool_to_text: 0
ok 65 - Testing _bool_to_text: 1
ok 66 - Testing _bool_to_text: -1
ok 67 - Testing _bool_to_text: 250
ok 68 - Testing _functionize_params
ok 69 - Testing _Rtrim: space on end
ok 70 - Testing _Rtrim: tab on end
ok 71 - Testing _Rtrim: space on end and beginning
ok 72 - Testing _Rtrim: space on end and tab on beginning
ok 73 - Testing _extract_field
I have failed to find any configuration file for the TAP plugin. I have also just realized that tap4j is an external jar file rather than another jenkins plugin. I have downloaded the jar but now don't know where to put it.
in Summary:
where is the TAP plugin config file
how do I point the TAP plugin at my stream in output/t
where do I put the tap4j.jar file for TAP plugin to use.

OK obscure as - ie lots and lots of assumed knowledge but:
I don't know that there is a config file - haven't found one anyway.
In my case the TAP stream files were off the root of the workspace in output/t. In my Jenkins file I placed a stage:
stage('Report') {
steps {
step([$class: "TapPublisher", testResults: "**/output/t/*"])
}
}
The key is the last bit which tells the plugin where to find the streams. Literally the first ** says look everywhere for "output/t" - ie a directory path snippet - and then under there treat everything - the last "*" - as a stream file.
There may be many places to plonk the jar file but I put it in "/plugins/tap/". In my case on Ubuntu 20.04 that was /var/lib/jenkins/plugins/tap.

Related

Perl module WWW:RobotRules won't install

Originally, I wanted to install XML::Parser::Expat module which gave a message Tests succeeded but one dependency not OK (LWP::UserAgent) which also when tried to install it give a message about one dependency not OK (WWW::RobotRules); additionally test harness failed.
Now installing WWW::RobotRules will give me:
""Test Summary Report
-------------------
t/rules-dbm.t (Wstat: 0 Tests: 13 Failed: 1)
Failed test: 12
Files=2, Tests=63, 0 wallclock secs ( 0.01 usr 0.02 sys + 0.03 cusr 0.04 csys = 0.10 CPU)
Result: FAIL
Failed 1/2 test programs. 1/63 subtests failed.
make: *** [Makefile:840: test_dynamic] Error 255
GAAS/WWW-RobotRules-6.02.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports GAAS/WWW-RobotRules-6.02.tar.gz
How can I solve this problem?
Regards,
[Edited]
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
Database was generated on Tue, 28 Jul 2020 01:41:03 GMT
Running install for module 'WWW::RobotRules'
Checksum for /root/.cpan/sources/authors/id/G/GA/GAAS/WWW-RobotRules-6.02.tar.gz ok
Configuring G/GA/GAAS/WWW-RobotRules-6.02.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for WWW::RobotRules
Writing MYMETA.yml and MYMETA.json
GAAS/WWW-RobotRules-6.02.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for G/GA/GAAS/WWW-RobotRules-6.02.tar.gz
cp lib/WWW/RobotRules/AnyDBM_File.pm blib/lib/WWW/RobotRules/AnyDBM_File.pm
cp lib/WWW/RobotRules.pm blib/lib/WWW/RobotRules.pm
Manifying 2 pod documents
GAAS/WWW-RobotRules-6.02.tar.gz
/usr/bin/make -- OK
Running make test for GAAS/WWW-RobotRules-6.02.tar.gz
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/rules-dbm.t .. Failed 1/13 subtests
t/rules.t ...... ok
This is verbose to make test
t/rules-dbm.t ..
1..13
ok 1
Rules: /aas /per /god /old
ok 2
Rules:
ok 3
No visits: 2
Last visit: 1595923839
Fresh until: 1627459829
ok 4
ok 5
ok 6
Agent-Name: myrobot
ok 7
*** Dump of database ***
|ua-name| myrobot
www.aas.no:80|vis 3; 1595923839; Tue Jul 28 17:10:39 2020
www.sn.no:80|vis 1; 1595923829; Tue Jul 28 17:10:29 2020
www.aas.no:80|exp 1627459829; Wed Jul 28 17:10:29 2021
******
ok 8
ok 9
ok 10
ok 11
not ok 12
*** Dump of database ***
|ua-name| MOMSpider
www.sn.no:8080|r2 /bar
www.sn.no:8080|exp 1595923832; Tue Jul 28 17:10:32 2020
www.sn.no:8080|r1 /foo
******
No agent name specified at t/rules-dbm.t line 122.
ok 13
Failed 1/13 subtests
t/rules.t ......
1..50
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18
ok 19
ok 20
ok 21
ok 22
ok 23
ok 24
ok 25
ok 26
ok 27
ok 28
ok 29
ok 30
ok 31
ok 32
ok 33
ok 34
ok 35
ok 36
ok 37
ok 38
ok 39
ok 40
ok 41
ok 42
ok 43
ok 44
ok 45
ok 46
ok 47
ok 48
ok 49
ok 50
ok
Test Summary Report
-------------------
t/rules-dbm.t (Wstat: 0 Tests: 13 Failed: 1)
Failed test: 12
Files=2, Tests=63, 0 wallclock secs ( 0.00 usr 0.03 sys + 0.01 cusr 0.06 csys = 0.10 CPU)
Result: FAIL
For some reason the sleep function is not working. I replaced this line in t/rules-dbm.t to an alternative waiting function.
sleep(5) to select(undef, undef, undef, 5)
However, I didn't know the reason. I tried sleep() in a new code and only sleep() would give unlimited waiting time but whaterver seconds I wrote (e.g. 3000000000000) it didn't wait and excuted the following line immediatley. I wish if someone knows the reason to tell me.

How do I create a Windows Server script to remove error records, AND the previous record to each, from a file with the results written to a NEW file

I’m trying to solve a production problem. We receive an error file daily (Mon-Fri) from the bank that contains error records. These records are 94 bytes in length. On occasion there will be some error codes in the file that cause some significant problems when processed by a system at the State.
I was asked to “filter out” the error records from the file that gets sent to the State. To do this, I created a one line FINDSTR command (below) to locate records containing the error code “R02” (no quotes) in positions 4-6 of the records, and remove them.
FindStr /V "R02" INPUT_FILE > OUTPUT_FILTERED_FILE_%DATE%_%TIME%
This worked as I had hoped and the requesting users were happy, BUT one of the managers found that the record immediately preceding the record containing the error code ALSO MUST BE DELETED from the file, because it is associated with the record containing the error code. The problem is that this preceding record does NOT contain an error code in it. There is a 6 digit number in positions 89-94 that could be related to the error record, but I don't want to guess, or over-complicate the script.
As you can see in the example data (below), there are 5 error records (5, 7, 9, 11, and 27), containing error code “R02.” My FindStr command worked for removing the R02 records and creating an output file without any of the error records (containing “R02”).
WHAT I NEED NOW is to be able to remove the “associated records” that go with the R02 records in the example data below. Done properly, the following records would be removed from the example file in a single process: 4, 5, 6, 7, 8, 9, 10, 11, 26 and 27.
I need to delete both the “R02 error records AND the associated record above each of those error records simultaneously, and write the output to a NEW file, leaving the original file intact AS-IS – because it is retained locally by our user department.
Below, is what the INPUT record content looks like (error codes in BOLD), with a record number pre-pended for reference purposes. Sorry, but I can’t supply the full 94 byte record images due to security issues. Below that, is what my desired output file should look like.
I don’t know if this can be done with FindStr, but I’m sure PowerShell can do the job, BUT I know nothing about PowerShell. The script will be executed on Windows Server.
Can anyone help me with creating a script that will accomplish the processing to transform the input file into the desired output file?
Thanks very much in advance for your assistance.
****** Example Data ******
Input File
Nbr - - Record Content - -
01 HEADER RECORD
02 CONTROL RECORD
03 5200SAN
04 62112200
05 799**R02**12
06 62112200
07 799**R02**12
08 62112200
09 799**R02**12
10 62112200
11 799**R02**12
12 82000000
13 5200SAN
14 62112200
15 798C0312
16 62112200
17 798C0312
18 62112200
19 798C0312
20 62112200
21 798C0312
22 62112200
23 798C0312
24 82000000
25 5200SAN
26 62112200
27 799**R02**12
28 TRAILER RECORD
Desired New Output File
Nbr - - Record Content - -
01 HEADER RECORD
02 CONTROL RECORD
03 5200SAN
# DELETED #
# DELETED #
# DELETED #
# DELETED #
# DELETED #
# DELETED #
# DELETED #
# DELETED #
12 82000000
13 5200SAN
14 62112200
15 798C0312
16 62112200
17 798C0312
18 62112200
19 798C0312
20 62112200
21 798C0312
22 62112200
23 798C0312
24 82000000
25 5200SAN
# DELETED #
# DELETED #
28 TRAILER RECORD
The following Powershell is untested, but should do basically what you're asking for. There very well may be bugs in my logic, but this will give the basic framework of what needs to happen.
[cmdletbinding()]
Param
(
[string] $InputFilePath
)
# Read the text file
$InputFile = Get-Content $InputFilePath
# Get the time
$Time = Get-Date -Format "yyyyMMdd_hhmmss"
# Set up the output file name
$OutputFileFiltered = "Output_Filtered_File_$Time.txt"
# Initialize the variable used to hold the output
$OutputStrings = #()
# Loop through each line in the file
# Check the line ahead for "R02" and add it to the output
# or skip it appropriately
for ($i = 0; $i -lt $InputFile.Length - 1; $i++)
{
if ($InputFile[$i + 1] -notmatch "R02")
{
# The next record does not contain "R02", add it to the output
$OutputStrings += $InputFile[$i]
}
else
{
# The next record does contain "R02", skip it
$i++
}
}
# Add the trailer record to the output
$OutputString += $InputFile[$InputFile.Length - 1]
# Write the output to a file
$OutputStrings | Out-File $OutputFileFiltered
Save that as FilterScript.ps1 (or whatever you prefer) and execute it in Powershell with the following:
FilterScript.ps1 -InputFilePath "C:\Path\To\Your\InputFile.txt"

Maple: command to simplify fraction

Why doesn't Maple simplify a fraction like
-sqrt(5)*(5+sqrt(5))/120
to (-1-sqrt(5))/24 ?
Are there any commands to do this?
A suitable command for this is radnormal.
ee:=-sqrt(5)*(5+sqrt(5))/120;
1 (1/2) / (1/2)\
ee := - --- 5 \5 + 5 /
120
radnormal( ee );
1 1 (1/2)
- -- - -- 5
24 24
There are a few others which can get the form (at least for this particular example).
expand( ee );
1 1 (1/2)
- -- - -- 5
24 24
evala(Normal( ee ));
1 1 (1/2)
- -- - -- 5
24 24
Note that the distribution of the factor 1/24 is done here by Maple as an automatic simplification (and which is usually difficult to disable or awkward to avoid). Notice how delayed evaluation won't prevent it.
'(-1-sqrt(5))/24';
1 1
- -- - -- sqrt(5)
24 24

Xvnc process at 100% CPU when idle

I have a very annyoing problem when running TigerVNC 1.3.1 in a Debian 7 virtual machine. After about one minute doing nothing in the VNC window, the Xvnc process goes up to 100% CPU usage. Once I move my mouse into the VNC window again, the CPU usage returns to normal. I believe that the function call select() is the culprit. Doing an "strace -p " gives me tons of this:
select(256, [0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74], NULL, NULL, {0, 0}) = 0 (Timeout)
And "strace -c -p ":
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
78.19 0.001760 0 98445 select
21.81 0.000491 0 196889 setitimer
------ ----------- ----------- --------- --------- ----------------
100.00 0.002251 295334 total
I'm not an expert on system function calls, but all other processes I checked with these commands do not show that kind of behavior. Is it a bug in the tigervnc code or is there a way I can fix it?
I'd recommend you reset to default settings to see if everything becomes fine. I was a tightvnc user for a long time, until I switched to RealVNC (free edition). I'd suggest you give a try of it. The settings are almost identical to tightvnc. And it supports real cross machine text copy-and-paste.

Xcode crashing on startup "parentPath must be nil but it is not"

I'm having XCode (latest version) crash whenever I start up - can't get anything done until I resolve this - any ideas?
Error - See below
What I did prior to getting the issue
had put in a new HDD (and moved the old to the optical bay) - reinstalled XCode 4 on the new SSD - all working fine
I did rename my home directory user name on the "old" HDD to put "_OLD" at the end - just so I didn't get confused if jumping to the old HDD for files
I tried to open a test project from this old HDD area - got some issue opening it (can't remember details) - closed/restarted fromhere
Then after this every time I try to open XCode a fresh it's like it tries to open the last projects that was open including this one I had an issue with - get the below error - can't continue on using xcode have to crash out
Error:
ASSERTION FAILURE in /SourceCache/DVTFoundation/DVTFoundation-903/Framework/Classes/FilePaths/DVTFilePath.m:322
Details: fsrep is absolute (starts with tilde) ('~--814203924d469071-0000000000') parentPath must be nil but it is not ('<DVTFilePath:0x401bdf9e0:'/Volumes/Macintosh HD/Users/greg/.dvdcss'>')
Object: <DVTFilePath>
Method: +_filePathForParent:fileSystemRepresentation:length:allowCreation:
Thread: <NSThread: 0x40010a260>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x0000000103f44466 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x00000001035b3794 _DVTAssertionFailureHandler (in DVTFoundation)
2 0x0000000103550a9e +[DVTFilePath _filePathForParent:fileSystemRepresentation:length:allowCreation:] (in DVTFoundation)
3 0x0000000103550963 +[DVTFilePath _filePathForParent:pathString:] (in DVTFoundation)
4 0x0000000103b95642 -[DVTFilePath(IDESourceControlStatus) IDESourceControl_importantSubpaths] (in IDEFoundation)
5 0x0000000103b414ac -[IDEFileReference _updateSourceControlStatusIfNeeded] (in IDEFoundation)
6 0x0000000103b37951 -[IDEWorkspace _updateSourceControlStatusIfNeeded] (in IDEFoundation)
7 0x00007fff8c2eb25a __NSFireDelayedPerform (in Foundation)
8 0x00007fff8b82df84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (in CoreFoundation)
9 0x00007fff8b82dad6 __CFRunLoopDoTimer (in CoreFoundation)
10 0x00007fff8b80e471 __CFRunLoopRun (in CoreFoundation)
11 0x00007fff8b80dae6 CFRunLoopRunSpecific (in CoreFoundation)
12 0x00007fff8b3633d3 RunCurrentEventLoopInMode (in HIToolbox)
13 0x00007fff8b36a63d ReceiveNextEventCommon (in HIToolbox)
14 0x00007fff8b36a4ca BlockUntilNextEventMatchingListInMode (in HIToolbox)
15 0x00007fff86bde3f1 _DPSNextEvent (in AppKit)
16 0x00007fff86bddcf5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
17 0x00007fff86bda62d -[NSApplication run] (in AppKit)
18 0x00007fff86e5980c NSApplicationMain (in AppKit)
19 0x0000000103549eec (in Xcode)
20 0x0000000000000002
I had the same problem.
It was due to a file fo which the name started by ~ in the directory path given by Xcode when it crashed.
Check if you don't have such a file and delete it.
In my case, it solved the issue.
Hope this help,
Rds,
Michael
The solution that worked for me is to delete the Xcode autosave files in ~/Library/Autosave Information. Xcode then started up clean for me.
may not be best answer (?) however I had to (a) reinstall + (b) delete all the various XCode files scattered through my home directory...then it started up ok
Step 1: Copy all the code you want to keep into text files or
something like that
Step 2: Un-install
Step 3: make some coffee
Step 4: Re-install
Details: fsrep is absolute (starts with tilde) ('~--814203924d469071-0000000000') parentPath must be nil but it is not ('<DVTFilePath:0x401bdf9e0:'/Volumes/Macintosh HD/Users/greg/.dvdcss'>')
Object: <DVTFilePath>
in my case the file referenced was dropbox's cache, so the error looked like this
must be nil but it is not ('<DVTFilePath:0x401bdf9e0:'/Volumes/Macintosh HD/Users/greg/.dropbox.cache.2.25.12'>')
after some research on dropbox forums i found these cache directories can be deleted. after removal xcode worked fine.
so i would tell future people who come here to try and remove the offending file prior to reinstalling xcode. (or rename it if you cant delete it)
I deleted ~/Library/Preferences/com.apple.dt.Xcode.plist and Xcode started normally again.
In my case I was xcodebuild'ing Xcode UI Tests from command line using custom .xcconfig file:
HERE_BUILD=./Build-command-line
HERE_INTERMEDIATES=$(HERE_BUILD)/Intermediates
// Paths
// the following paths are enough to redirect everything to $HERE_BUILD
MODULE_CACHE_DIR = $(HERE_BUILD)/DerivedData/ModuleCache
OBJROOT = $(HERE_INTERMEDIATES)
SHARED_PRECOMPS_DIR = $(HERE_INTERMEDIATES)/PrecompiledHeaders
SYMROOT = $(HERE_BUILD)/Products
When I changed HERE_BUILD to have absolute path:
HERE_BUILD=$(SRCROOT)/Build-command-line
the error went away.