phpunit output numbers meaning - phpunit

When I run phpunit I have following output
phpunit:
PHPUnit 4.8.16 by Sebastian Bergmann and contributors.
................................................................. 65 / 93 ( 69%)
............................
Time: 354 ms, Memory: 10.25Mb
OK (93 tests, 119 assertions)
What is 65 ? and 69% ?

As PHPUnit executes a test, it displays a marker on your screen to indicate its progress.
It means that by the end of the first line of dots (one dot for each test), phpunit had completed 65 tests out of 93 total tests, which is 69% of the test run. There are 65 dots in that first line, showing that all 65 of those tests have been run and passed, without any fails, skips, ignores, etc. Correctness/failure of tests is shown by different colours/characters than ., such as a red F for a failed test
After each completed display line, PHPUnit shows the number of tests completed, total of all tests, and %complete.
The second line has 28 dots, showing the results for tests 66 through 93, at which point the run is 100% complete. Because it isn't a complete line of dots, but the run of all tests has actually completed, it doesn't show the numbers again; but will show detailed results for any errors or failures that occurred before returning to the command line prompt
No doc is provided for this
Hope this help

Every dot PHPUnit prints out is a single test run by the framework and after each line, PHPUnit will tell you how far it got.
So in your case, 65 / 93 ( 69%) means that 65 out of 93 tests have been executed, which is 69% of all tests.

Related

Eva plugin of Frama-C reports "invalid user input" after finishing analysis

I get the following log when I am trying to apply Eva plugin to a C project.
[eva:summary] ====== ANALYSIS SUMMARY ======
----------------------------------------------------------------------------
53 functions analyzed (out of 9107): 0% coverage.
In these functions, 5300 statements reached (out of 14354): 36% coverage.
----------------------------------------------------------------------------
Some errors and warnings have been raised during the analysis:
by the Eva analyzer: 0 errors 15 warnings
by the Frama-C kernel: 0 errors 2 warnings
----------------------------------------------------------------------------
45 alarms generated by the analysis:
29 invalid memory accesses
4 accesses out of bounds index
6 invalid shifts
1 access to uninitialized left-values
5 others
----------------------------------------------------------------------------
Evaluation of the logical properties reached by the analysis:
Assertions 1113 valid 18 unknown 1 invalid 1132 total
Preconditions 0 valid 0 unknown 0 invalid 0 total
98% of the logical properties reached have been proven.
----------------------------------------------------------------------------
[kernel] Warning: warning CERT:MSC:38 treated as deferred error. See above messages for more information.
[kernel] Frama-C aborted: invalid user input.
Frama-C aborted the analysis after providing the analysis summary. However, it does not point out which file and which line of code that has a problem.
Could you please let me know which are possible problems in this case? And is the analysis finished?
As the header of the line indicates, the message is not emitted by Eva, but by Frama-C's kernel. This error indicates that your code is violating CERT C Coding Standard, and more specifically its rule MSC-38 which basically states that it is a bad idea to declare identifiers that belong to the standard library, where they are specified as being potentially implemented as a macro. This notably includes assert and errno.
As this rule indicates that the code is not strictly ISO-C compliant, it has been decided to treat it by default as an error, but given the fact that the issue by itself is unlikely to make the analyzers crash, Frama-C does not abort as soon as it is triggered. This is why you can still launch Eva, which runs flawlessly, before being reminded by the kernel that there is an issue in your code (a first message, with Warning status, was likely output at the beginning of the log).
You can modify the severity status of CERT:MSC:38 using -kernel-warn-key CERT:MSC:38=<status>, where <status> can range from inactive (completely ignored) to abort (emit an error and abort immediately). The complete list of statuses can be found on section 6.2 of the user manual.

How to make zsh's REPORTTIME work? (time for long-running commands)

This is my .zshrc:
export REPORTTIME=3
When I run sleep 4 it doesn't output anything.
If I change to REPORTTIME=blablabla (or anything non-sensical) it doesn't raise an error and starts behaving as REPORTTIME=0, i.e. returning the time taken for everything.
Interestingly, if I try REPORTTIME=3s I get the following message:
zsh: bad math expression: operator expected at `s'
sleep 4 0.00s user 0.00s system 0% cpu 4.004 total
So I get the error and still the output.
I tried RERPORTTIME="3" and even REPORTTIME=1+2. None of these work.
Also, if I run python -c "import time; time.sleep(4)" I get the same results (so the problem is not with sleep).
Of course, I tried other values too (other than 3).
I'm running MacOS with iterm2 and zsh is my default shell.
You need to set it explicitly to a non-negative integer representing seconds; i.e.
% REPORTTIME=3
Setting to other non-negative values does not work on my Zsh v5.4.2
either. Running something like a system update (e.g., yaourt) then
acts as if I had put time on the front of it. Pretty slick!
So you need a command that eats some user/system time; sleep does
not. Although total elapsed is long enough, user and system time is
not:
% time sleep 3
sleep 3 0.00s user 0.00s system 0% cpu 3.002 total
Also, no need to export this since it's directly used by Zsh.
You can undo/turn off this behavior with:
% unset REPORTTIME
Docs on REPORTTIME from man zshparam:
If nonnegative, commands whose combined user and system execution times (measured in seconds) are greater than this value have timing statistics printed for them. Output is suppressed for commands executed within the line editor, including completion; commands explicitly marked with the time keyword still cause the summary to be printed in this case.

Sales Order Confirmation Error

I am trying to confirm the sales order but I am getting error shown below. The environment is updated from CU1 to CU9 recently. I did Full Compilation and Full CIL and Incremental CIL with out errors. Can you please suggest what could be the issue?
Thanks in advance.
Error : Map object not initialized.
Stack trace
(S)\Classes\FormletterService\postJournal - line 52
(S)\Classes\FormletterService\run - line 221
(S)\Classes\FormletterService\postSalesOrderConfirmation - line 14
(S)\Classes\DictClass\callObject
(S)\Classes\SysOperationServiceController\runOperation - line 93
(S)\Classes\SysOperationServiceController\runServiceOperation - line 22
(S)\Classes\DictClass\callStatic
(S)\Classes\SysDictClass\invokeStaticMethod - line 26
(S)\Classes\SysDictClass\invokeStaticMethodIL - line 39
(S)\Classes\SysOperationRPCFrameworkService\runServiceOperation - line 5
(C)\Classes\SysOperationServiceController\runOperationWithRunAs - line 7
(C)\Classes\SysOperationServiceController\run - line 22
(C)\Classes\FormLetterServiceController\run - line 3
(C)\Classes\SalesFormLetter\run - line 95
(C)\Classes\SalesFormLetter\main - line 138
(C)\Classes\FormFunctionButtonControl\Clicked
The error is caused because the docuRefRecIdsPerJournalMap variable of class FormLetterService is not initialized. Debug method initDocuRefRecIdsPerJournalMap where this variable gets initialized and also method run where the initialization method gets called. You may also have to check classes that extend from FormLetterService and overwrite any of these methods or change the docuRefRecIdsPerJournalMap variable. Also check if you have any customizations on these classes.
Try to 'Compile forward' the base class FormletterService and afterwards do a full CIL compilation again
Hope that helps

how to get arc diff on the command line to assume yes on very large number of changes

My Jenkins server is running arc diff, and once in a while I have large diffs, I don't want my job to fail if that is the case:
Right with the latest master of arc, I get:
This diff has a very large number of changes (762). Differential works
best for changes which will receive detailed human review, and not as
well for large automated changes or bulk checkins. See
https://secure.phabricator.com/book/phabricator/article/differential_large_changes/
for information about reviewing big checkins. Continue anyway? [y/N]
[1mUsage Exception:[m Aborted generation of gigantic diff.
Build step 'Execute shell' marked build as failure
My current code tries to avoid interactivity and mostly works, except for large diffs. Any way around this?
echo "jenkins
Summary:
Test Plan:
required
Reviewers:
alberto56
Subscribers:
JIRA Issues:
$JIRAISSUE" > arc_info.txt
arc diff --allow-untracked --message jenkins --message-file arc_info.txt origin/master
rm arc_info.txt
There is no interaction option (yet) for arc diff. You may wanna try something like:
echo 'y' | arc diff ...
or even
echo 'y y y' | arc diff ...
You could also use the Yes command: http://linux.die.net/man/1/yes

Percentage Reported By PHPUnit: What Does it Mean?

I'm working on my first project in which I'm utilizing PHPUnit for unit testing. Things have been moving along nicely; however, I've started getting the following output with recent tests:
................................................................. 65 / 76 ( 85%)
...........
Time: 1 second, Memory: 30.50Mb
OK (76 tests, 404 assertions)
I cannot find any information about what the "65 / 76 ( 85%)" means.
Does anyone know how to interpret this?
Thanks!
It means the amount of tests that have been run so far (test methods actually, or to be even more precise: test method calls, because each test method can be called several times).
65 / 76 ( 85%)
65 tests of 76 have already run (which is 85% overall)
And as long as you see dots for each of them - all of them passed
I didn't understand it until I kept writing more tests, here's a sample of what you see as the number of tests grow:
............................................................... 63 / 152 ( 41%)
............................................................... 126 / 152 ( 82%)
..........................
...it's just a progress indicator of the number of tests that have been run. But as you can see, it still gets to the end.

Resources