None of the PHP Unit tests implemented run.
It doesn't throw errors either.
No errors are logged and the test keeps running infinitely.
C:\xampp_v7.0\htdocs\...>vendor\bin\phpunit --verbose tests\TestCase\Model\Table\UsersTableTest.php
PHPUnit 6.5.9 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.30 with Xdebug 2.5.5
Configuration: C:\xampp_v7.0\htdocs\...\phpunit.xml.dist
I restarted MySql server and this was fixed.
Another possible reason could be
Errors in the data loaded in Fixtures (Any syntax errors in the fixture files can lead to this situation) This can be identified by excluding all fixtures and including them one at a time and running the tests. Using this way the fixture that caused the issue can be found.
Related
I just installed on an AWS EC2 Ubuntu, the 10.0 version of KiwiTCMS based on the docker image as explained here : https://kiwitcms.readthedocs.io/en/stable/installing_docker.html.
It seems to work pretty well as I can create a test plan, test cases and test executions.
The issue comes when I try to attach some screenshots to my test execution, I can select a file on my disk but then it fails with an error 500.
I checked that the uploads volume is well mounted.
Do you have some idea about what I forgot to configure?
I've solved exactly same problem giving write permisstions to "uploads" folder.
In my case,
chmod ugoa+rwx /opt/kiwi_tcms/uploads
ER
A couple of days ago I upgraded my app from 3.6.6 to 3.7.5. Before I did the upgrade I ran all my tests which provided the following results:
// Environment
CakePHP Version: 3.6.6
PHPUnit Version: 6.5.14
// Results
Tests: 476, Assertions: 1927
// Sublime Text 3 find with $this->assert
1038 $this->assert's found.
Therefore: 1038 $this->assert found and 1927 assertions in results.
// Controller Test
use Cake\TestSuite\IntegrationTestCase;
class UsersControllerTest extends IntegrationTestCase
{
======================================================================
I created a new project with composer self-update && composer create-project --prefer-dist cakephp/app app_name.
I copied all the files over and implemented the changes documented in the migration guide.
I logged in and everything worked (Except for the middleware csrf token mismatch error but thats another issue.)
I ran my tests again and the following results where provided.
// Environment
CakePHP Version: 3.7.5
PHPUnit Version: 6.5.8
// Results
Tests: 497, Assertions: 1135
// Sublime Text 3 find with $this->assert
1059 $this->assert's found.
Therefore: 1059 $this->assert found and 1135 assertions in results.
// Controller Test
use Cake\TestSuite\TestCase;
use Cake\TestSuite\IntegrationTestTrait;
class UsersControllerTest extends TestCase
{
use IntegrationTestTrait;
======================================================================
I've double checked I copied everything over accurately and everything is as it should be apart from understanding
the test results.
I also used Sublime Text 3 to check that I hadn't called $this->assert 792 more times after my upgrade but this confirmed it's been called the correct amount of times taking into consideration I did 21 more tests.
The only differences I can see are:
In 3.6.6 IntegrationTestCase is used.
In 3.6.6 PHPUnit Version: 6.5.14 is used.
In 3.7.5 TestCase and IntegrationTestTrait is used.
In 3.7.5 PHPUnit Version: 6.5.8 is used.
======================================================================
// Question:
I'm hoping someone can help me understand why I can do 21 more tests but have 792 less assertions? Is it the use of TestCase and IntegrationTestTrait instead of IntegrationTestCase or the PHPUnit version difference or maybe something else?
Thanks. Z.
======================================================================
#ndm, thanks for the input.
I would like to follow your advice but the situation has changed. I got up this morning and tried to replicate the results from yesterday. My new 3.7.5 app test results were the same:
// Environment
CakePHP Version: 3.7.5
PHPUnit Version: 6.5.8
// Results
Tests: 497, Assertions: 1135
Then I loaded my old 3.6.6 app and ran the tests again but the PHPUnit version had changed and these were the results:
// Environment
CakePHP Version: 3.6.6
PHPUnit Version: 6.5.8
// Results
Tests: 497, Assertions: 1135
I thought I'd made a mistake yesterday and copied the wrong folder so I got my master backups out which hadn't been touched (All the way back to 19/01/19). I loaded 4 backups all on CakePHP version 3.6.6. All of them show these results.
// Environment
CakePHP Version: 3.6.6
PHPUnit Version: 6.5.8
// Results
Tests: 497, Assertions: 1135
So now I'm wondering where on earth is PHPUnit 6.5.14?
Since 19/01/19 I've run my tests on my CakePHP 3.6.6 apps about 50 times and when you run the test the cmd line always displays the PHPUnit version so I know I was using PHPUnit 6.5.14.
And now I'm wondering what could explain this? This also means I cannot replicate the results from yesterday.
Your advice has put my mind at rest, ie: it could be a lot of different things. Also I need to weigh up the time it would take me to isolate the reason against the benefits of knowing the reason.
For the moment I've decided to put this issue on my to do list seeing as it still does run all the tests and it could be as you mention "Maybe some assertion methods provided by CakePHP changed so that they internally make less calls to PHPUnit assertion methods. Maybe PHPUnit wasn't calculating things incorrectly in earlier versions. Maybe something totally different, there could be lots of reasons" and it's an unknown amount of time to get to the bottom of.
Hopefully within the next couple of months I can free up some time to get into it but for the moment I've filed it under "Sherlock Holmes and the case of the missing PHPUnit version". :)
Thanks again, Z.
I have basic Galen testing set up on a responsive Angular site, running through a simple test on desktop and tablet versions of the site.
I did not build this site and cannot say if Galen ever fully worked properly on the website. I did myself upgrade Galen from v1.6.3 to v2.2.1 in NPM, which included updating syntax etc in the .test file and two .gspec files.
Almost everything appears to be working fine by the Gulp command I am running in Mac terminal:
GALEN_URL=http://localhost:3000/MYSITE/ gulp test:galen-local
This runs the test locally (vs SauceLabs). Via terminal, I see the two tests run, with test criteria printed out, and I get a note that there is a failure on tablet version (it's an easy CSS-related fix for tablet version, and I'm not worried about that). Also, I am getting the HTML reports for those two tests, written to a local directory.
My problem is the following error message I get after the tests run:
========================================
Failed tests:
Login page on tablet device
Suite status: FAIL
Total tests: 2
Total failed tests: 1
Total failures: 3
There were failures in galen tests
[13:51:04] 'test:galen-local' errored after 11 s
[13:51:04] Error in plugin 'gulp-shell'
Message:
Command `./node_modules/.bin/galen test tests/galen/tests/local.test --htmlreport galen-reports -DwebsiteUrl=http://localhost:3000/MYSITE/ -DsauceUser=USERNAME -DsauceKey=SAUCEKEY` failed with exit code 1
What is failed with exit code 1? I have searched Galen docs, searched the web, and I can't figure out what might be going wrong. I have no idea what that means.
I can provide more code if needed, but the website is relatively sophisticated and things are abstracted out across many files.
thanks for any assistance
I think I might have answered my own question just now...
When I removed the test criteria that were failing for tablet version, I got the following in terminal with no "command" error message:
========================================
Suite status: PASS
Total tests: 2
Total failed tests: 0
Total failures: 0
[14:24:16] Finished 'test:galen-local' after 11 s
I presume the command error message was just a reflection that tests in the overall suite were failing. Still, it seems odd to me that such an error message would appear after a Total failed tests: 1 Total failures: 3 message already made clear that certain tests in the tablet version were failing. And I still don't know what specifically the "error code 1" above means.
If anyone has any insight, feel free to chime in. Otherwise, I'll mark this as THE answer at some point, if I don't just delete the entire question.
I want to log defects automatic on jira whenever any test case gets fail.for that i have used JiraTesttResultReport plugin.i have successfully able to create my report.xml file.but i got below errors:
Build step 'Publish JUnit test result report' changed build result to UNSTABLE
[JiraTestResultReporter] [INFO] Examining test results...
ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getTestResultAction()Lhudson/tasks/test/AbstractTestResultAction;
at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:105)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
On what version of Jenkins are you working?
JiraTestResultReporter does not work on Jenkins 1.577+
It's a known bug
A workaround is to build and install a snapshot of the plugin.
I'm a newbie in cakephp, I'm trying to upgrade cakephp to the latest version.
I install the fresh cakephp 1.3 on my computer and the upgrade it to cakephp 2.1.
I use shell to upgrade, but after I run 'upgrade all' command, I saw two error:
Warning Error: chmod(): Operation not permitted in [/var/www/cakephp-1.3/lib/Cake/Utility/Folder.php, line 639]
Warning Error: touch(): Utime failed: Operation not permitted in [/var/www/cakephp-1.3/lib/Cake/Utility/Folder.php, line 640]
I think it has upgraded complete. Because I see the message from terminal like this:
Done updating /var/www/cakephp-1.3/app/Console/cake.php
Done updating /var/www/cakephp-1.3/app/Console/Command/AppShell.php
Running components
Running exceptions
Then I refresh my app and I got some errors:
http://flic.kr/p/bwUpwY
Then I delete 'cake' directory, and the error message has changed:
http://flic.kr/p/bKP7Te
So now I don't know what to do next, because I did many ways but still not make it work.
So anybody please tell me what I did wrong and how can I upgrade cakephp successful.
Thanks in advance.
This looks like you have permissions issues on some of the directories that the CakePHP migration script expects to be writable.
This could lead to the migration failing on some parts and leaving a partially broken install after it completes.